openworm / c302

The c302 framework for generating multiscale network models of C. elegans
https://www.opensourcebrain.org/projects/c302
109 stars 22 forks source link

Deprecated dependencies: Use command line interface to create new network #70

Open NuSynth opened 9 months ago

NuSynth commented 9 months ago

This is for the Readme, in Usage Examples: Section 2) Use command line interface to create new network Specifically, for this command line example code:

c302 MyNetwork parameters_C -cells ["AVBR","VD3"] -cellstostimulate ["AVBR"] -paramoverride {"unphysiological_offset_current":"2.9pA"} -duration 300

There's a lot of things going on here. I had some issue with owmeta that I dont recall what they were.

The wrapt package that was setup on my system, I guess when I installed this, was too new. I had to downgrade to version 1.11.1.

Now I'm getting this: ImportError: cannot import name inspect.formatargspec. I guess the code, or one of its dependencies, is trying to use the formatargspec function from the inspect module, which has been deprecated and removed in Python 3.11. I'm reading that the inspect.signature function replaced it.

If I try to correct that code on my system, I think I will get sucked into a rabbit hole because I do not know the design of this software.

Reason I want to use this functionality I was wanting to do a variation on that command in order to generate the LEMS files, and I guess the NeuroML 2 files, for each neuron for a script that:

  1. Iterates over a range of current clamp values.
  2. Runs a simulation for each value.
  3. Records the neuron's response.
  4. Identifies the minimum active response and the maximum sustainable response.
  5. Saves a record of the test results to have the input current value, the output current value, and the ISI if there is one.

These tests would be ran on one neuron each. Not to simulate the interactions between the neurons.

Is there another way I can generate that LEMS file, such as another program, or the possibility of running that command from the openworm docker image?

I don't know how to run the command from the openworm docker image, if doing that is possible. But I can figure it out if the other stuff I am trying does not work. Right now I am setting up older versions of linux in virtual machines trying to find one that is not too old to prevent me from installing this program in it, while not being too new to run that command.

pgleeson commented 9 months ago

Hi @Dartomic, Sorry, I had in my mind that I answered this already. First of all, thanks for testing out c302, it's highlighting some issues we've been un aware of. The main issue is that the current c302 doesn't work on python >=3.11 (see here). This isn't c302 itself, but owmeta, which is a package used to extract metadata on the worm cells. This is unfortunately not actively updated anymore, and is not likely to work on py3.11 soon. c302 should in theory work fine without owmeta, but some code will have to be changed to not have it as an install requirement and catch cleanly when it's not found.

So your options are:

1) create a virtual environment using conda or venv for py3.10, and everything should work better 2) wait for us to update c302 to work without owmeta (a few weeks?) 3) wait for owmeta to support py3.11 (a few months?)

Regarding your question on recording the neuron/muscle's response for different currents, see https://github.com/openworm/c302/blob/master/examples/parametersweep/README.md. This is the file to general that: https://github.com/openworm/c302/blob/master/examples/parametersweep/Sweep.py, but you'll need a working install of c302.