openworm / CElegansNeuroML

NeuroML based C elegans model, contained in a neuroConstruct project, as well as c302
http://opensourcebrain.org/projects/celegans
134 stars 53 forks source link

Make c302 installable #109

Closed rgerkin closed 3 years ago

rgerkin commented 6 years ago

Currently c302 is just a random, deep, subdirectory of cElegansNeuroML. Importing it as a module in Python requires adding its location to the path. I would like to, without changing the directory structure, give it its own setup.py file so I can pip install it (doesn't have to be on PyPI), and then be able to freely import it other python applications that then won't need to figure out where it is each time. For example, I could then import it into testing scripts that live outside of cElegansNeuroML. Any thoughts?

rgerkin commented 6 years ago

This can be solved with something like:

setup(
     name = 'CElegansNeuroML',
+    package_dir = {'': 'CElegans/pythonScripts'},
+    packages = ['c302'],
     install_requires=[

which will make a pip install in the CElegansNeuroML root directory install the package c302. This is how I am currently using c302 from the sciunit branch.

pgleeson commented 6 years ago

Certainly that's the plan. Eventually the code will move here for ease of locating it: https://github.com/openworm/c302

The main thing preventing this move so far was that some of the files for c302 are located elsewhere in the CElegans repo, e.g. NeuronConnectFormatted.xlsx, and I didn't want to have multiple copies of these in different repos. It will be easier to separate them when c302 takes connections from PyOpenWorm, but there are some things to iron out with that first...

Go ahead and open a PR for the change above (you can change the name to c302 too) if it works for your workflow and it can be moved when interaction with spreadshets/pyow is settled.

rgerkin commented 6 years ago

OK, thanks. I currently have things set up this way in the sciunit branch of CElegansNeuroML, but also a bunch of other things that were required to make c302 and associated functions module-like and not merely script-like. I will open a PR for it.

pgleeson commented 3 years ago

https://github.com/openworm/c302