Skip to content

Commit 013b931

Browse files
Merge branch 'development' into feature/netpyne-106
2 parents e1fb9c6 + 9419e52 commit 013b931

85 files changed

Lines changed: 6456 additions & 2862 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,72 @@ jobs:
5858
npm run Experiment_Manager_test
5959
env:
6060
CI: true
61+
Control_Panel-test:
62+
# The type of runner that the job will run on
63+
runs-on: ubuntu-20.04
64+
container: lironavon/docker-puppeteer-container:14.16.0
65+
env:
66+
CI: true
67+
steps:
68+
- uses: actions/checkout@v1
69+
- name: Use Node.js ${{ matrix.node-version }}
70+
uses: actions/setup-node@v1
71+
with:
72+
node-version: ${{ matrix.node-version }}
73+
cache-dependency-path: frontend/e2e/tests/package-lock.json
74+
- name: Control Panel test using Tut#2
75+
run: |
76+
cd tests/frontend/e2e
77+
#install dependencies
78+
npm ci
79+
# run Control Panel test
80+
npm run Control_Panel_test
81+
env:
82+
CI: true
83+
Save_and_Open_File-test:
84+
# The type of runner that the job will run on
85+
runs-on: ubuntu-20.04
86+
container: lironavon/docker-puppeteer-container:14.16.0
87+
env:
88+
CI: true
89+
steps:
90+
- uses: actions/checkout@v1
91+
- name: Use Node.js ${{ matrix.node-version }}
92+
uses: actions/setup-node@v1
93+
with:
94+
node-version: ${{ matrix.node-version }}
95+
cache-dependency-path: frontend/e2e/tests/package-lock.json
96+
- name: Test for Opening and Saving a file
97+
run: |
98+
cd tests/frontend/e2e
99+
#install dependencies
100+
npm ci
101+
# run Control Panel test
102+
npm run Save_Open_File_test
103+
env:
104+
CI: true
105+
RxD-test:
106+
# The type of runner that the job will run on
107+
runs-on: ubuntu-20.04
108+
container: lironavon/docker-puppeteer-container:14.16.0
109+
env:
110+
CI: true
111+
steps:
112+
- uses: actions/checkout@v1
113+
- name: Use Node.js ${{ matrix.node-version }}
114+
uses: actions/setup-node@v1
115+
with:
116+
node-version: ${{ matrix.node-version }}
117+
cache-dependency-path: frontend/e2e/tests/package-lock.json
118+
- name: Test for RxD plot
119+
run: |
120+
cd tests/frontend/e2e
121+
#install dependencies
122+
npm ci
123+
# run RxD Plot test
124+
npm run RxD_test
125+
env:
126+
CI: true
61127
Tutorial_1-SmokeTest:
62128
# The type of runner that the job will run on
63129
runs-on: ubuntu-20.04

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ venv
3030
webapp/build
3131
webapp/.yalc
3232
node_modules
33-
sa_nyhead.mat
33+
sa_nyhead.mat
34+
workspace

Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:13.14 as jsbuild
1+
FROM node:14.21.3-bullseye as jsbuild
22

33
WORKDIR /app
44

