Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion netpyne_ui/netpyne_geppetto.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def simulateNetPyNEModelInGeppetto(self, args):
logging.debug('Running single thread simulation')
netpyne_model = self.simulateNetPyNEModel()

return json.loads(GeppettoModelSerializer().serialize(self.geppetto_model))
return json.loads(GeppettoModelSerializer.serialize(self.geppetto_model))
except:
return utils.getJSONError("Error while simulating the NetPyNE model", sys.exc_info())

Expand Down
2 changes: 2 additions & 0 deletions netpyne_ui/netpyne_model_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def getGeppettoModel(self, netpyne_model):

# We create a GeppettoModel instance and we set a name a assign a lib
geppetto_model = self.factory.createGeppettoModel('NetPyNEModel')
self.factory.geppetto_common_library = geppetto_model.libraries[0]
netpyne_geppetto_library = pygeppetto.GeppettoLibrary(
name='netpynelib')
geppetto_model.libraries.append(netpyne_geppetto_library)
Expand All @@ -44,6 +45,7 @@ def extractPopulations(self, netpyne_model, netpyne_geppetto_library, geppetto_m
composite_id = cell['tags']['pop'] + "_cell"

cellType = pygeppetto.CompositeType(id=str(composite_id), name=str(composite_id), abstract= False)

visualType = pygeppetto.CompositeVisualType(id='cellMorphology', name='cellMorphology')
cellType.visualType = visualType
defaultValue = ArrayValue(elements=[])
Expand Down
21 changes: 21 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'''
Run this to debug
'''
import sys
import os
from notebook.notebookapp import main, NotebookApp
import netpyne_ui
from jupyter_geppetto import settings

settings.debug = True

if __name__ == '__main__':
sys.argv.append('--NotebookApp.default_url=/geppetto')
sys.argv.append("--NotebookApp.token=''")
sys.argv.append('--library=netpyne_ui')

app = NotebookApp.instance()
app.initialize(sys.argv)
app.file_to_run = ''
sys.exit(app.start())

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'Programming Language :: Python :: 3.7'
],
install_requires=[
'jupyter_geppetto==0.4.2',
'jupyter-geppetto>=1.0.0',
'netpyne==0.9.1.1'
],
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"_README" : "http://docs.geppetto.org/en/latest/build.html",
"contextPath": "org.geppetto.frontend/",
"contextPath": "org.geppetto.frontend",
"useSsl": false,
"embedded": false,
"embedderURL": ["/"],
Expand Down
31 changes: 18 additions & 13 deletions utilities/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def checkout(folder, default_branch, cwdp):
newPath = currentPath+"/"+cwdp+folder
print(newPath)
os.chdir(newPath)
python_git=subprocess.Popen("git branch -a",shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
python_git = subprocess.Popen("git branch -a && git tag", shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
outstd,errstd=python_git.communicate()
if branch and branch in str(outstd) and branch != 'development': # don't ckeckout development for netpyne
subprocess.call(['git', 'checkout', branch], cwd='./')
Expand All @@ -45,25 +46,29 @@ def main(argv):
main(sys.argv[1:])

os.chdir(os.getcwd()+"/../")
# Cloning Repos
clone('https://github.com/openworm/pygeppetto.git','pygeppetto','development')
subprocess.call(['pip', 'install', '-e', '.'], cwd='./pygeppetto/')


clone('https://github.com/Neurosim-lab/netpyne.git','netpyne','ui')
subprocess.call(['pip', 'install', '-e', '.'], cwd='./netpyne/')

clone('https://github.com/openworm/org.geppetto.frontend.jupyter.git','org.geppetto.frontend.jupyter','development')
with open('npm_frontend_jupyter_log', 'a') as stdout:
subprocess.call(['npm', 'install'], cwd='./org.geppetto.frontend.jupyter/js', stdout=stdout)
subprocess.call(['npm', 'run', 'build-dev'], cwd='./org.geppetto.frontend.jupyter/js')


# We can't clone org.geppetto.frontend as a regular submodule because Travis doesn't have .gitmodules in the zip
# subprocess.call(['git', 'submodule', 'update', '--init'], cwd='./')
clone('https://github.com/openworm/org.geppetto.frontend.git','geppetto','development','netpyne_ui/', False, 'geppetto')
clone('https://github.com/MetaCell/geppetto-netpyne.git','geppetto-netpyne','development','netpyne_ui/geppetto/src/main/webapp/extensions/')

branch = None
# Cloning Repos
clone('https://github.com/openworm/pygeppetto.git','pygeppetto','development')
subprocess.call(['pip', 'install', '-e', '.'], cwd='./pygeppetto/')
clone('https://github.com/openworm/org.geppetto.frontend.jupyter.git','org.geppetto.frontend.jupyter','development')
with open('npm_frontend_jupyter_log', 'a') as stdout:
subprocess.call(['npm', 'install'], cwd='./org.geppetto.frontend.jupyter/js', stdout=stdout)
subprocess.call(['npm', 'run', 'build-dev'], cwd='./org.geppetto.frontend.jupyter/js')

print("Enabling Geppetto NetPyNE Extension ...")
geppetto_configuration = os.path.join(os.path.dirname(__file__), './utilities/GeppettoConfiguration.json')
geppetto_configuration = os.path.join(os.path.dirname(__file__), './utilities/GeppettoConfiguration.copyme.json')
copyfile(geppetto_configuration, './netpyne_ui/geppetto/src/main/webapp/GeppettoConfiguration.json')

# Installing and building
Expand All @@ -75,10 +80,10 @@ def main(argv):
print("Installing jupyter_geppetto python package ...")
subprocess.call(['pip', 'install', '-e', '.'], cwd='./org.geppetto.frontend.jupyter')
print("Installing jupyter_geppetto Jupyter Extension ...")
subprocess.call(['jupyter', 'nbextension', 'install', '--py', '--symlink', '--user', 'jupyter_geppetto'], cwd='./org.geppetto.frontend.jupyter')
subprocess.call(['jupyter', 'nbextension', 'enable', '--py', '--user', 'jupyter_geppetto'], cwd='./org.geppetto.frontend.jupyter')
subprocess.call(['jupyter', 'nbextension', 'enable', '--py', 'widgetsnbextension'], cwd='./org.geppetto.frontend.jupyter')
subprocess.call(['jupyter', 'serverextension', 'enable', '--py', 'jupyter_geppetto'], cwd='./org.geppetto.frontend.jupyter')
subprocess.call(['jupyter', 'nbextension', 'install', '--py', '--symlink', '--sys-prefix', 'jupyter_geppetto'], cwd='./org.geppetto.frontend.jupyter')
subprocess.call(['jupyter', 'nbextension', 'enable', '--py', '--sys-prefix', 'jupyter_geppetto'], cwd='./org.geppetto.frontend.jupyter')
subprocess.call(['jupyter', 'nbextension', 'enable', '--py', '--sys-prefix', 'widgetsnbextension'], cwd='./org.geppetto.frontend.jupyter')
subprocess.call(['jupyter', 'serverextension', 'enable', '--sys-prefix', '--py', 'jupyter_geppetto'], cwd='./org.geppetto.frontend.jupyter')

print("Installing NetPyNE UI python package ...")
subprocess.call(['pip', 'install', '-e', '.'], cwd='.')