openworm / c302

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

Update OpenWormReader to use the latest version of PyOpenWorm (pt 1) #10

Open mwatts15 opened 6 years ago

mwatts15 commented 6 years ago

As a first approximation, can just hard-code <http://openworm.org/entities/bio#worm0> as the context to query against (it's sort of the 'top-level' context produced by insert_worm.py into the OpenWormData repo). Will be modified in owupd1 to its final form.

pgleeson commented 5 years ago

@mwatts15 I've updated https://github.com/openworm/c302/blob/master/c302/OpenWormReader.py to be runnable with:

python c302/OpenWormReader.py 

similarly to

 python c302/UpdatedSpreadsheetDataReader.py

which reads directly from the latest spreadsheet. This works with the version of PyOpenWorm we use in the Docker installation: https://github.com/openworm/OpenWorm/blob/development/Dockerfile#L105, but not the latest in the dev branch...

mwatts15 commented 5 years ago

There are a couple things to update:

  1. There's a reference to files in the CElegansNeuroML directory structure? I see the cell names coming from there are used to filter what OpenWormReader returns, but that's a misuse -- if there's a specific subset of cells c302 needs to use, then that subset should be written into the graph or the list should be filtered outside of the reader. I've just removed the filtering for now
  2. The database has to be explicitly cloned now. I've done it manually but it should be written in the c302 README somewhere.
pgleeson commented 5 years ago

@mwatts15 I've taken out all of those references to the files in the other CElegansNeuroML repo in the latest commit, which doesn't seem to have been merged into your branch: https://github.com/openworm/c302/commit/a80499738067f2a9b0256003cc9c9ddcd44c32f2#diff-4dca74f5e9f27a6180a8aa5606bf514cL25.

Not sure what you mean by "The database has to be explicitly cloned now". Can't this be a step integrated in an updated setup.py for PyOpenWorm?

mwatts15 commented 5 years ago

@mwatts15 I've taken out all of those references to the files in the other CElegansNeuroML repo in the latest commit, which doesn't seem to have been merged into your branch: a804997#diff-4dca74f5e9f27a6180a8aa5606bf514cL25.

Thanks. Why not use the logging module in the initializer? When I use OpenWormReader outside of that script, wouldn't I generally want the option to quiet its output?

Not sure what you mean by "The database has to be explicitly cloned now". Can't this be a step integrated in an updated setup.py for PyOpenWorm?

You run a command pow clone <github-repo> which creates a .pow directory under your current working directory. Not doing that as part of the PyOpenWorm setup.py script is a design decision that we can chat about, but I don't think comment thread is the place.

pgleeson commented 5 years ago

I've just used the simpler print_() statement to make it easier to follow logs across c302/pyNeuroML/libNeuroML etc. e.g.

...
c302      >>>  Generating plots for: Membrane potentials of 14 neuron(s) (Oscillator C0)
pyNeuroML >>> Generating plot: Membrane potentials of 14 neuron(s) (Oscillator C0)
c302      >>>  Plotting neuron activities ([Ca2+])
...

I know they could all be updated to use logger, but hope you can live with it for now...

Re the database, will try that. I assume pow is an executable created when PyOpenWorm is installed? Any issue with this overwriting a system command pow for calculating powers?

mwatts15 commented 5 years ago

Yes, pow is installed with PyOpenWorm. I don't know of any GNU or Unix utility called pow, but probably users can resolve any namespace conflicts themselves.