Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated CMC code #474

Merged
merged 34 commits into from
Nov 13, 2024
Merged

updated CMC code #474

merged 34 commits into from
Nov 13, 2024

Conversation

david-hofmann
Copy link
Member

Canonical micro-circuit code updated. Use add_edge! with blox rather than indices, makes code more readable. Also updated blox connectors to use the helper function generate_weight_param.

david-hofmann and others added 25 commits October 21, 2024 01:35
…to be able to set tunable flag for individual parameters of the array. Added untune! utility function to set tunable flag to false on list elements.
…ctors and set standard connection weight to non-tunable
* add tests for AdjacencyMatrix

* fix import and typo

* fix names test
* more terms from connections to neurons

* accumulate both states and parameters (values) for spike affects

* match state with the correct parameter value in spike affect

* allow for duplicate parameters to be passed in functional affect using Pairs

* update comment & fix typo

* rename variable for clarity

* synchronize GraphDynamicsInterop with changes to the LIFExci / LIFInh neurons

---------

Co-authored-by: Mason Protter <[email protected]>
* Add citation links

* Add alternative method for creating edges from adjacency matrix

* New PING network illustration

Thanks to Annabel for creating a much cleaner version!

* Final tweaks to address direct comments

* Updating documentation for PING blocks

Missing docstrings for API creation and Scott's right we should have that for tutorials

* Adding bullet points to the intro

* Suggestions are pretty much covered now

Still missing API links though - will discuss further before merging.

* Just seeing if this compiles the docs

* and does this compile

* try adding a note

* add offset to last line

---------

Co-authored-by: haris organtzidis <[email protected]>
* update Getting Started text

* change title and fix link in parkinsons

* add seed and update plot in resting_state

* remove outdated phrase

* Fix the Parkinson's circuit to match Liu et al. 2020

Looks like this replicates their dynamics now. Includes all the weights from their paper and splits the striatum into the three groups instead of wherever we got that one striatum block from.

* Prettify the introduction

* Fix Jansen-Rit docstring to show defaults

* Add dispatch of powerspectrum for neural masses

* Overhaul of Parkinson's JR tutorial

This has some pretty significant changes that should address nearly all the points

---------

Co-authored-by: agchesebro <[email protected]>
* fix mistake in LIFExciNeuron connections

* increase test duration to catch the bug
…mics (#484)

* remove soem junk

* more junk

* switch to using `ForeachConnectedSubsystem` instead of composite events

* make connections subtypes of ConnectionRule

* allow skipping building `ODESystem`

* bump GraphDynamics compat

* remove more unused comments
* move `t_warmup` to kwargs

* more RL save test

* add `run_warmup` function

* update `run_trial!` function

* add getter functions for states and times when actions and learning rules are evaluated

* update `run_experiment!` dispatches

* move RL tests in a single file

* remove `save_idxs` kwarg

* import `CSV.write` for RL save
* import Symbolics.variable

* add concrete types to learning rule fields

* add function to narrow Dict type

* narrow `learning_rules` type

* use a `Union{Nothing, Num}` instead of `Num` so that `maybe_set_state_*` works
* Add illustration to Parkinson's tutorial

* rename `STH -> STN` for consistency with other tutorials

* fix file path and rename file for consistency

---------

Co-authored-by: Haris Orgn <[email protected]>
* initial DBS protocol for getting ERNAs

* unify DBS and DBSProtocol into single type

* add DBS protocol example

* add docstrings for `DBS` and `protocol_dbs` constructors

* add a tunable option to `paramscoping` function

* set DBS and protocol_dbs parameters as not tunable

* change constructor name to ProtocolDBS

* change input frequency units to Hz

* add tests for ProtocolDBS

* adjust `frequency` in `compute_transition_times`

---------

Co-authored-by: haris organtzidis <[email protected]>
@david-hofmann
Copy link
Member Author

@MasonProtter @harisorgn Can you help me understand why the tests were cancelled here? Also why is the GraphDynamics3 failing? It doesn't fail on my local machine. Does this have to do with me adding a Project.toml to the test folder? Did that change the environment in which tests are run? (I remember you guys mentioned to add a relative path to Neuroblox, I dev'ed it to run it on my machine. Is that what's missing?) Thanks!!

@harisorgn
Copy link
Member

Also why is the GraphDynamics3 failing?

You need to ] add Test in the /test/Project.toml. The error says it's missing.

Can you help me understand why the tests were cancelled here?

If one CI run fails then the rest are cancelled. Documentation is independent from the rest though.

Did that change the environment in which tests are run?

Yes, basically since you added /test/Project.toml then this will be instantiated whenever tests are run. See here
https://pkgdocs.julialang.org/v1/creating-packages/#Alternative-approach:-test/Project.toml-file-test-specific-dependencies

Also please delete the packages you ahve added in the main Neuroblox/Project.toml except for the bump in MTK upper bound. The rest should not be needed by Neuroblox and thus it would only be a pain to support them.

@david-hofmann
Copy link
Member Author

You need to ] add Test in the /test/Project.toml. The error says it's missing.

This is a bit odd though since in the documentation it says "In Julia 1.2 and later test dependencies can be declared in test/Project.toml. When running tests, Pkg will automatically merge this and the package Projects to create the test environment."
Which would imply that test is also loaded through the generic Project.toml (like it is locally - I've killed the REPL and activated the test environment and all works fine).

I also noted that GraphDynamics has its own Project.toml which has Test in it, so to me it seems that the GD Project.toml is not loaded anymore after I added a Project.toml to the test folder. The documentation wouldn't discuss Project.toml and folder hierarchies, so I don't know what behavior to expect.

Okay, maybe better to move this to a fresh PR, this is getting more complicated than I had thought.

@harisorgn
Copy link
Member

I'll try one thing and if it fails we can revert to the [targets] way for now. Looks like the /test/Project.toml is not yet a fully stable feature.

@MasonProtter
Copy link
Contributor

We should probably remove Test from the main Project.toml too, I'm not sure why it's there.

@harisorgn
Copy link
Member

oops, good catch

@harisorgn
Copy link
Member

Ok test environment is sorted. I have not cleaned up [extras] int he main Project.toml but that's fine for now. @david-hofmann merge when ready.

@david-hofmann
Copy link
Member Author

great, thanks! But can we not also remove [extras]? Isn't that solely for target based tests as is suggested in the documentation? I tested it locally and it works even after deleting all the [extras] section.

@david-hofmann
Copy link
Member Author

hmm, okay, doesn't seem to work remotely though...

@david-hofmann david-hofmann merged commit ebb3421 into master Nov 13, 2024
6 checks passed
@david-hofmann david-hofmann deleted the fixesCMC branch November 13, 2024 19:13
david-hofmann added a commit that referenced this pull request Dec 10, 2024
* switched from symbolic arrays to list of symbolic parameters. Needed to be able to set tunable flag for individual parameters of the array. Added untune! utility function to set tunable flag to false on list elements.

* added new approach to set tunable flag for the connection matrix also to the tutorial

* use generate_weight_param also in StimulusBlox and ObserverBlox connectors and set standard connection weight to non-tunable

* fixed and cleaned code

* minor changes

* update MTK compat

* added Project.toml to test

* fixed MTK compat once more

* added more packages to test environment needed in GraphDynamics tests

* remove test deps and unnecessary deps

* add Test to tect project

* remove Test dep from main Project

* add missing test deps

* add Statistics dep

* removed [extras] from Project.toml

* added [extras] again.

---------

Co-authored-by: haris organtzidis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants