NeuroML / pyNeuroML

A single package in Python unifying scripts and modules for reading, writing, simulating and analysing NeuroML2/LEMS models.
https://docs.neuroml.org/Userdocs/Software/pyNeuroML.html
GNU Lesser General Public License v3.0
36 stars 30 forks source link

Feat/add neuron cell info utils #184

Closed sanjayankur31 closed 1 year ago

sanjayankur31 commented 2 years ago

@pgleeson : this looks ready too. I can't get the test to work in our unit tests, something weird with NEURON, but I've tested the functions out with a different script, and all the wrappers work fine.

We can replace the mod files etc. I've copied in from the Hay et. al L5PC model with simpler ones too---I was just testing with those so have checked them in for now.

sanjayankur31 commented 2 years ago

@shayan823: these are the same ones but now for some of these we've added a json/yaml export to make it easier to compare. Could you have a look to see what else you'd need?

shayanshafquat commented 2 years ago

Thanks, this solves my purpose for now. But I will also print the gbar of the mechanisms for each of the segments of a section instead of the average value. Adding that eventually to cellInfo() will help especially when the cell contains nonhomogenous mechanisms. @sanjayankur31

sanjayankur31 commented 2 years ago

Ok, sounds good. Let me add that too.

-- Thanks,

Ankur

(Sent from mobile device)

sanjayankur31 commented 2 years ago

@shayan823 : how does this look? It should now show the average values over sections, but also show the value in each section for each parameter.

sanjayankur31 commented 2 years ago

@pgleeson this is ready for merge too. I think it's all correct now. I've added some basic tests for the moment to check values, and they seem to pass (picked values by hand from olm.hoc and compared that the getinfo function returns these too).

Probably best to merge this and then keep tweaking as we go.

@shayan823 : would you also test this with the bahl model to double-check that the reported values are correct if you can please?

shayanshafquat commented 2 years ago

@sanjayankur31 I tested it on the Bahl original neuron code, giving me the desired results even for the nonhomogeneous channels (nat, ih, kfast, kslow) . Though when using getinfo() on tuft I was expecting it to output vShift as well for the sca mechanism which was missing. Maybe it's not because of some error in the code because for the apical it's showing vShift & vShift2 for nat perfectly.

sanjayankur31 commented 2 years ago

@sanjayankur31 I tested it on the Bahl original neuron code, giving me the desired results even for the nonhomogeneous channels (nat, ih, kfast, kslow) . Though when using getinfo() on tuft I was expecting it to output vShift as well for the sca mechanism which was missing. Maybe it's not because of some error in the code because for the apical it's showing vShift & vShift2 for nat perfectly.

hrm, yeh, it should print out whatever parameters are defined for each mechanism because we iterate over all of them. According to the output sca only has 3 parameters, and vshift is not one of them.. I'll check that again, and if the code is correct we should check with Padraig next week---could be another NEURON idiosyncrasy?

sanjayankur31 commented 2 years ago

I was looking at the hoc file. There are quite a few other parameters defined too. I don't understand why NEURON says that it has only 3 parameters. I count 13? I'll ask Padraig..

sanjayankur31 commented 1 year ago

Merging this one---they're specific utils and not core neuroml functions, so we can continue to improve and bugfix as we go.