@@ -18,10 +18,10 @@ RUN rm -Rf node_modules/*
1818
FROM jupyter/base-notebook:hub-1.5.0
1919
ENV NB_UID=jovyan
2020
ENV FOLDER=netpyne
21-
ARG GEPPETTO_VERSION=development
2221
ARG BUILD_ARGS=""
23-
ARG NETPYNE_VERSION=master
2422
ARG WORKSPACE_VERSION=master
23+
# ARG GEPPETTO_VERSION=development
24+
# ARG NETPYNE_VERSION=master
2525

2626
ENV FOLDER=/home/jovyan/work/NetPyNE-UI
2727

@@ -32,21 +32,20 @@ RUN apt-get update -qq &&\
3232
apt-get install python3-tk vim nano unzip git make libtool g++ -qq pkg-config libfreetype6-dev libpng-dev libopenmpi-dev openjdk-11-jre-headless -y -y
3333
RUN conda install python=3.7 -y
3434

35-
3635
WORKDIR $FOLDER
3736
COPY --chown=1000:1000 requirements.txt requirements.txt
38-
RUN pip install -r requirements.txt --no-cache-dir --prefer-binary
37+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip && pip install -r requirements.txt --prefer-binary
3938

40-
COPY --chown=$NB_UID:1000 . .
41-
COPY --from=jsbuild --chown=$NB_UID:1000 /app webapp
39+
COPY --chown=jovyan:1000 . .
40+
COPY --from=jsbuild --chown=jovyan:1000 /app webapp
4241

4342

4443
RUN jupyter nbextension install --py --symlink --sys-prefix jupyter_geppetto
4544
RUN jupyter nbextension enable --py --sys-prefix jupyter_geppetto
4645
RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
4746
RUN jupyter serverextension enable --py --sys-prefix jupyter_geppetto
4847

49-
RUN python utilities/install.py ${BUILD_ARGS} --geppetto ${GEPPETTO_VERSION} --netpyne $NETPYNE_VERSION --workspace WORKSPACE_VERSION --npm-skip
48+
RUN python utilities/install.py ${BUILD_ARGS} --workspace $WORKSPACE_VERSION
5049

5150
RUN jupyter labextension disable @jupyterlab/hub-extension
5251

@@ -58,7 +57,8 @@ ENV NEURON_HOME=/opt/conda
5857
# For lfpykit 0.4
5958
# RUN wget -P $(pip show LFPykit | grep "Location:" | awk '{print $2"/lfpykit"}') https://www.parralab.org/nyhead/sa_nyhead.mat
6059
# For lpfykit 0.5
61-
RUN wget --no-check-certificate -P ${FOLDER}/workspace https://www.parralab.org/nyhead/sa_nyhead.mat
60+
ENV NP_LFPYKIT_HEAD_FILE=/home/jovyan/nyhead.mat
61+
RUN wget --no-check-certificate -O $NP_LFPYKIT_HEAD_FILE https://www.parralab.org/nyhead/sa_nyhead.mat
6262

6363
USER $NB_UID
6464

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
![Screenshot](https://github.com/MetaCell/NetPyNE-UI/raw/documentation/docs/netpyneui.png)
99

10-
This repository hosts the User Interface for [NetPyNE](http://www.neurosimlab.org/netpyne/). NetPyNE is a python package
10+
This repository hosts the User Interface for [NetPyNE](https://netpyne.v2.opensourcebrain.org/). NetPyNE is a python package
1111
to facilitate the development, parallel simulation and analysis of biological neuronal networks using the NEURON
1212
simulator.
1313

@@ -116,4 +116,4 @@ docker-compose up --abort-on-container-exit --exit-code-from netpyne-ui-e2e
116116
## Additional Notes
117117

118118
NetPyNE-UI is being developed in collaboration with the [Neurosim Lab](http://neurosimlab.org/). See
119-
the [Wiki](https://github.com/MetaCell/NetPyNE-UI/wiki) for more info!
119+
the [Wiki](https://github.com/MetaCell/NetPyNE-UI/wiki) for more info!

netpyne_ui/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,23 @@
1111
"https://d8bf7e40eec34cb9891f6dd8207b5e83@sentry.metacell.us/6"
1212
)
1313

14+
HEAD_MODEL_FILE = os.getenv("NP_LFPYKIT_HEAD_FILE", "sa_nyhead.mat")
15+
1416
def init_eeg():
1517
import sys
1618
from netpyne_ui.constants import HERE
1719
# FIXES library asking for input to download
1820
sys.stdin = open(os.path.join(HERE, "resources/stdin.txt"),'r')
1921
from lfpykit.eegmegcalc import NYHeadModel
2022
try:
21-
NYHeadModel() # Downloads the model if does not exist
23+
NYHeadModel(HEAD_MODEL_FILE) # Downloads the model if does not exist
2224
except:
2325
logging.error("Error initializing the EEG head model", exc_info=True)
2426

25-
from multiprocessing import Process
26-
thread = Process(target = init_eeg)
27-
thread.start()
28-
27+
if not os.path.exists(HEAD_MODEL_FILE):
28+
from multiprocessing import Process
29+
thread = Process(target = init_eeg)
30+
thread.start()
2931

3032
RouteManager.add_controller(api.NetPyNEController)
3133

netpyne_ui/mod_utils.py

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import shutil
23
import subprocess
34
import os
@@ -26,19 +27,33 @@ def is_loaded_mechanisms():
2627
return True
2728

2829

29-
def loadModMechFiles(compileMod, modFolder):
30+
def loadModMechFiles(compileMod, modFolder, forceRecompile=False):
3031
# Create Symbolic link
31-
if compileMod:
32-
modPath = os.path.join(str(modFolder), "x86_64")
3332

34-
if os.path.exists(modPath):
35-
shutil.rmtree(modPath)
36-
37-
os.chdir(modFolder)
38-
subprocess.call(["nrnivmodl"])
39-
os.chdir('..')
40-
41-
try:
42-
neuron.load_mechanisms(str(modFolder))
43-
except:
44-
raise
33+
try:
34+
35+
owd = os.getcwd()
36+
if compileMod:
37+
38+
compiledModPath = os.path.join(str(modFolder), "x86_64")
39+
40+
if os.path.exists(compiledModPath) and forceRecompile:
41+
logging.info("Forcing mod files to recompile in %s" % modFolder)
42+
shutil.rmtree(compiledModPath)
43+
44+
if not os.path.exists(compiledModPath):
45+
logging.info("Compiling mod files in %s" % modFolder)
46+
os.chdir(modFolder)
47+
subprocess.call(["nrnivmodl"])
48+
os.chdir('..')
49+
50+
try:
51+
neuron.load_mechanisms(str(modFolder))
52+
except:
53+
logging.exception("Error loading mechanisms")
54+
if not forceRecompile:
55+
logging.info("Trying to recompile mod files")
56+
loadModMechFiles(True, modFolder, forceRecompile=True)
57+
raise
58+
finally:
59+
os.chdir(owd)

0 commit comments

Comments
 (0)