Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add Metabolic HH neuron model after Dutta et al. #531
Add Metabolic HH neuron model after Dutta et al. #531
Changes from 6 commits
e2a219e
01213bf
081f8df
6b2c73a
2db3bbd
645d4ac
c2c8e21
de832ab
884695b
b8a9f9e
6cdcb94
c90e34e
4460e53
e05aa0a
032f982
b5b3f40
63e4e17
bfb0f8d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this
neurontype
keyword argument used for? It doesn't seem to affect anything in the code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch. Thank you! Somehow the part where it's used got washed out throughout the recent edits. "Neurontype" would be used in the connection rule. See the latest commit which has it now. It would determine whether to use excitatory or inhibitory parameters for the synaptic connection depending on the source neuron's type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did want to ask for some help with this as currently it throws an error and I expect the test to fail accordingly.
ERROR: ArgumentERror: System nrn1: variable neurontype doesn't exist.
I understand where it's coming from, but I'm struggling to find a workaround. Would you have any advice? I think the way it is now used to work in the past but I might be wrong. Either way, is there a way I can access the property neurontype in connections?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. It seems that the problem is that @harisorgn added this override for
getproperty
last month:Neuroblox.jl/src/blox/blox_utilities.jl
Lines 1 to 9 in 89cadb8
which means that when you do
n.field
it redirects it ton.system.field
instead. Not sure how I feel about that one tbh since it's kinda inconvenient for blox like this.The fix in your case is simple though, you can just replace
with
That said, I think it might be a good idea to have separate types for excitatory versus inhibitory neurons here (or distinguish them by a type parameter like in #532).
If we do want to keep them as one type though, it's usually a little more idiomatic to use a
Symbol
here instead of aString
(i.e.:excitatory
instead of"excitatory"
) but for our purposes here it doesn't really matter much.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an example of what I mean by using a type parameter to distinguish between them:
Neuroblox.jl/src/blox/neural_mass.jl
Lines 488 to 521 in a471227
in this case, the type parameter says if the neuron has a noise term or not, but a similar idea could be used for excitatory vs inhibitory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for convenience, so people can do
blox.variable_name
orblox.parameter_name
and easily access these variables or params in a solution too. I'd say people liked it in the course. Of course it was done a bit hackily to save time. Ideally we should check if the field is a state or param and only then propagate togetproperty
in the inner system. Also we should make it so thatcomposite_blox.inner_neuron.variable_name
works by checking the field against the names of theget_neurons(composite_blox)
orget_parts(composite_blox)
. This is a separate PR though and doesn't really apply to Botond's case here. Parametric types is the way to go here as Mason said.