├── .dockerignore ├── .github └── workflows │ └── tests.yml ├── .gitignore ├── .travis.yml ├── Dockerfile ├── MANIFEST.in ├── NetPyNE-UI ├── README.md ├── README.rst ├── docs ├── NetPyNESync.gif ├── controlPanel.png ├── controlpanel.jpg ├── docker_logo.png ├── docker_windows1.png ├── docker_windows2.png ├── explore.png ├── exploreDialog.png ├── export.png ├── gif1.gif ├── hyper-v.png ├── import.png ├── kitematicImage.png ├── kitematicRun.png ├── main.png ├── mainConsole.png ├── netpyne.png ├── netpyneui.png ├── pip_logo.png ├── plotMenu.png ├── plots.png ├── program_features.png ├── simulateDialog.png ├── simulatePlots.png ├── vbox_logo.png ├── vm1.jpg ├── vm10.png ├── vm11.jpg ├── vm2.png ├── vm3.png ├── vm4.jpg ├── vm5.png ├── vm6.png ├── vm7.jpg ├── vm8.jpg ├── vm9.jpg ├── wiki1-1.png ├── wiki1-2.png ├── wiki1.png ├── wiki10.png ├── wiki11.png ├── wiki12.png ├── wiki13.png ├── wiki14.png ├── wiki15.png ├── wiki16.png ├── wiki17.png ├── wiki2.png ├── wiki3.png ├── wiki4.png ├── wiki5.png ├── wiki6.png ├── wiki7.png ├── wiki8.png └── wiki9.png ├── example.db ├── jupyter_hub ├── Dockerfile_hub ├── Dockerfile_spawner └── jupyterhub_config.py ├── k8s ├── Dockerfile ├── README.md ├── auth.py ├── cf_pipeline.yaml ├── cf_values.yaml ├── js │ └── EventSource.js ├── minikube_values.yaml ├── static │ ├── favicon.ico │ └── jupyter.png └── templates │ ├── 404.html │ ├── page.html │ └── spawn_pending.html ├── model_output.json ├── netpyne_ui ├── __init__.py ├── api.py ├── constants.py ├── experiments.py ├── helpers │ └── neuroml.py ├── mod_utils.py ├── model.py ├── netpyne_geppetto.py ├── netpyne_model_interpreter.py ├── resources │ └── stdin.txt ├── simulations.py ├── templates │ ├── __init__.py │ ├── batch.py │ ├── batch_run_single.py │ ├── run.py │ └── run_instantiated_net.py └── utils.py ├── netpyneui.png ├── requirements-test.txt ├── requirements.txt ├── run.py ├── setup.py ├── tests ├── backend │ ├── .gitignore │ ├── models │ │ ├── gui_import_dict.py │ │ └── hhcells_model.json │ ├── netpyne_model_importer_test.py │ ├── netpyne_model_interpreter_test.py │ └── utils_test.py ├── deployment │ ├── build.sh │ └── docker-compose.yaml └── frontend │ └── e2e │ ├── .dockerignore │ ├── .eslintignore │ ├── .eslintrc.js │ ├── Dockerfile │ ├── babel.config.js │ ├── jest.config.js │ ├── package-lock.json │ ├── package.json │ └── tests │ ├── ControlPanel.test.js │ ├── EEG_and_Dipole_Tut#1.test.js │ ├── ExperimentManager_Tut#1.test.js │ ├── RxD.test.js │ ├── SaveOpenFile.test.js │ ├── TestTutorial1.js │ ├── Tut#1_smoke.test.js │ ├── Tut#2_smoke.test.js │ ├── Tut#3a_smoke.test.js │ ├── Tut#3b_smoke.test.js │ ├── Tut#3c_smoke.test.js │ ├── Tut#4_smoke.test.js │ ├── selectors.js │ ├── setupTests.js │ ├── snapshots │ ├── EEG_and_Dipole_Tut#1.test │ │ ├── Dipole Plot-snap.png │ │ ├── EEG Plot-snap.png │ │ └── Tutorial#1 Network-snap.png │ ├── ExperimentManager_Tut#1.test │ │ ├── Experiment Condition #1-snap.png │ │ ├── Experiment Condition #2-snap.png │ │ ├── Experiment Condition #3-snap.png │ │ └── Tutorial#1 Network-snap.png │ ├── RxD.test │ │ ├── LFP PSD Plot After change-snap.png │ │ ├── LFP PSD Plot Before change-snap.png │ │ ├── LFP Time Series Plot After change-snap.png │ │ ├── LFP Time Series Plot Before change-snap.png │ │ └── RxD Plot-snap.png │ ├── SaveOpenFile.test │ │ ├── Edited NetClamp Model-snap.png │ │ └── NetClamp Model-snap.png │ ├── Tut#1_smoke.test │ │ ├── 2D Net Plot-snap.png │ │ ├── Cell Traces Plot-snap.png │ │ ├── Connections Plot-snap.png │ │ ├── Granger Plot-snap.png │ │ ├── Raster Plot-snap.png │ │ ├── Rate Spectogram Plot-snap.png │ │ ├── Spike Hist Plot-snap.png │ │ └── Tutorial#1 Network-snap.png │ ├── Tut#2_smoke.test │ │ ├── 2D Net Plot-snap.png │ │ ├── Cell Traces Plot-snap.png │ │ ├── Connections Plot-snap.png │ │ ├── Granger Plot-snap.png │ │ ├── Raster Plot-snap.png │ │ ├── Rate Spectogram Plot-snap.png │ │ ├── Spike Hist Plot-snap.png │ │ └── Tutorial#2 Network-snap.png │ ├── Tut#3a_smoke.test │ │ ├── 2D Net Plot-snap.png │ │ ├── Cell Traces Plot-snap.png │ │ ├── Connections Plot-snap.png │ │ ├── Granger Plot-snap.png │ │ ├── LFP PSD Plot-snap.png │ │ ├── LFP Spectrogram Plot-snap.png │ │ ├── LFP Time Series Plot-snap.png │ │ ├── Raster Plot-snap.png │ │ ├── Rate Spectogram Plot-snap.png │ │ ├── RxD concentration plot-snap.png │ │ ├── Spike Hist Plot-snap.png │ │ └── Tutorial#3a Network-snap.png │ ├── Tut#3b_smoke.test │ │ ├── 2D Net Plot-snap.png │ │ ├── Cell Traces Plot-snap.png │ │ ├── Connections Plot-snap.png │ │ ├── Granger Plot-snap.png │ │ ├── LFP PSD Plot-snap.png │ │ ├── LFP Spectrogram Plot-snap.png │ │ ├── LFP Time Series Plot-snap.png │ │ ├── Raster Plot-snap.png │ │ ├── Rate Spectogram Plot-snap.png │ │ ├── RxD concentration plot-snap.png │ │ ├── Spike Hist Plot-snap.png │ │ └── Tutorial#3b Network-snap.png │ ├── Tut#3c_smoke.test │ │ ├── 2D Net Plot-snap.png │ │ ├── Cell Traces Plot-snap.png │ │ ├── Connections Plot-snap.png │ │ ├── Granger Plot-snap.png │ │ ├── LFP PSD Plot-snap.png │ │ ├── LFP Spectrogram Plot-snap.png │ │ ├── LFP Time Series Plot-snap.png │ │ ├── Raster Plot-snap.png │ │ ├── Rate Spectogram Plot-snap.png │ │ ├── Spike Hist Plot-snap.png │ │ └── Tutorial#3c Network-snap.png │ ├── Tut#4_smoke.test │ │ ├── 2D Net Plot-snap.png │ │ ├── Cell Traces Plot-snap.png │ │ ├── Connections Plot-snap.png │ │ ├── Raster Plot-snap.png │ │ ├── Rate Spectogram Plot-snap.png │ │ ├── Spike Hist Plot-snap.png │ │ └── Tutorial#4 Network-snap.png │ └── tutorial_1 │ │ ├── test-tutorial-1-js-tutorial-1-adding-excitatory-population-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-cell-traces-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-cell-types-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-cell-types-2-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-configuration-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-configure-synapses-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-connectivity-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-create-network-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-plot-settings-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-raster-plot-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-spike-hist-plot-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-stim-sources-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-stim-targets-1-snap.png │ │ ├── test-tutorial-1-js-tutorial-1-view-2-d-net-plot-1-snap.png │ │ └── test-tutorial-1-js-tutorial-1-view-connections-plot-1-snap.png │ └── utils.js ├── utilities ├── custom.css └── install.py └── webapp ├── .eslintignore ├── .eslintrc.js ├── .project ├── GeppettoConfiguration.json ├── LICENSE ├── Main.js ├── PULL_REQUEST_TEMPLATE ├── README.md ├── Utils.js ├── api ├── experiments.js └── hooks.js ├── babel.config.js ├── build.properties ├── components ├── NetPyNE.js ├── definition │ ├── cellRules │ │ ├── NetPyNECellRule.js │ │ ├── NetPyNECellRules.js │ │ ├── SelectCellTemplate.js │ │ └── sections │ │ │ ├── NetPyNESection.js │ │ │ └── mechanisms │ │ │ ├── NetPyNEMechanism.js │ │ │ └── NetPyNENewMechanism.js │ ├── configuration │ │ └── NetPyNESimConfig.js │ ├── connectivity │ │ ├── NetPyNEConnectivityRule.js │ │ └── NetPyNEConnectivityRules.js │ ├── plots │ │ ├── NetPyNEInclude.js │ │ ├── NetPyNENewPlot.js │ │ ├── NetPyNEPlotThumbnail.js │ │ ├── NetPyNEPlots.js │ │ ├── TimeRange.js │ │ └── plotTypes │ │ │ ├── Plot2Dnet.js │ │ │ ├── PlotConn.js │ │ │ ├── PlotGranger.js │ │ │ ├── PlotLFP.js │ │ │ ├── PlotRaster.js │ │ │ ├── PlotRatePSD.js │ │ │ ├── PlotRateSpectrogram.js │ │ │ ├── PlotSpikeHist.js │ │ │ ├── PlotSpikeStats.js │ │ │ └── PlotTraces.js │ ├── populations │ │ ├── Dimensions.js │ │ ├── NetPyNEPopulation.js │ │ └── NetPyNEPopulations.js │ ├── stimulationSources │ │ ├── NetPyNEStimulationSource.js │ │ └── NetPyNEStimulationSources.js │ ├── stimulationTargets │ │ ├── NetPyNEStimulationTarget.js │ │ ├── NetPyNEStimulationTargets.js │ │ └── StimulationConditions.js │ ├── subcellConnectivity │ │ ├── NetPyNESubcellsConnectivityRule.js │ │ └── NetPyNESubcellsConnectivityRules.js │ └── synapses │ │ ├── NetPyNESynapse.js │ │ └── NetPyNESynapses.js ├── drawer │ ├── Drawer.js │ └── useStyles.js ├── experiments │ ├── ExperimentEdit.js │ ├── ExperimentEditStyle.js │ ├── ExperimentHelper.js │ ├── ExperimentManager.js │ ├── ExperimentRowFilter.js │ ├── ExperimentView.js │ ├── Experiments.js │ ├── ParameterMenu.js │ ├── processExperimentData.js │ └── utils.js ├── general │ ├── AdapterComponent.js │ ├── Checkbox.js │ ├── CommandRecorder.js │ ├── ConfirmationDialog.js │ ├── ControlPanelTreeItem.js │ ├── Dialog.js │ ├── DialogBox.js │ ├── ExpansionPanel.js │ ├── ExperimentControlPanel.js │ ├── FileBrowser.js │ ├── Filter.js │ ├── GeppettoJupyterUtils.js │ ├── GridLayout.js │ ├── HTMLViewer.js │ ├── JsonViewer.js │ ├── List.js │ ├── Loader.js │ ├── NetPyNEAddNew.js │ ├── NetPyNECoordsRange.js │ ├── NetPyNEField.js │ ├── NetPyNEHome.js │ ├── NetPyNEIcons.js │ ├── NetPyNEPythonConsole.js │ ├── NetPyNETextField.js │ ├── NetPyNEThumbnail.js │ ├── PlotViewer.js │ ├── PythonControlledCapability.js │ ├── RulePath.js │ ├── Select.js │ ├── Splash.js │ ├── SplitButton.js │ ├── Textbox.js │ ├── Tooltip.js │ ├── TutorialBubble.js │ ├── TutorialObserver.js │ └── tree │ │ ├── Tree.js │ │ └── Tree.less ├── icons.jsx ├── index.js ├── instantiation │ ├── NetPyNEInstantiated.js │ └── NetWorkControlButtons.js ├── layout │ ├── componentsMap.js │ ├── defaultLayout.js │ ├── index.js │ └── utils.ts ├── rxd │ ├── Rxd.js │ ├── RxdConstants.js │ ├── RxdExtracellulars.js │ ├── RxdMulticompartmentReaction.js │ ├── RxdMulticompartmentReactions.js │ ├── RxdNoData.js │ ├── RxdParameter.js │ ├── RxdParameters.js │ ├── RxdRate.js │ ├── RxdRates.js │ ├── RxdReaction.js │ ├── RxdReactions.js │ ├── RxdRegion.js │ ├── RxdRegions.js │ ├── RxdSpecie.js │ ├── RxdSpecies.js │ ├── RxdState.js │ ├── RxdStates.js │ └── Wrapper.js └── topbar │ ├── SwitchPageButton.js │ ├── Topbar.js │ ├── dialogs │ ├── ActionDialog.js │ ├── ActionValidationDialog.js │ ├── ImportCellParams.js │ ├── ImportExportHLS.js │ ├── ImportFileDialog.js │ ├── LaunchDialog.js │ ├── LoadFile.js │ ├── LoadFileIndex.js │ ├── NewModel.js │ ├── OverwriteModel.js │ ├── SaveFile.js │ ├── SimpleDialog.js │ └── UploadDownloadFiles.js │ └── menuConfiguration.js ├── constants.js ├── css ├── Application.less ├── colors.less ├── flexlayout.less ├── material.less ├── netpyne.less ├── traceback.less ├── tree.less └── variables.less ├── dev_package.json ├── geppetto.ejs ├── geppetto_ui.sh ├── package.bak ├── package.json ├── redux ├── actiondomainStore.js ├── actions │ ├── actiondomain.js │ ├── console.js │ ├── drawer.js │ ├── errors.js │ ├── experiments.js │ ├── general.js │ ├── layout.js │ ├── notebook.js │ ├── topbar.js │ └── tutorials.js ├── middleware │ ├── middleware.js │ ├── plotMiddleware.js │ ├── rulesOperationsMiddleware.js │ └── utils.js ├── reducers │ ├── all.js │ ├── console.js │ ├── data │ │ ├── tutorial2_steps.js │ │ ├── tutorial3_steps.js │ │ └── tutorial_steps.js │ ├── drawer.js │ ├── errors.js │ ├── experiments.js │ ├── general.js │ ├── notebook.js │ ├── topbar.js │ └── tutorial.js └── store.js ├── scripts ├── setup_geppetto_ui.sh └── update-geppetto-ui.sh ├── static ├── icons │ ├── D3Canvas.svg │ ├── LFPLocationsPlot.svg │ ├── LFPPSDPlot.svg │ ├── LFPSpectrogramPlot.svg │ ├── LFPTimeSeriesPlot.svg │ ├── add.svg │ ├── analysis.svg │ ├── arrow-left.svg │ ├── arrow-right.svg │ ├── cellParams.svg │ ├── connParams.svg │ ├── connectionPlot.svg │ ├── d2NetPlot.svg │ ├── experimentControlPanel.svg │ ├── experimentManager.svg │ ├── experimentSelected.png │ ├── experimentUnselected.png │ ├── grangerPlot.svg │ ├── modelSelected.png │ ├── modelUnselected.png │ ├── pencil.svg │ ├── plotDipole.svg │ ├── plotEEG.svg │ ├── plotRateSpectrogram.svg │ ├── popParams.svg │ ├── python.svg │ ├── pythonold.svg │ ├── rasterPlot.svg │ ├── ratePSDPlot.svg │ ├── rocket.svg │ ├── rxd.svg │ ├── rxdConcentrationPlot.svg │ ├── screen.svg │ ├── shapePlot.svg │ ├── simConfig.svg │ ├── spikePlot.svg │ ├── spikeStatsPlot.svg │ ├── stimSourceParams.svg │ ├── stimTargetParams.svg │ ├── subConnParams.svg │ ├── synMechParams.svg │ └── tracesPlot.svg ├── metacell_new.png ├── netpyne-logo_white.png └── splash.gif ├── test-frame └── index.html ├── tests └── utilities │ └── netpyne-server-status.sh ├── theme.js ├── tsconfig.json ├── webpack.config.dev.js ├── webpack.config.js ├── yalc.lock └── yarn.lock /.dockerignore: -------------------------------------------------------------------------------- 1 | org.geppetto.frontend.jupyter 2 | pygeppetto 3 | .vscode 4 | .ipynb_checkpoints 5 | 6 | *.egg-info 7 | notebook.ipynb 8 | .git 9 | 10 | Dockerfile 11 | Dockerfile_base 12 | Dockerfile_dev 13 | webapp/node_modules 14 | webapp/build 15 | webapp/geppetto-client 16 | workspace 17 | netpyne_workspace 18 | .idea 19 | k8s 20 | /src 21 | x86_64 22 | app.log 23 | /.pytest_cache 24 | .jupyter-config 25 | **/*.pyc 26 | **/__pycache__ 27 | app.log -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .ipynb_checkpoints/ 2 | netpyne-ui.log 3 | log.file 4 | src 5 | *.pyc 6 | *.egg-info 7 | .DS_Store 8 | pygeppetto/ 9 | netpyne/ 10 | org.geppetto.frontend.jupyter/ 11 | *.ipynb 12 | init.py 13 | webapp/node_modules 14 | webapp/geppetto-client 15 | webapp/build 16 | webapp/.yalc 17 | workspace 18 | netpyne_workspace 19 | tests/frontend/e2e/node_modules 20 | Dockerfile_mini 21 | npm* 22 | .vscode 23 | app.log 24 | utilities/x86_64 25 | .idea 26 | *.iml 27 | x86_64 28 | .jupyter-config 29 | venv 30 | webapp/build 31 | webapp/.yalc 32 | node_modules 33 | sa_nyhead.mat 34 | workspace -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | os: linux 3 | python: 4 | - "3.7" 5 | node_js: 6 | - "12" 7 | cache: pip 8 | env: 9 | global: 10 | - secure: dn0FPQ5IG4M/3kdwnyI78ElQ308Vc3QnKAvkWfwMFb8QxDqxQdnTo7AV1qTMtbLrDNkeEWIgi4nc7jmXNtvGTwOfhAULVh6606Qs5B+ezTdwzajbbFMI8SKQx/pnTojOMu8dx7V4lMoR/YWcojR0VC1IWVC62TGbSB1k5BDGgH0= 11 | - DEFAULT_BRANCH: development 12 | - LANDING_PAGE: "http://localhost:8888/geppetto" 13 | notifications: 14 | slack: metacell:5ALSeoP88DqIhORUJvxE56sq 15 | install: 16 | - sudo apt-get install libgnutls28-dev 17 | - sudo apt install libcurl4-openssl-dev libssl-dev 18 | - sudo apt-get install python3-dev 19 | script: 20 | - python utilities/install.py 21 | - ./NetPyNE-UI & 22 | - http_status=$(curl -s -I $1 $LANDING_PAGE | grep HTTP/1.1 | awk {'print $2'}) 23 | - echo "$http_status" 24 | - cd tests/frontend/e2e 25 | - npm ci 26 | - sleep 10 && travis_retry npm run test 27 | - exit 0 -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | # Include everything inside this folder 2 | graft netpyne_ui/geppetto/src/main/webapp/build 3 | 4 | # Include any of these resources at any level 5 | recursive-include netpyne_ui/geppetto *.png *.css *.woff *.woff2 6 | 7 | # Include any of these resources at any level 8 | recursive-include netpyne_ui/tests *.hoc 9 | 10 | # Include also root files (basically the extension) 11 | include netpyne_ui/* -------------------------------------------------------------------------------- /NetPyNE-UI: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | CONFIG=$(pwd)/.jupyter-config 3 | export JUPYTER_CONFIG_DIR=$CONFIG 4 | exec jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --NotebookApp.notebook_dir=workspace --library=netpyne_ui --NotebookApp.disable_check_xsrf=True 5 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | 2 | Experimental prototype for a new user interface 3 | for `NEURON `__ based on web 4 | technologies. 5 | 6 | This prototype is being developed in collaboration with the `Neurosim 7 | Lab `__ and the `Sense 8 | Lab `__. 9 | 10 | The UI connects to 11 | `nrnpython `__ 12 | through a `Geppetto `__ extension for `Jupyter 13 | Notebook `__. 14 | 15 | See the `Repo `__ and `Wiki `__ for more 16 | ======= 17 | NetPyNE-UI 18 | ========= 19 | 20 | User Interface for NetPyNE. 21 | See the `Repo `__ and `Wiki `__ for more 22 | info! 23 | 24 | Installation 25 | ============ 26 | 27 | .. code-block:: bash 28 | 29 | pip install netpyne_ui 30 | jupyter nbextension enable --py jupyter_geppetto 31 | 32 | Usage 33 | ===== 34 | 35 | .. code-block:: bash 36 | 37 | NetPyNE-UI 38 | 39 | or 40 | 41 | .. code-block:: bash 42 | 43 | jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' 44 | 45 | 46 | -------------------------------------------------------------------------------- /docs/NetPyNESync.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/NetPyNESync.gif -------------------------------------------------------------------------------- /docs/controlPanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/controlPanel.png -------------------------------------------------------------------------------- /docs/controlpanel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/controlpanel.jpg -------------------------------------------------------------------------------- /docs/docker_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/docker_logo.png -------------------------------------------------------------------------------- /docs/docker_windows1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/docker_windows1.png -------------------------------------------------------------------------------- /docs/docker_windows2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/docker_windows2.png -------------------------------------------------------------------------------- /docs/explore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/explore.png -------------------------------------------------------------------------------- /docs/exploreDialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/exploreDialog.png -------------------------------------------------------------------------------- /docs/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/export.png -------------------------------------------------------------------------------- /docs/gif1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/gif1.gif -------------------------------------------------------------------------------- /docs/hyper-v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/hyper-v.png -------------------------------------------------------------------------------- /docs/import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/import.png -------------------------------------------------------------------------------- /docs/kitematicImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/kitematicImage.png -------------------------------------------------------------------------------- /docs/kitematicRun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/kitematicRun.png -------------------------------------------------------------------------------- /docs/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/main.png -------------------------------------------------------------------------------- /docs/mainConsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/mainConsole.png -------------------------------------------------------------------------------- /docs/netpyne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/netpyne.png -------------------------------------------------------------------------------- /docs/netpyneui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/netpyneui.png -------------------------------------------------------------------------------- /docs/pip_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/pip_logo.png -------------------------------------------------------------------------------- /docs/plotMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/plotMenu.png -------------------------------------------------------------------------------- /docs/plots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/plots.png -------------------------------------------------------------------------------- /docs/program_features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/program_features.png -------------------------------------------------------------------------------- /docs/simulateDialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/simulateDialog.png -------------------------------------------------------------------------------- /docs/simulatePlots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/simulatePlots.png -------------------------------------------------------------------------------- /docs/vbox_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vbox_logo.png -------------------------------------------------------------------------------- /docs/vm1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm1.jpg -------------------------------------------------------------------------------- /docs/vm10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm10.png -------------------------------------------------------------------------------- /docs/vm11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm11.jpg -------------------------------------------------------------------------------- /docs/vm2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm2.png -------------------------------------------------------------------------------- /docs/vm3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm3.png -------------------------------------------------------------------------------- /docs/vm4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm4.jpg -------------------------------------------------------------------------------- /docs/vm5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm5.png -------------------------------------------------------------------------------- /docs/vm6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm6.png -------------------------------------------------------------------------------- /docs/vm7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm7.jpg -------------------------------------------------------------------------------- /docs/vm8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm8.jpg -------------------------------------------------------------------------------- /docs/vm9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/vm9.jpg -------------------------------------------------------------------------------- /docs/wiki1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki1-1.png -------------------------------------------------------------------------------- /docs/wiki1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki1-2.png -------------------------------------------------------------------------------- /docs/wiki1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki1.png -------------------------------------------------------------------------------- /docs/wiki10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki10.png -------------------------------------------------------------------------------- /docs/wiki11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki11.png -------------------------------------------------------------------------------- /docs/wiki12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki12.png -------------------------------------------------------------------------------- /docs/wiki13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki13.png -------------------------------------------------------------------------------- /docs/wiki14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki14.png -------------------------------------------------------------------------------- /docs/wiki15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki15.png -------------------------------------------------------------------------------- /docs/wiki16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki16.png -------------------------------------------------------------------------------- /docs/wiki17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki17.png -------------------------------------------------------------------------------- /docs/wiki2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki2.png -------------------------------------------------------------------------------- /docs/wiki3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki3.png -------------------------------------------------------------------------------- /docs/wiki4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki4.png -------------------------------------------------------------------------------- /docs/wiki5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki5.png -------------------------------------------------------------------------------- /docs/wiki6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki6.png -------------------------------------------------------------------------------- /docs/wiki7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki7.png -------------------------------------------------------------------------------- /docs/wiki8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki8.png -------------------------------------------------------------------------------- /docs/wiki9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/docs/wiki9.png -------------------------------------------------------------------------------- /example.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/example.db -------------------------------------------------------------------------------- /jupyter_hub/Dockerfile_hub: -------------------------------------------------------------------------------- 1 | FROM jupyterhub/jupyterhub:latest 2 | 3 | # feature_jupyterhub 4 | ARG netpyneuiBranch=feature_jupyterhub 5 | ENV netpyneuiBranch=${netpyneuiBranch} 6 | RUN echo "$netpyneuiBranch"; 7 | 8 | # Install authenticator and spawner + jupyter_client 9 | RUN pip install jupyterhub-tmpauthenticator dockerspawner jupyter_client 10 | 11 | # Overwrite jupyterhub_config 12 | RUN wget https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/$netpyneuiBranch/jupyterhub/jupyterhub_config.py -q -------------------------------------------------------------------------------- /jupyter_hub/Dockerfile_spawner: -------------------------------------------------------------------------------- 1 | FROM metacell/jupyter-neuron:latest 2 | 3 | USER root 4 | RUN conda install -c conda-forge nodejs configurable-http-proxy 5 | 6 | USER $NB_USER 7 | 8 | # feature_jupyterhub 9 | ARG netpyneuiBranch=feature_jupyterhub 10 | ENV netpyneuiBranch=${netpyneuiBranch} 11 | RUN echo "$netpyneuiBranch"; 12 | 13 | ARG INCUBATOR_VER=unknown 14 | RUN /bin/bash -c "INCUBATOR_VER=${INCUBATOR_VER} source activate snakes && pip install jupyterhub==0.9.4" 15 | 16 | # Clone NetPyNE-UI and install the development version 17 | RUN wget https://github.com/MetaCell/NetPyNE-UI/archive/$netpyneuiBranch.zip -q 18 | RUN unzip $netpyneuiBranch.zip 19 | WORKDIR /opt/workspace-$netpyneuiBranch/utilities 20 | RUN /bin/bash -c "source activate snakes && python --version" 21 | RUN /bin/bash -c "source activate snakes && exec python install.py branch $netpyneuiBranch" 22 | WORKDIR /home/jovyan 23 | RUN git clone https://github.com/Neurosim-lab/netpyne_workspace 24 | WORKDIR /home/jovyan/workspace 25 | RUN ln -sfn /opt/workspace-$netpyneuiBranch/netpyne_ui/tests tests 26 | 27 | # Copy jupyterhub_config 28 | # RUN cp /opt/workspace-$netpyneuiBranch/jupyterhub_config.py . 29 | 30 | CMD /bin/bash -c "source activate snakes && exec jupyterhub-singleuser --debug --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui" 31 | -------------------------------------------------------------------------------- /jupyter_hub/jupyterhub_config.py: -------------------------------------------------------------------------------- 1 | ## Class for authenticating users. 2 | # 3 | # This should be a class with the following form: 4 | # 5 | # - constructor takes one kwarg: `config`, the IPython config object. 6 | # 7 | # with an authenticate method that: 8 | # _class 9 | # - is a coroutine (asyncio or tornado) 10 | # - returns username on success, None on failure 11 | # - takes two arguments: (handler, data), 12 | # where `handler` is the calling web.RequestHandler, 13 | # and `data` is the POST form data from the login page. 14 | #c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator' 15 | # c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator' 16 | # c.DummyAuthenticator.password = "dummypassword" 17 | c.JupyterHub.authenticator_class = 'tmpauthenticator.TmpAuthenticator' 18 | 19 | ## The class to use for spawning single-user servers. 20 | # 21 | # Should be a subclass of Spawner. 22 | #c.JupyterHub.spawner_class = 'jupyterhub.spawner.LocalProcessSpawner' 23 | c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner' 24 | from jupyter_client.localinterfaces import public_ips 25 | ip = public_ips()[0] 26 | c.JupyterHub.hub_ip = ip 27 | c.DockerSpawner.image = 'netpyne_ui_jupyterspawner' 28 | c.DockerSpawner.remove_containers = True 29 | c.DockerSpawner.remove = True 30 | c.DockerSpawner.debug = True 31 | c.DockerSpawner.network_name='jupyterhub_network' 32 | 33 | ## Extra arguments to be passed to the single-user server. Only works for the LocalProcessSpawner 34 | # 35 | # Some spawners allow shell-style expansion here, allowing you to use 36 | # environment variables here. Most, including the default, do not. Consult the 37 | # documentation for your spawner to verify! 38 | # c.Spawner.args = ['--library=netpyne_ui', '--NotebookApp.default_url=/geppetto', '--NotebookApp.token='''] -------------------------------------------------------------------------------- /k8s/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM jupyterhub/k8s-hub:0.9.0 2 | 3 | COPY --chown=1000:1000 templates/page.html /usr/local/share/jupyterhub/templates/page.html 4 | COPY --chown=1000:1000 templates/404.html /usr/local/share/jupyterhub/templates/404.html 5 | COPY --chown=1000:1000 templates/spawn_pending.html /usr/local/share/jupyterhub/templates/spawn_pending.html 6 | COPY --chown=1000:1000 static/jupyter.png /usr/local/share/jupyterhub/static/images/jupyter.png 7 | COPY --chown=1000:1000 static/jupyter.png /usr/local/share/jupyterhub/static/images/jupyterhub-80.png 8 | COPY --chown=1000:1000 static/favicon.ico /usr/local/share/jupyterhub/static/favicon.ico 9 | COPY --chown=1000:1000 static/favicon.ico /usr/local/share/jupyterhub/static/images/favicon.ico 10 | COPY --chown=1000:1000 auth.py /usr/local/lib/python3.6/dist-packages/tmpauthenticator/__init__.py 11 | COPY --chown=1000:1000 js/EventSource.js /usr/local/share/jupyterhub/static/js/EventSource.js 12 | 13 | 14 | CMD ["jupyterhub", "--config", "/srv/jupyterhub_config.py"] -------------------------------------------------------------------------------- /k8s/README.md: -------------------------------------------------------------------------------- 1 | # k8s deployment 2 | 3 | - Deploy on minikube runnig 4 | 5 | ```bash 6 | kubectl create -ns netpyne 7 | helm upgrade netpyne jupyterhub --install --reset-values --repo https://jupyterhub.github.io/helm-chart/ --version 0.9.0 --namespace netpyne --values minikube_values.yaml --force --debug 8 | ``` 9 | 10 | - Access the hub by running 11 | 12 | ```bash 13 | minikube service list 14 | ``` 15 | 16 | and use the url corresponding to nepyne proxy-public on port 80 -------------------------------------------------------------------------------- /k8s/auth.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from traitlets import Bool 4 | from tornado import gen 5 | 6 | from jupyterhub.auth import Authenticator 7 | from jupyterhub.handlers import BaseHandler 8 | from jupyterhub.utils import url_path_join 9 | 10 | 11 | class TmpAuthenticateHandler(BaseHandler): 12 | def initialize(self, force_new_server, process_user): 13 | super().initialize() 14 | self.force_new_server = force_new_server 15 | self.process_user = process_user 16 | 17 | @gen.coroutine 18 | def get(self): 19 | 20 | raw_user = yield self.get_current_user() 21 | 22 | if raw_user: 23 | if self.force_new_server and raw_user.running: 24 | status = yield raw_user.spawner.poll_and_notify() 25 | if status is None: 26 | yield self.stop_single_user(raw_user) 27 | 28 | else: 29 | username = str(uuid.uuid4()) 30 | raw_user = self.user_from_username(username) 31 | self.set_login_cookie(raw_user) 32 | 33 | user = yield gen.maybe_future(self.process_user(raw_user, self)) 34 | 35 | server_name = '' 36 | redirection = self.get_next_url(user) 37 | user.spawners[server_name].environment["NETPYNE_URL"] = '' 38 | 39 | if 'hub/new-server=' in self.request.uri: 40 | server_name = str(uuid.uuid4()).split('-').pop() 41 | redirection = f'/hub/spawn/{user.name}/{server_name}' 42 | user.spawners[server_name].environment["NETPYNE_URL"] = self.request.uri.split('=').pop() 43 | 44 | self.redirect(redirection) 45 | 46 | 47 | class TmpAuthenticator(Authenticator): 48 | auto_login = True 49 | login_service = 'tmp' 50 | 51 | force_new_server = Bool( 52 | False, 53 | help=""" 54 | Stop the user's server and start a new one when visiting /hub/tmplogin 55 | When set to True, users going to /hub/tmplogin will *always* get a 56 | new single-user server. When set to False, they'll be 57 | redirected to their current session if one exists. 58 | """, 59 | config=True 60 | ) 61 | 62 | def process_user(self, user, handler): 63 | return user 64 | 65 | def get_handlers(self, app): 66 | # FIXME: How to do this better? 67 | extra_settings = { 68 | 'force_new_server': self.force_new_server, 69 | 'process_user': self.process_user 70 | } 71 | return [ 72 | ('/tmplogin.*', TmpAuthenticateHandler, extra_settings), 73 | ('/new-server=.*', TmpAuthenticateHandler, extra_settings) 74 | ] 75 | 76 | def login_url(self, base_url): 77 | return url_path_join(base_url, 'tmplogin') -------------------------------------------------------------------------------- /k8s/cf_pipeline.yaml: -------------------------------------------------------------------------------- 1 | version: "1.0" 2 | stages: 3 | - "clone" 4 | - "build" 5 | - "deploy" 6 | steps: 7 | main_clone: 8 | type: "git-clone" 9 | description: "Cloning main repository..." 10 | repo: "MetaCell/NetPyNE-UI" 11 | revision: "${{CF_BRANCH}}" 12 | stage: "clone" 13 | BuildingNetPyNE-UI: 14 | title: Building NetPyNE-UI 15 | type: build 16 | stage: build 17 | image_name: netpyne-ui 18 | working_directory: ${{main_clone}} 19 | tag: '${{CF_BRANCH_TAG_NORMALIZED}}-${{CF_SHORT_REVISION}}-${{CF_BUILD_TIMESTAMP}}' 20 | build_arguments: 21 | - NETPYNE_VERSION=${{NETPYNE_VERSION}} 22 | - WORKSPACE_VERSION=${{WORKSPACE_VERSION}} 23 | - PYGEPPETTO_VERSION=${{PYGEPPETTO_VERSION}} 24 | - JUPYTER_GEPPETTO_VERSION=${{JUPYTER_GEPPETTO_VERSION}} 25 | - BUILD_ARGS=${{BUILD_ARGS}} 26 | registry: ${{REGISTRY}} 27 | BuildingHub: 28 | title: Building Hub 29 | type: build 30 | stage: "build" 31 | image_name: netpyne-hub 32 | working_directory: k8s 33 | tag: '${{CF_BRANCH_TAG_NORMALIZED}}-${{CF_SHORT_REVISION}}-${{CF_BUILD_TIMESTAMP}}' 34 | registry: ${{REGISTRY}} 35 | installing_chart: 36 | type: helm 37 | stage: deploy 38 | title: "Deploy chart" 39 | working_directory: k8s 40 | arguments: 41 | action: install 42 | chart_name: jupyterhub 43 | release_name: ${{RELEASE_NAME}} 44 | helm_version: 3.0.2 45 | chart_repo_url: 'https://jupyterhub.github.io/helm-chart/' 46 | chart_version: '0.9.0' 47 | kube_context: ${{CLUSTER_NAME}} 48 | namespace: ${{NAMESPACE}} 49 | custom_value_files: 50 | - 'cf_values.yaml' 51 | custom_values: 52 | - 'hub_image_tag=${{CF_BRANCH_TAG_NORMALIZED}}-${{CF_SHORT_REVISION}}-${{CF_BUILD_TIMESTAMP}}' 53 | - 'singleuser_image_tag=${{CF_BRANCH_TAG_NORMALIZED}}-${{CF_SHORT_REVISION}}-${{CF_BUILD_TIMESTAMP}}' 54 | - 'singleuser_memory_limit=${{MEMORY_MAX}}' 55 | - 'singleuser_memory_guarantee=${{MEMORY_MIN}}' 56 | - 'proxy_secretToken=${{SECRET_TOKEN}}' 57 | -------------------------------------------------------------------------------- /k8s/cf_values.yaml: -------------------------------------------------------------------------------- 1 | hub: 2 | image: 3 | name: gcr.io/metacellllc/netpyne-hub 4 | pullPolicy: IfNotPresent 5 | allowNamedServers: true 6 | resources: 7 | requests: 8 | cpu: 100m 9 | memory: 128Mi 10 | namedServerLimitPerUser: 2 11 | shutdownOnLogout: true 12 | extraConfig: 13 | timing: | 14 | c.Spawner.notebook_dir = '/opt/workspace' 15 | c.Spawner.default_url = '/geppetto' 16 | spawner: >- 17 | c.Spawner.args = ["--library=netpyne_ui", "--NotebookApp.default_url=/geppetto"] 18 | singleuser: 19 | storage: 20 | type: none 21 | cpu: 22 | limit: 0.5 23 | guarantee: 0.2 24 | memory: 25 | limit: 0.5G 26 | guarantee: 0.2G 27 | image: 28 | name: gcr.io/metacellllc/netpyne-ui 29 | pullPolicy: IfNotPresent 30 | 31 | cull: 32 | enabled: true 33 | users: false 34 | removeNamedServers: true 35 | timeout: 360 36 | every: 60 37 | concurrency: 10 38 | maxAge: 0 39 | 40 | debug: 41 | enabled: false 42 | -------------------------------------------------------------------------------- /k8s/minikube_values.yaml: -------------------------------------------------------------------------------- 1 | # Use with minikubes 2 | hub: 3 | image: 4 | name: netpy-hub 5 | tag: 'latest' 6 | pullPolicy: IfNotPresent 7 | 8 | resources: 9 | requests: 10 | cpu: 200m 11 | memory: 512Mi 12 | 13 | allowNamedServers: true 14 | namedServerLimitPerUser: 2 15 | shutdownOnLogout: true 16 | 17 | extraConfig: 18 | timing: | 19 | c.JupyterHub.allow_named_servers = True 20 | c.Spawner.port = 8000 21 | c.Spawner.http_timeout = 300 22 | c.Spawner.start_timeout = 300 23 | c.Spawner.notebook_dir = '/opt/workspace' 24 | c.Spawner.default_url = '/geppetto' 25 | c.Spawner.debug = True 26 | c.Spawner.disable_check_xsrf=True 27 | spawner: >- 28 | c.Spawner.args = ["--library=netpyne_ui", "--NotebookApp.disable_check_xsrf=True"] 29 | 30 | scheduling: 31 | userScheduler: 32 | replicas: 1 33 | 34 | proxy: 35 | secretToken: 'b3fed077c7538cfc5e2a6469ddac7d43a18fc645789407b53e580b7342b968d8' 36 | 37 | auth: 38 | type: tmp 39 | 40 | singleuser: 41 | storage: 42 | type: none 43 | memory: 44 | guarantee: 0.2G 45 | image: 46 | name: netpy 47 | tag: 'latest' 48 | pullPolicy: IfNotPresent 49 | 50 | cull: 51 | enabled: true 52 | users: false 53 | removeNamedServers: true 54 | timeout: 360 55 | every: 60 56 | concurrency: 10 57 | maxAge: 0 58 | 59 | debug: 60 | enabled: false -------------------------------------------------------------------------------- /k8s/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/k8s/static/favicon.ico -------------------------------------------------------------------------------- /k8s/static/jupyter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/k8s/static/jupyter.png -------------------------------------------------------------------------------- /k8s/templates/404.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "error.html" %} 3 | 4 | {% block error_detail %} 5 | {% endblock %} -------------------------------------------------------------------------------- /netpyne_ui/__init__.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import sys 3 | import os 4 | 5 | from jupyter_geppetto.webapi import RouteManager 6 | from netpyne_ui import api 7 | from netpyne_ui.constants import HERE 8 | import sentry_sdk 9 | 10 | sentry_sdk.init( 11 | "https://d8bf7e40eec34cb9891f6dd8207b5e83@sentry.metacell.us/6" 12 | ) 13 | 14 | HEAD_MODEL_FILE = os.getenv("NP_LFPYKIT_HEAD_FILE", "sa_nyhead.mat") 15 | 16 | def init_eeg(): 17 | import sys 18 | from netpyne_ui.constants import HERE 19 | # FIXES library asking for input to download 20 | sys.stdin = open(os.path.join(HERE, "resources/stdin.txt"),'r') 21 | from lfpykit.eegmegcalc import NYHeadModel 22 | try: 23 | NYHeadModel(HEAD_MODEL_FILE) # Downloads the model if does not exist 24 | except: 25 | logging.error("Error initializing the EEG head model", exc_info=True) 26 | 27 | if not os.path.exists(HEAD_MODEL_FILE): 28 | from multiprocessing import Process 29 | thread = Process(target = init_eeg) 30 | thread.start() 31 | 32 | RouteManager.add_controller(api.NetPyNEController) 33 | 34 | 35 | -------------------------------------------------------------------------------- /netpyne_ui/constants.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | UPLOAD_FOLDER_NAME = 'uploads' 4 | NETPYNE_WORKDIR = 'workspace' 5 | EXPERIMENTS_FOLDER = "experiments" 6 | MODEL_OUTPUT_FILENAME = 'model_output' 7 | 8 | SIMULATION_SCRIPT_NAME = "init.py" 9 | TEMPLATE_FILENAME_SINGLE_RUN = "run.py" 10 | TEMPLATE_FILENAME_SINGLE_RUN_INSTANTIATED = "run_instantiated_net.py" 11 | TEMPLATE_FILENAME_BATCH_RUN = "batch_run_single.py" 12 | TEMPLATE_FILENAME_BATCH = "batch.py" 13 | 14 | ALLOWED_EXTENSIONS = ["py", "zip", "gz", ".tar.gz", "pdf", "txt", "xls", "png", "jpeg", "hoc", "json", "xml", "nml"] 15 | HERE = os.path.dirname(os.path.abspath(__file__)) 16 | ROOT = os.path.dirname(HERE) 17 | UPLOAD_FOLDER_PATH = os.path.join(ROOT, NETPYNE_WORKDIR, UPLOAD_FOLDER_NAME) 18 | NETPYNE_WORKDIR_PATH = os.path.join(ROOT, NETPYNE_WORKDIR) 19 | EXPERIMENTS_FOLDER_PATH = os.path.join(ROOT, NETPYNE_WORKDIR, EXPERIMENTS_FOLDER) 20 | 21 | if not os.path.exists(NETPYNE_WORKDIR_PATH): 22 | NETPYNE_WORKDIR_PATH = os.path.join(os.getcwd(), NETPYNE_WORKDIR) 23 | 24 | if not os.path.exists(NETPYNE_WORKDIR_PATH): 25 | raise Exception(f"Workdir path {NETPYNE_WORKDIR_PATH} does not exist") 26 | 27 | if not os.path.exists(UPLOAD_FOLDER_PATH): 28 | os.makedirs(UPLOAD_FOLDER_PATH) 29 | 30 | if not os.path.exists(NETPYNE_WORKDIR_PATH): 31 | os.makedirs(NETPYNE_WORKDIR_PATH) 32 | 33 | # Number of connections above this limit are considered too many to be shown. 34 | NUM_CONN_LIMIT = 1000 35 | -------------------------------------------------------------------------------- /netpyne_ui/mod_utils.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import shutil 3 | import subprocess 4 | import os 5 | 6 | import neuron 7 | from neuron import h 8 | 9 | 10 | def is_loaded_mechanisms(): 11 | # copied from: 12 | # https://www.neuron.yale.edu/neuron/static/py_doc/modelspec/programmatic/mechtype.html 13 | mt = h.MechanismType(0) 14 | mname = h.ref('') 15 | mnames = list() 16 | for i in range(mt.count()): 17 | mt.select(i) 18 | mt.selected(mname) 19 | mnames.append(mname[0]) 20 | 21 | # note this check only works for the original hnn model 22 | # need to generalize for any model 23 | 24 | if 'hh2' not in mnames: 25 | return False 26 | else: 27 | return True 28 | 29 | 30 | def loadModMechFiles(compileMod, modFolder, forceRecompile=False): 31 | # Create Symbolic link 32 | 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) 60 | -------------------------------------------------------------------------------- /netpyne_ui/resources/stdin.txt: -------------------------------------------------------------------------------- 1 | y 2 | y 3 | y 4 | y 5 | y 6 | -------------------------------------------------------------------------------- /netpyne_ui/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/netpyne_ui/templates/__init__.py -------------------------------------------------------------------------------- /netpyne_ui/templates/batch_run_single.py: -------------------------------------------------------------------------------- 1 | import neuron 2 | from netpyne import sim 3 | 4 | 5 | def run(): 6 | # Folder that contains x86_64 folder 7 | NETPYNE_WORKDIR_PATH = "../../../" 8 | neuron.load_mechanisms(NETPYNE_WORKDIR_PATH) 9 | 10 | # read cfg and netParams from command line arguments if available; otherwise use default 11 | simConfig, netParams = sim.readCmdLineArgs( 12 | simConfigDefault="cfg.py", netParamsDefault="netParams.py" 13 | ) 14 | 15 | # Create network and run simulation 16 | sim.createSimulate(netParams=netParams, simConfig=simConfig) 17 | sim.saveData() 18 | 19 | 20 | try: 21 | run() 22 | except Exception as e: 23 | print("Trial failed ...") 24 | print(e) 25 | -------------------------------------------------------------------------------- /netpyne_ui/templates/run.py: -------------------------------------------------------------------------------- 1 | import os 2 | import json 3 | import neuron 4 | import sys 5 | import tempfile 6 | 7 | from neuron import h 8 | from netpyne import sim 9 | 10 | os.chdir(os.path.dirname(__file__)) 11 | 12 | 13 | def update_state(experiment, state): 14 | experiment["state"] = state 15 | 16 | with tempfile.NamedTemporaryFile('w', dir=os.path.dirname("experiment.json"), delete=False) as tf: 17 | json.dump(experiment, tf, default=str, sort_keys=True, indent=4) 18 | tempname = tf.name 19 | 20 | os.rename(tempname, "./experiment.json") 21 | 22 | 23 | def run_sim(): 24 | # Folder that contains x86_64 folder 25 | NETPYNE_WORKDIR_PATH = "../../../" 26 | neuron.load_mechanisms(NETPYNE_WORKDIR_PATH) 27 | 28 | netParams = sim.loadNetParams("./netParams.json", None, False) 29 | simConfig = sim.loadSimCfg("./simConfig.json", None, False) 30 | 31 | sim.createSimulate(netParams, simConfig) 32 | sim.saveData() 33 | 34 | 35 | with open("./experiment.json", "r") as f: 36 | exp = json.load(f) 37 | if exp['runCfg']['type'] == 'mpi_bulletin' and exp['runCfg']['cores'] > 1: 38 | pc = h.ParallelContext() 39 | if pc.id() == 0: 40 | update_state(exp, "SIMULATING") 41 | else: 42 | update_state(exp, "SIMULATING") 43 | 44 | try: 45 | run_sim() 46 | update_state(exp, "SIMULATED") 47 | sys.exit(0) 48 | 49 | except Exception as e: 50 | print("Experiment failed ...") 51 | print(e) 52 | 53 | update_state(exp, "ERROR") 54 | sys.exit(1) 55 | -------------------------------------------------------------------------------- /netpyne_ui/templates/run_instantiated_net.py: -------------------------------------------------------------------------------- 1 | import neuron 2 | 3 | from netpyne import sim 4 | 5 | # Folder that contains x86_64 folder 6 | NETPYNE_WORKDIR_PATH = '../../../' 7 | neuron.load_mechanisms(NETPYNE_WORKDIR_PATH) 8 | 9 | sim.load("./model_output.json") 10 | sim.createSimulate() 11 | sim.saveData() -------------------------------------------------------------------------------- /netpyne_ui/utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | 4 | def remove(dictionary): 5 | # remove reserved keys such as __dict__, __Method__, etc 6 | # they appear when we do sim.loadAll(json_file) 7 | if isinstance(dictionary, dict): 8 | for key, value in list(dictionary.items()): 9 | if key.startswith('__'): 10 | dictionary.pop(key) 11 | else: 12 | remove(value) 13 | 14 | 15 | def get_next_file_name(directory: str, filename: str) -> str: 16 | if not os.path.exists(os.path.join(directory, filename)): 17 | return filename 18 | 19 | i = 1 20 | while os.path.exists(os.path.join(directory, f"{filename}-{i}")): 21 | i += 1 22 | 23 | return f"{filename}-{i}" 24 | -------------------------------------------------------------------------------- /netpyneui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/netpyneui.png -------------------------------------------------------------------------------- /requirements-test.txt: -------------------------------------------------------------------------------- 1 | pytest==4.6.2 2 | pytest-cov==2.7.1 3 | tox==3.12.1 -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | airspeed==0.5.20 2 | alembic==1.4.2 3 | async-generator==1.10 4 | attrs==19.3.0 5 | blinker==1.4 6 | bokeh==2.3.1 7 | brotlipy==0.7.0 8 | cachetools==0.8.0 9 | cffi==1.14.0 10 | chardet==3.0.4 11 | cryptography==2.9.2 12 | cycler==0.10.0 13 | decorator==4.4.2 14 | defusedxml==0.6.0 15 | Deprecated==1.2.10 16 | entrypoints==0.3 17 | future==0.18.2 18 | h5py==3.7.0 19 | idna==2.9 20 | ipython-genutils==0.2.0 21 | ipywidgets==7.5.1 22 | jedi==0.17.0 23 | Jinja2==2.11.2 24 | jsonpickle==2.1.0 25 | jsonschema==3.2.0 26 | jupyter_geppetto==1.1.5 27 | jupyter-client==7.0.6 28 | jupyter-core==4.9.1 29 | jupyter-server==1.11.2 30 | jupyterhub==1.5.0 31 | jupyterlab==3.2.4 32 | neuromllite==0.5.4 33 | jupyterthemes==0.20.0 34 | kiwisolver==1.2.0 35 | lesscpy==0.14.0 36 | libNeuroML==0.5.1 37 | lfpykit==0.5.1 38 | lxml==4.5.1 39 | Mako==1.1.0 40 | MarkupSafe==1.1.1 41 | matplotlib 42 | matplotlib-scalebar 43 | mistune==0.8.4 44 | multimethod==1.3 45 | nbconvert==5.6.1 46 | nbformat==5.0.6 47 | netpyne==1.0.6 48 | NEURON==8.2.2 49 | numpy==1.18.5 50 | oauthlib==3.0.1 51 | optuna==2.10.1 52 | ordered-set==4.0.2 53 | pamela==1.0.0 54 | pandas==0.23.4 55 | pandocfilters==1.4.2 56 | parso==0.7.0 57 | pexpect==4.8.0 58 | pickleshare==0.7.5 59 | Pillow==7.2.0 60 | ply==3.11 61 | prompt-toolkit==3.0.5 62 | ptyprocess==0.6.0 63 | pycosat==0.6.3 64 | pycparser==2.20 65 | pyecore==0.11.7 66 | pygeppetto==0.8.1 67 | PyLEMS==0.5.9 68 | pyNeuroML==1.0.10 69 | sentry_sdk==1.5.2 70 | dacite==1.6.0 71 | h5py==3.7.0 72 | jsonpickle==2.1.0 73 | Pygments==2.6.1 74 | PyJWT==1.7.1 75 | pyOpenSSL==19.1.0 76 | pyparsing==2.4.7 77 | pyrsistent==0.16.0 78 | PySocks==1.7.1 79 | python-dateutil==2.8.1 80 | python-editor==1.0.4 81 | python-json-logger==0.1.11 82 | pytz==2020.1 83 | PyYAML==5.3.1 84 | pyzmq==19.0.1 85 | qtconsole==4.7.5 86 | QtPy==1.9.0 87 | RestrictedPython==5.0 88 | ruamel-yaml==0.15.80 89 | ruamel.yaml.clib==0.2.0 90 | scipy==1.4.1 91 | Send2Trash==1.5.0 92 | terminado==0.8.3 93 | testpath==0.4.4 94 | tornado==6.1.0 95 | traitlets==4.3.3 96 | typing-extensions==3.7.4.2 97 | urllib3==1.25.9 98 | webencodings==0.5.1 99 | widgetsnbextension==3.5.1 100 | wrapt==1.12.1 101 | zipp==3.1.0 -------------------------------------------------------------------------------- /run.py: -------------------------------------------------------------------------------- 1 | """ 2 | Run this to debug 3 | """ 4 | import sys 5 | import os 6 | 7 | from notebook.notebookapp import NotebookApp 8 | from jupyter_geppetto import settings 9 | 10 | os.environ['JUPYTER_CONFIG_DIR'] = os.path.join(os.path.dirname(os.path.abspath(__file__)), '.jupyter-config') 11 | 12 | settings.debug = False 13 | 14 | if __name__ == '__main__': 15 | sys.argv.append('--NotebookApp.default_url=/geppetto') 16 | sys.argv.append("--NotebookApp.token=''") 17 | sys.argv.append('--library=netpyne_ui') 18 | sys.argv.append('--no-browser') 19 | sys.argv.append('--NotebookApp.disable_check_xsrf=True') 20 | 21 | app = NotebookApp.instance() 22 | app.initialize(sys.argv) 23 | app.file_to_run = '' 24 | sys.exit(app.start()) 25 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | import fnmatch 3 | import os 4 | from glob import glob 5 | 6 | # This block copies resources to the server so we avoid jupyter nbextension install --py --sys-prefix jupyter_geppetto 7 | data_files = [] 8 | data_files.append(('geppetto/src/main/webapp/build/', 9 | glob('src/jupyter_geppetto/geppetto/src/main/webapp/build/*.js'))) 10 | data_files.append(('geppetto/src/main/webapp/build/', 11 | glob('src/jupyter_geppetto/geppetto/src/main/webapp/build/*.vm'))) 12 | data_files.append(('geppetto/geppetto/src/main/webapp/build/', 13 | glob('src/jupyter_geppetto/geppetto/src/main/webapp/build/fonts/*'))) 14 | for root, dirnames, filenames in os.walk('src/jupyter_geppetto/geppetto/src/main/webapp/js/'): 15 | for filename in fnmatch.filter(filenames, '*'): 16 | data_files.append((root[3:], [os.path.join(root, filename)])) 17 | 18 | 19 | setuptools.setup( 20 | name="netpyne_ui", 21 | version="1.1.0", 22 | url="https://github.com/MetaCell/NetPyNE-UI", 23 | author="MetaCell", 24 | author_email="info@metacell.us", 25 | description="NetPyNE User interface", 26 | license="MIT", 27 | long_description=open('README.rst').read(), 28 | data_files=data_files, 29 | packages=setuptools.find_packages(), 30 | include_package_data=True, 31 | scripts=['NetPyNE-UI'], 32 | classifiers=[ 33 | 'Development Status :: 3 - Alpha', 34 | 'Intended Audience :: Science/Research', 35 | 'Topic :: Scientific/Engineering :: Visualization', 36 | 'License :: OSI Approved :: MIT License', 37 | 'Programming Language :: Python :: 3', 38 | 'Programming Language :: Python :: 3.3', 39 | 'Programming Language :: Python :: 3.4', 40 | 'Programming Language :: Python :: 3.7' 41 | ], 42 | install_requires=[ 43 | 'jupyter-geppetto>=1.0.0', 44 | 'NEURON>=8.2.2', 45 | 'netpyne>=1.0.6', 46 | 'neuromllite==0.5.4', 47 | 'pyNeuroML>=1.0.10', 48 | 'sentry_sdk>=1.5.2', 49 | 'dacite>=1.6.0', 50 | 'h5py>=3.7.0', 51 | 'jsonpickle>=2.1.0', 52 | ], 53 | ) 54 | -------------------------------------------------------------------------------- /tests/backend/.gitignore: -------------------------------------------------------------------------------- 1 | workspace 2 | -------------------------------------------------------------------------------- /tests/backend/utils_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from netpyne_ui.netpyne_geppetto import NETPYNE_WORKDIR_PATH 4 | from netpyne_ui import mod_utils 5 | HERE = os.path.dirname(os.path.abspath(__file__)) 6 | 7 | import sentry_sdk 8 | sentry_sdk.init() 9 | 10 | def test_compile_mod(): 11 | mod_utils.loadModMechFiles(True, NETPYNE_WORKDIR_PATH) 12 | -------------------------------------------------------------------------------- /tests/deployment/build.sh: -------------------------------------------------------------------------------- 1 | cd ../../ 2 | docker build -t netpyne-ui . 3 | cd tests/frontend/e2e 4 | docker build -t netpyne-ui-e2e . 5 | -------------------------------------------------------------------------------- /tests/deployment/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | services: 4 | netpyne-ui: 5 | image: netpyne-ui:latest 6 | restart: 'no' 7 | ports: 8 | - "8888:8888" 9 | netpyne-ui-e2e: 10 | image: netpyne-ui-e2e:latest 11 | restart: 'no' 12 | environment: 13 | - url=http://netpyne-ui:8888 14 | depends_on: 15 | - netpyne-ui 16 | command: bash -c "sleep 5 && npm run test" -------------------------------------------------------------------------------- /tests/frontend/e2e/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /tests/frontend/e2e/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/** -------------------------------------------------------------------------------- /tests/frontend/e2e/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ["plugin:jest/recommended"], 3 | rules: { 4 | 'multiline-comment-style': 0, 5 | }, 6 | plugins: ["jest"], 7 | globals: { 8 | page: true, 9 | browser: true, 10 | context: true, 11 | jestPuppeteer: true, 12 | acnet2: true, 13 | c302: true, 14 | pvdr: true, 15 | net1: true, 16 | CanvasContainer: true, 17 | patchRequire: true, 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /tests/frontend/e2e/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM buildkite/puppeteer:latest 2 | 3 | ENV CHROME_BIN=/usr/bin/chromium-browser 4 | ARG DEBIAN_FRONTEND=noninteractive 5 | 6 | COPY package.json . 7 | COPY package-lock.json . 8 | 9 | RUN npm ci 10 | 11 | COPY . . 12 | 13 | CMD ["npm", "run", "test"] -------------------------------------------------------------------------------- /tests/frontend/e2e/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@babel/preset-env', 5 | { targets: { node: 'current' } }, 6 | ], 7 | ], 8 | }; -------------------------------------------------------------------------------- /tests/frontend/e2e/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | verbose: true, 3 | // preset: "jest-puppeteer", 4 | testRegex : "(tests/Test.*|(\\.|/)(test|spec))\\.[jt]sx?$", 5 | setupFilesAfterEnv: ['./tests/setupTests.js'], 6 | }; -------------------------------------------------------------------------------- /tests/frontend/e2e/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "netpyne-ui.test.e2e", 3 | "version": "0.1.0", 4 | "description": "NetPyNe UI tests", 5 | "license": "unlicensed", 6 | "scripts": { 7 | "test": "sleep 60 && npm run simple_tutorials_test && npm run complex_tutorials_test && npm run features_test", 8 | "puppeteer_test": "jest --verbose", 9 | "simple_tutorials_test": "sleep 60 && jest --verbose Tut#1_smoke Tut#2_smoke Tut#4_smoke", 10 | "complex_tutorials_test": "jest --verbose Tut#3a_smoke Tut#3b_smoke Tut#3c_smoke", 11 | "features_test": "jest --verbose ControlPanel SaveOpenFile RxD EEG_and_Dipole_Tut#1 ExperimentManager_Tut#1", 12 | "EEG_Dipole_test": "jest --verbose EEG_and_Dipole_Tut#1 ", 13 | "Experiment_Manager_test": "jest --verbose ExperimentManager_Tut#1 ", 14 | "Tutorial_1_test": "jest --verbose Tut#1_smoke ", 15 | "Tutorial_2_test": "jest --verbose Tut#2_smoke ", 16 | "Tutorial_3A_test": "jest --verbose Tut#3a_smoke ", 17 | "Tutorial_3B_test": "jest --verbose Tut#3b_smoke ", 18 | "Tutorial_3C_test": "jest --verbose Tut#3c_smoke ", 19 | "Tutorial_4_test": "jest --verbose Tut#4_smoke ", 20 | "Control_Panel_test": "jest --verbose ControlPanel ", 21 | "Save_Open_File_test": "jest --verbose SaveOpenFile", 22 | "RxD_test": "jest --verbose RxD", 23 | "lint": "eslint --fix --ext .js,.jsx ." 24 | }, 25 | "dependencies": { 26 | "jest": "^27.5.1", 27 | "jest-image-snapshot": "^4.5.1", 28 | "jest-puppeteer": "^6.1.0", 29 | "puppeteer": "^13.5.1" 30 | }, 31 | "devDependencies": { 32 | "@babel/core": "^7.4.5", 33 | "@babel/plugin-proposal-class-properties": "^7.5.5", 34 | "@babel/plugin-syntax-dynamic-import": "^7.2.0", 35 | "@babel/plugin-transform-runtime": "^7.4.5", 36 | "@babel/preset-env": "^7.4.5", 37 | "@babel/preset-react": "^7.0.0", 38 | "@babel/preset-stage-2": "^7.0.0", 39 | "@babel/runtime": "^7.4.5", 40 | "babel-eslint": "^10.0.1", 41 | "babel-jest": "^24.9.0", 42 | "babel-loader": "^8.0.6", 43 | "babel-plugin-transform-decorators-legacy": "^1.3.5", 44 | "babel-plugin-transform-object-assign": "^6.8.0", 45 | "babel-plugin-transform-runtime": "^6.15.0", 46 | "eslint": "^6.0.1", 47 | "eslint-plugin-jest": "^22.21.0" 48 | }, 49 | "buildOptions": { 50 | "emitEntryPoint": true, 51 | "compile": { 52 | "exclude": [ 53 | "node_modules" 54 | ] 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/setupTests.js: -------------------------------------------------------------------------------- 1 | const { toMatchImageSnapshot } = require('jest-image-snapshot'); 2 | 3 | expect.extend({ toMatchImageSnapshot }); -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/EEG_and_Dipole_Tut#1.test/Dipole Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/EEG_and_Dipole_Tut#1.test/Dipole Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/EEG_and_Dipole_Tut#1.test/EEG Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/EEG_and_Dipole_Tut#1.test/EEG Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/EEG_and_Dipole_Tut#1.test/Tutorial#1 Network-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/EEG_and_Dipole_Tut#1.test/Tutorial#1 Network-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/ExperimentManager_Tut#1.test/Experiment Condition #1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/ExperimentManager_Tut#1.test/Experiment Condition #1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/ExperimentManager_Tut#1.test/Experiment Condition #2-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/ExperimentManager_Tut#1.test/Experiment Condition #2-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/ExperimentManager_Tut#1.test/Experiment Condition #3-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/ExperimentManager_Tut#1.test/Experiment Condition #3-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/ExperimentManager_Tut#1.test/Tutorial#1 Network-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/ExperimentManager_Tut#1.test/Tutorial#1 Network-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/RxD.test/LFP PSD Plot After change-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/RxD.test/LFP PSD Plot After change-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/RxD.test/LFP PSD Plot Before change-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/RxD.test/LFP PSD Plot Before change-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/RxD.test/LFP Time Series Plot After change-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/RxD.test/LFP Time Series Plot After change-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/RxD.test/LFP Time Series Plot Before change-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/RxD.test/LFP Time Series Plot Before change-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/RxD.test/RxD Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/RxD.test/RxD Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/SaveOpenFile.test/Edited NetClamp Model-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/SaveOpenFile.test/Edited NetClamp Model-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/SaveOpenFile.test/NetClamp Model-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/SaveOpenFile.test/NetClamp Model-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/2D Net Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/2D Net Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Cell Traces Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Cell Traces Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Connections Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Connections Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Granger Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Granger Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Raster Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Raster Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Rate Spectogram Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Rate Spectogram Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Spike Hist Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Spike Hist Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Tutorial#1 Network-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#1_smoke.test/Tutorial#1 Network-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/2D Net Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/2D Net Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Cell Traces Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Cell Traces Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Connections Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Connections Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Granger Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Granger Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Raster Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Raster Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Rate Spectogram Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Rate Spectogram Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Spike Hist Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Spike Hist Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Tutorial#2 Network-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#2_smoke.test/Tutorial#2 Network-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/2D Net Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/2D Net Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Cell Traces Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Cell Traces Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Connections Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Connections Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Granger Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Granger Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/LFP PSD Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/LFP PSD Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/LFP Spectrogram Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/LFP Spectrogram Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/LFP Time Series Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/LFP Time Series Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Raster Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Raster Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Rate Spectogram Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Rate Spectogram Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/RxD concentration plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/RxD concentration plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Spike Hist Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Spike Hist Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Tutorial#3a Network-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3a_smoke.test/Tutorial#3a Network-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/2D Net Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/2D Net Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Cell Traces Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Cell Traces Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Connections Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Connections Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Granger Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Granger Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/LFP PSD Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/LFP PSD Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/LFP Spectrogram Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/LFP Spectrogram Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/LFP Time Series Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/LFP Time Series Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Raster Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Raster Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Rate Spectogram Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Rate Spectogram Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/RxD concentration plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/RxD concentration plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Spike Hist Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Spike Hist Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Tutorial#3b Network-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3b_smoke.test/Tutorial#3b Network-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/2D Net Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/2D Net Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Cell Traces Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Cell Traces Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Connections Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Connections Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Granger Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Granger Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/LFP PSD Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/LFP PSD Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/LFP Spectrogram Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/LFP Spectrogram Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/LFP Time Series Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/LFP Time Series Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Raster Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Raster Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Rate Spectogram Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Rate Spectogram Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Spike Hist Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Spike Hist Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Tutorial#3c Network-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#3c_smoke.test/Tutorial#3c Network-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/2D Net Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/2D Net Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Cell Traces Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Cell Traces Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Connections Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Connections Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Raster Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Raster Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Rate Spectogram Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Rate Spectogram Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Spike Hist Plot-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Spike Hist Plot-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Tutorial#4 Network-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/Tut#4_smoke.test/Tutorial#4 Network-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-adding-excitatory-population-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-adding-excitatory-population-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-cell-traces-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-cell-traces-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-cell-types-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-cell-types-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-cell-types-2-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-cell-types-2-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-configuration-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-configuration-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-configure-synapses-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-configure-synapses-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-connectivity-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-connectivity-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-create-network-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-create-network-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-plot-settings-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-plot-settings-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-raster-plot-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-raster-plot-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-spike-hist-plot-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-spike-hist-plot-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-stim-sources-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-stim-sources-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-stim-targets-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-stim-targets-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-view-2-d-net-plot-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-view-2-d-net-plot-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-view-connections-plot-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/eb3b3a3c5d5eaaffaed044147c13d8125128b387/tests/frontend/e2e/tests/snapshots/tutorial_1/test-tutorial-1-js-tutorial-1-view-connections-plot-1-snap.png -------------------------------------------------------------------------------- /tests/frontend/e2e/tests/utils.js: -------------------------------------------------------------------------------- 1 | export const wait4selector = async (page, selector, settings = {}) => { 2 | let success = undefined; 3 | let options = settings; 4 | if (!("timeout" in settings)) { 5 | options = { timeout: 5000, ...settings }; 6 | } 7 | try { 8 | await page.waitForSelector(selector, options); 9 | success = true 10 | } catch (error) { 11 | let behaviour = "to exists." 12 | if (options.visible || options.hidden) { 13 | behaviour = options.visible ? "to be visible." : "to disappear." 14 | } 15 | console.log(`ERROR: timeout waiting for selector ---> ${selector} ${behaviour}`) 16 | } 17 | expect(success).toBeDefined() 18 | } 19 | 20 | export const click = async (page, selector) => { 21 | await wait4selector(page, selector, { visible: true }); 22 | try { 23 | await page.click(selector); 24 | } catch (error) { 25 | // console.log(`ERROR clicking on selector ---> ${selector} failed.`) 26 | } 27 | } -------------------------------------------------------------------------------- /webapp/.eslintignore: -------------------------------------------------------------------------------- 1 | etc/* 2 | node/* 3 | build/* 4 | META-INF/* 5 | **/tests/casperjs/**/*.js 6 | **/tests/jest-puppeteer/**/*.js 7 | **/*min.js 8 | geppetto-client/** 9 | node_modules/** 10 | webpack.*.js 11 | -------------------------------------------------------------------------------- /webapp/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | 'airbnb', 4 | ], 5 | parser: 'babel-eslint', 6 | rules: { 7 | // Turn off some rules so that we can improve the code step by step 8 | 'class-methods-use-this': 0, 9 | 'react/jsx-filename-extension': 0, 10 | 11 | // Tweak some rules to our preferences 12 | 'space-before-function-paren': ['error', 'always'], 13 | 'react/prop-types': 1, 14 | 'no-console': 0, 15 | 'import/extensions': 0, 16 | 'max-len': ['warn', { code: 140 }], 17 | 'no-eval': 1, 18 | eqeqeq: 1, 19 | 'no-plusplus': 1, 20 | 'react/destructuring-assignment': 1, 21 | 'no-param-reassign': 1, 22 | 'vars-on-top': 1, 23 | 'no-use-before-define': 1, 24 | 'no-unused-vars': 1, 25 | 'import/no-unresolved': 1, 26 | 'import/named': 1, 27 | 'react/jsx-props-no-spreading': 1, 28 | 'no-nested-ternary': 1, 29 | 'no-return-assign': 1, 30 | 'react/no-array-index-key': 1, 31 | 'react/sort-comp': 1, 32 | 'consistent-return': 1, 33 | 'import/prefer-default-export': 1, 34 | 'react/no-unused-state': 1, 35 | 'jsx-a11y/alt-text': 1, 36 | 'no-restricted-syntax': 1, 37 | 'no-underscore-dangle': 1, 38 | 'no-restricted-globals': 1, 39 | camelcase: 1, 40 | 'max-classes-per-file': 1, 41 | 'jsx-a11y/click-events-have-key-events': 1, 42 | 'jsx-a11y/no-static-element-interactions': 1, 43 | 'prefer-destructuring': 1, 44 | 'no-redeclare': 1, 45 | 'import/no-webpack-loader-syntax': 1, 46 | 'global-require': 1, 47 | 'default-case': 1, 48 | 'react/prefer-stateless-function': 1, 49 | 'block-scoped-var': 1, 50 | 'no-var': 1, 51 | 'no-shadow': 1, 52 | 'react/no-did-update-set-state': 1, 53 | 'react/no-string-refs': 1, 54 | 'no-multi-assign': 1, 55 | 'guard-for-in': 1, 56 | 'no-unused-expressions': 1, 57 | 'no-control-regex': 1, 58 | 'no-loop-func': 1, 59 | }, 60 | globals: { 61 | page: true, 62 | browser: true, 63 | context: true, 64 | acnet2: true, 65 | c302: true, 66 | pvdr: true, 67 | net1: true, 68 | CanvasContainer: true, 69 | patchRequire: true, 70 | window: true, 71 | document: true, 72 | $: true, 73 | IPython: true, 74 | fetch: true, 75 | Blob: true, 76 | FormData: true, 77 | Event: true, 78 | jQuery: true, 79 | define: true, 80 | // geppetto 81 | Instances: true, 82 | GEPPETTO: true, 83 | IPython: true, 84 | }, 85 | }; 86 | -------------------------------------------------------------------------------- /webapp/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | geppetto-application 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /webapp/GeppettoConfiguration.json: -------------------------------------------------------------------------------- 1 | { 2 | "_README" : "http://docs.geppetto.org/en/latest/build.html", 3 | "contextPath": "org.geppetto.frontend", 4 | "useSsl": true, 5 | "embedded": true, 6 | "embedderURL": ["/"], 7 | "rootRedirect":"", 8 | "noTest": false, 9 | "customSplash": "geppetto/build/static/splash.gif", 10 | "extensions": { 11 | "geppetto-default/ComponentsInitialization": false, 12 | "geppetto-netpyne/ComponentsInitialization": true 13 | }, 14 | "themes": "css/colors", 15 | "properties": { 16 | "title" : "NetPyNE", 17 | "description": "NetPyNE-UI is a user interface for building, visualizing and simulationg neuronal network models using NetPyNE.", 18 | "type": "website", 19 | "url": "https://github.com/MetaCell/NetPyNE-UI", 20 | "icon" :"https://d30y9cdsu7xlg0.cloudfront.net/png/38902-200.png", 21 | "image": "http://www.geppetto.org/images/logo.png" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /webapp/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2011, 2017 Geppetto authors 4 | http://geppetto.org 5 | 6 | All rights reserved. This program and the accompanying materials 7 | are made available under the terms of the MIT License 8 | which accompanies this distribution, and is available at 9 | http://opensource.org/licenses/MIT 10 | 11 | Contributors: 12 | Geppetto - http://contributors.geppetto.org 13 | 14 | Permission is hereby granted, free of charge, to any person obtaining a copy 15 | of this software and associated documentation files (the "Software"), to deal 16 | in the Software without restriction, including without limitation the rights 17 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | copies of the Software, and to permit persons to whom the Software is 19 | furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in all 22 | copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 27 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 28 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 29 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 30 | USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | -------------------------------------------------------------------------------- /webapp/Main.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { Provider } from 'react-redux'; 4 | import { MuiThemeProvider } from '@material-ui/core/styles'; 5 | import * as Sentry from '@sentry/react'; 6 | import { CaptureConsole } from '@sentry/integrations'; 7 | import { LoadingSpinner } from '@metacell/geppetto-meta-client/components'; 8 | import { NetPyNE } from './components'; 9 | import theme from './theme'; 10 | import store from './redux/store'; 11 | import '@metacell/geppetto-meta-ui/flex-layout/style/dark.css'; 12 | 13 | global.GEPPETTO_CONFIGURATION = require('./GeppettoConfiguration.json'); 14 | const { initGeppetto } = require('@metacell/geppetto-meta-client/GEPPETTO'); 15 | 16 | if (process.env.NODE_ENV === 'production') { 17 | Sentry.init({ 18 | dsn: 'https://d8bf7e40eec34cb9891f6dd8207b5e83@sentry.metacell.us/6', 19 | integrations: [ 20 | new CaptureConsole({ 21 | levels: ['error'], 22 | }), 23 | ], 24 | tracesSampleRate: 1.0, 25 | }); 26 | } 27 | 28 | window.$ = Array; // TODO Temporary fix -- remove upon https://github.com/MetaCell/geppetto-meta/issues/380 29 | initGeppetto(); 30 | require('./css/netpyne.less'); 31 | require('./css/material.less'); 32 | require('./css/traceback.less'); 33 | require('./css/flexlayout.less'); 34 | require('./css/tree.less'); 35 | 36 | ReactDOM.render( 37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 |
, 45 | document.querySelector('#mainContainer'), 46 | ); 47 | 48 | GEPPETTO.Resources.COLORS.DEFAULT = '#6f54aa'; 49 | -------------------------------------------------------------------------------- /webapp/PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | - [ ] Add coverage for whatever new functionality, to a JUnit test if it's backend, to a Casper Test if it's frontend 2 | - [ ] Make sure both push and pr travis builds are passing before asking for a review 3 | -------------------------------------------------------------------------------- /webapp/README.md: -------------------------------------------------------------------------------- 1 | # geppetto-netpyne 2 | 3 | Frontend Geppetto application for the [NetPyNE UI](https://github.com/MetaCell/NetPyNE-UI). 4 | -------------------------------------------------------------------------------- /webapp/api/experiments.js: -------------------------------------------------------------------------------- 1 | import Utils from 'root/Utils'; 2 | 3 | export const getExperiments = () => Utils.evalPythonMessage('netpyne_geppetto.experiments.get_experiments', []); 4 | 5 | export const getExperiment = (name) => Utils.evalPythonMessage('netpyne_geppetto.experiments.get_experiment', [name]); 6 | export const removeExperiment = (name) => Utils.evalPythonMessage('netpyne_geppetto.experiments.remove_experiment', [name]); 7 | export const addExperiment = (experiment) => Utils.evalPythonMessage('netpyne_geppetto.experiments.add_experiment', [experiment]); 8 | export const editExperiment = (name, experiment) => Utils.evalPythonMessage('netpyne_geppetto.experiments.edit_experiment', 9 | [name, experiment]); 10 | 11 | export const getParameters = () => Utils.evalPythonMessage('netpyne_geppetto.getModelAsJson', []); 12 | export const getModelSpecification = (name, trial) => Utils.evalPythonMessage('netpyne_geppetto.experiments.get_model_specification', 13 | [name, trial]); 14 | 15 | export const getRunConfiguration = () => Utils.evalPythonMessage('netpyne_geppetto.get_run_configuration', []); 16 | export const editRunConfiguration = (runConfig) => Utils.evalPythonMessage('netpyne_geppetto.edit_run_configuration', 17 | [runConfig]); 18 | -------------------------------------------------------------------------------- /webapp/api/hooks.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from 'react'; 2 | 3 | /** 4 | * Interval hook taken from: https://overreacted.io/making-setinterval-declarative-with-react-hooks/ 5 | * 6 | * @param callback 7 | * @param delay 8 | */ 9 | const useInterval = (callback, delay) => { 10 | const savedCallback = useRef(); 11 | 12 | // Remember the latest callback. 13 | useEffect(() => { 14 | savedCallback.current = callback; 15 | }, [callback]); 16 | 17 | // Set up the interval. 18 | useEffect(() => { 19 | function tick () { 20 | savedCallback.current(); 21 | } 22 | 23 | if (delay !== null) { 24 | const id = setInterval(tick, delay); 25 | return () => clearInterval(id); 26 | } 27 | }, [delay]); 28 | }; 29 | 30 | export default useInterval; 31 | -------------------------------------------------------------------------------- /webapp/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@babel/preset-env', 5 | { targets: { node: 'current' } }, 6 | ], 7 | '@babel/preset-typescript', 8 | '@babel/preset-react', 9 | ], 10 | plugins: [ 11 | '@babel/plugin-proposal-class-properties', 12 | ], 13 | }; 14 | -------------------------------------------------------------------------------- /webapp/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/ 2 | -------------------------------------------------------------------------------- /webapp/components/definition/cellRules/sections/mechanisms/NetPyNEMechanism.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import TextField from '@material-ui/core/TextField'; 3 | import Box from '@material-ui/core/Box'; 4 | import { NetPyNETextField } from 'netpyne/components'; 5 | import Utils from '../../../../../Utils'; 6 | 7 | export default class NetPyNEMechanism extends React.Component { 8 | constructor (props) { 9 | super(props); 10 | this.state = { 11 | currentName: props.name, 12 | mechFields: '', 13 | }; 14 | } 15 | 16 | UNSAFE_componentWillReceiveProps (nextProps) { 17 | this.setState({ currentName: nextProps.name }); 18 | } 19 | 20 | renderMechFields = () => { 21 | if (this.state.mechFields === '') { 22 | return
; 23 | } 24 | 25 | const { currentName } = this.state; 26 | const { 27 | cellRule, 28 | section, 29 | } = this.props; 30 | const tag = `netParams.cellParams['${cellRule}']['secs']['${section}']['mechs']['${currentName}']`; 31 | 32 | return this.state.mechFields.map((name, i) => ( 33 | 34 | 42 | 43 | )); 44 | }; 45 | 46 | render () { 47 | const content = []; 48 | if (this.state.currentName !== undefined && this.state.currentName !== '') { 49 | Utils.evalPythonMessage('netpyne_geppetto.getMechParams', [ 50 | this.state.currentName, 51 | ]) 52 | .then((response) => { 53 | if (JSON.stringify(this.state.mechFields) !== JSON.stringify(response)) { 54 | this.setState({ mechFields: response }); 55 | } 56 | }); 57 | content.push(this.renderMechFields()); 58 | } 59 | 60 | return ( 61 | 62 | 63 | 70 | 71 | 72 | {content} 73 | 74 | ); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /webapp/components/definition/plots/NetPyNEPlotThumbnail.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import IconButton from '@material-ui/core/IconButton'; 3 | import FontIcon from '@material-ui/core/Icon'; 4 | 5 | export default class NetPyNEPlotThumbnail extends React.Component { 6 | constructor (props) { 7 | super(props); 8 | this.handleClick = this.handleClick.bind(this); 9 | } 10 | 11 | handleClick () { 12 | this.props.handleClick(this.props.name); 13 | } 14 | 15 | render () { 16 | return ( 17 | 21 | 22 | {this.props.name} 23 | 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /webapp/components/definition/plots/TimeRange.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import TextField from '@material-ui/core/TextField'; 3 | import { AdapterComponent } from 'netpyne/components'; 4 | 5 | export default class TimeRange extends Component { 6 | render () { 7 | return ( 8 | { 11 | if (state[state.lastUpdated].toString() 12 | .endsWith('.')) { 13 | return undefined; 14 | } 15 | if (!isNaN(parseFloat(state.min)) && !isNaN(parseFloat(state.max))) { 16 | return [parseFloat(state.min), parseFloat(state.max)]; 17 | } 18 | }} 19 | convertFromPython={(prevProps, prevState, value) => { 20 | if (value != undefined && prevProps.value != value && value != '') { 21 | return { 22 | min: value[0], 23 | max: value[1], 24 | }; 25 | } 26 | }} 27 | > 28 | 29 | 30 | 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /webapp/components/definition/plots/plotTypes/Plot2Dnet.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Box from '@material-ui/core/Box'; 3 | import { 4 | NetPyNEInclude, 5 | NetPyNEField, 6 | SelectField, 7 | NetPyNECheckbox, 8 | } from 'netpyne/components'; 9 | 10 | export default class Plot2Dnet extends React.Component { 11 | constructor (props) { 12 | super(props); 13 | this.state = {}; 14 | } 15 | 16 | render () { 17 | const tag = 'simConfig.analysis[\'iplot2Dnet\']'; 18 | return ( 19 | 20 | 26 | 27 | 31 | 32 | 33 | 34 | 38 | 39 | 40 | 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /webapp/components/definition/plots/plotTypes/PlotConn.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Box from '@material-ui/core/Box'; 3 | import { NetPyNEInclude, NetPyNEField, SelectField } from 'netpyne/components'; 4 | 5 | export default class plotConn extends React.Component { 6 | constructor (props) { 7 | super(props); 8 | this.state = {}; 9 | } 10 | 11 | render () { 12 | const tag = 'simConfig.analysis[\'iplotConn\']'; 13 | return ( 14 | 15 | 21 | 22 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /webapp/components/definition/plots/plotTypes/PlotGranger.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Box from '@material-ui/core/Box'; 3 | import { ListComponent, NetPyNEField, NetPyNETextField } from 'netpyne/components'; 4 | import TimeRange from '../TimeRange'; 5 | 6 | export default class PlotGranger extends React.Component { 7 | constructor (props) { 8 | super(props); 9 | this.state = {}; 10 | } 11 | 12 | render () { 13 | const tags = 'simConfig.analysis[\'granger\']'; 14 | return ( 15 | 16 | 20 | 21 | 22 | 23 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 | 41 | 42 | 43 | 44 | 45 | 50 | 51 | 52 | 53 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 70 | 71 | 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /webapp/components/definition/plots/plotTypes/PlotRatePSD.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Box from '@material-ui/core/Box'; 3 | import { 4 | NetPyNEInclude, 5 | NetPyNEField, 6 | NetPyNECheckbox, 7 | NetPyNETextField, 8 | } from 'netpyne/components'; 9 | import TimeRange from '../TimeRange'; 10 | 11 | export default class PlotRatePSD extends React.Component { 12 | constructor (props) { 13 | super(props); 14 | this.state = {}; 15 | } 16 | 17 | render () { 18 | const tag = "simConfig.analysis['iplotRatePSD']"; 19 | return ( 20 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 40 | 41 | 46 | 47 | 48 | 49 | 54 | 55 | 56 | 57 | 62 | 63 | 64 | 65 | 70 | 71 | 72 | 76 | 77 | 78 | 79 | ); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /webapp/components/definition/plots/plotTypes/PlotSpikeHist.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Box from '@material-ui/core/Box'; 3 | import { 4 | NetPyNEInclude, 5 | NetPyNEField, 6 | NetPyNECheckbox, 7 | NetPyNETextField, 8 | SelectField, 9 | } from 'netpyne/components'; 10 | import TimeRange from '../TimeRange'; 11 | 12 | export default class PlotSpikeHist extends React.Component { 13 | constructor (props) { 14 | super(props); 15 | this.state = {}; 16 | } 17 | 18 | render () { 19 | const tag = "simConfig.analysis['iplotSpikeHist']"; 20 | return ( 21 | 22 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 39 | 40 | 41 | 45 | 46 | 47 | 48 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /webapp/components/definition/plots/plotTypes/PlotSpikeStats.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Box from '@material-ui/core/Box'; 3 | import { 4 | NetPyNEInclude, 5 | NetPyNEField, 6 | SelectField, 7 | ListComponent, 8 | } from 'netpyne/components'; 9 | import TimeRange from '../TimeRange'; 10 | 11 | export default class PlotSpikeStats extends React.Component { 12 | constructor (props) { 13 | super(props); 14 | this.state = {}; 15 | } 16 | 17 | render () { 18 | const tag = "simConfig.analysis['iplotSpikeStats']"; 19 | return ( 20 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 36 | 37 | 38 | 39 | 43 | 44 | 45 | 46 | 50 | 51 | 52 | 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /webapp/components/definition/plots/plotTypes/PlotTraces.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Box from '@material-ui/core/Box'; 3 | import { 4 | NetPyNEInclude, 5 | NetPyNEField, 6 | NetPyNECheckbox, 7 | SelectField, 8 | } from 'netpyne/components'; 9 | import TimeRange from '../TimeRange'; 10 | 11 | export default class PlotTraces extends React.Component { 12 | constructor (props) { 13 | super(props); 14 | this.state = {}; 15 | } 16 | 17 | render () { 18 | const tag = "simConfig.analysis['iplotTraces']"; 19 | return ( 20 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 36 | 37 | 38 | 39 | 43 | 44 | 45 | 46 | 50 | 51 | 52 | 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /webapp/components/drawer/useStyles.js: -------------------------------------------------------------------------------- 1 | import { makeStyles } from '@material-ui/core/styles'; 2 | 3 | const drawerCss = (entering, transitions, palette, spacing) => ({ 4 | overflow: 'hidden', 5 | width: (props) => props.width, 6 | flexShrink: 0, 7 | borderRight: 'none', 8 | position: 'relative', 9 | flex: 1, 10 | display: 'flex', 11 | alignItems: 'stretch', 12 | transition: transitions.create('width', { 13 | easing: transitions.easing.sharp, 14 | duration: entering ? transitions.duration.enteringScreen : transitions.duration.leavingScreen, 15 | }), 16 | }); 17 | 18 | export default makeStyles(({ 19 | transitions, 20 | palette, 21 | spacing, 22 | }) => ({ 23 | openDrawer: drawerCss(true, transitions, palette, spacing), 24 | 25 | closeDrawer: drawerCss(false, transitions, palette, spacing), 26 | 27 | buttonContainerOpen: { textAlign: 'end', padding: '0' }, 28 | buttonContainerClosed: { textAlign: 'center', padding: '0' }, 29 | button: { 30 | color: 'white', 31 | fontSize: '1em', 32 | }, 33 | text: { marginLeft: spacing(1) }, 34 | container: { 35 | display: 'flex', 36 | justifyContent: 'space-between', 37 | flexDirection: 'column', 38 | flex: 1, 39 | width: '100%', 40 | 41 | '& > .MuiBox-root': { 42 | overflow: 'auto', 43 | maxHeight: 'calc(100vh - 96px)', 44 | }, 45 | }, 46 | 47 | selected: { color: palette.primary.main }, 48 | unselected: { color: palette.common.white }, 49 | disabled: { color: palette.common.black }, 50 | icon: { 51 | color: 'inherit', 52 | minWidth: 'unset', 53 | }, 54 | })); 55 | -------------------------------------------------------------------------------- /webapp/components/experiments/ExperimentManager.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { Experiments, ExperimentEdit } from '../index'; 3 | 4 | import ViewExperiment from './ExperimentView'; 5 | import JsonViewer from '../general/JsonViewer'; 6 | import { EXPERIMENT_VIEWS } from '../../constants'; 7 | 8 | const ExperimentManager = (props) => { 9 | const [editState, setEditState] = useState(false); 10 | const [experimentName, setExperimentName] = useState(null); 11 | const [trial, setTrial] = useState(null); 12 | const [trialJSON, setTrialJSON] = useState(null); 13 | const [view, setView] = useState(EXPERIMENT_VIEWS.list); 14 | 15 | 16 | const viewHandler = () => { 17 | switch (view) { 18 | case EXPERIMENT_VIEWS.list: return ( 19 | 24 | ); 25 | case EXPERIMENT_VIEWS.viewExperiment: return ( 26 | 32 | ); 33 | case EXPERIMENT_VIEWS.jsonViewer: return ( 34 | 40 | ); 41 | case EXPERIMENT_VIEWS.edit: return ( 42 | 47 | ); 48 | 49 | default: return ( 50 | 55 | ); 56 | } 57 | }; 58 | return ( 59 | <>{ viewHandler() } 60 | ); 61 | }; 62 | 63 | export default ExperimentManager; 64 | -------------------------------------------------------------------------------- /webapp/components/experiments/ParameterMenu.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import IconButton from '@material-ui/core/IconButton'; 3 | import Menu from '@material-ui/core/Menu'; 4 | import MoreVertIcon from '@material-ui/icons/MoreVert'; 5 | import MenuItem from '@material-ui/core/MenuItem'; 6 | 7 | const ParameterMenu = (props) => { 8 | const { 9 | parameter, index, removeFromGroup, addToGroup, removeParameter, 10 | } = props; 11 | const [anchorEl, setAnchorEl] = useState(null); 12 | 13 | const handleClick = (event) => { 14 | setAnchorEl(event.currentTarget); 15 | }; 16 | 17 | const handleClose = () => { 18 | setAnchorEl(null); 19 | }; 20 | 21 | return ( 22 | <> 23 | 24 | 25 | 26 | 37 | { parameter.inGroup 38 | ? removeFromGroup(index)}>Remove from group 39 | : addToGroup(index)}>Add to Group} 40 | removeParameter(index, parameter)}>Delete 41 | 42 | 43 | ); 44 | }; 45 | 46 | export default ParameterMenu; 47 | -------------------------------------------------------------------------------- /webapp/components/experiments/processExperimentData.js: -------------------------------------------------------------------------------- 1 | import Utils from '../../Utils'; 2 | import { getPythonTypeString } from './utils'; 3 | 4 | const REAL_TYPE = { 5 | INT: 'int', 6 | FLOAT: 'float', 7 | BOOL: 'bool', 8 | STR: 'str', 9 | FUNC: 'func', 10 | DICT: 'dict', 11 | DICT_DICT: 'dict(dict)', 12 | }; 13 | const SUPPORTED_TYPES = [ 14 | REAL_TYPE.INT, 15 | REAL_TYPE.FLOAT, 16 | REAL_TYPE.STR, 17 | REAL_TYPE.BOOL, 18 | REAL_TYPE.FUNC 19 | ]; 20 | 21 | 22 | 23 | 24 | 25 | 26 | /** 27 | * 28 | * @param {*} params Netpyne parameters 29 | * @returns map of flatten parameter name to the field spec from Netpyne metadata or inferred from the value 30 | */ 31 | export function getFlattenedParams(params) { 32 | 33 | const flattened = Utils.flatten(params); 34 | function getFieldSpec(fieldKey) { 35 | const metadataField = Utils.getMetadataField(fieldKey); 36 | if(metadataField) { 37 | return metadataField; 38 | } 39 | return { 40 | type: getPythonTypeString(flattened[fieldKey]), 41 | label: fieldKey.split(".").pop() 42 | } 43 | } 44 | 45 | const res = {}; 46 | 47 | for(const key in flattened) { 48 | const field = getFieldSpec(key); 49 | if(field && SUPPORTED_TYPES.includes(field.type)) { 50 | res[key] = field 51 | } 52 | } 53 | 54 | return res; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /webapp/components/experiments/utils.js: -------------------------------------------------------------------------------- 1 | import { REAL_TYPE } from '../../constants'; 2 | 3 | export function descendingComparator (a, b, orderBy) { 4 | if (b[orderBy] < a[orderBy]) { 5 | return -1; 6 | } 7 | if (b[orderBy] > a[orderBy]) { 8 | return 1; 9 | } 10 | return 0; 11 | } 12 | 13 | export function getComparator (order, orderBy) { 14 | return order === 'desc' 15 | ? (a, b) => descendingComparator(a, b, orderBy) 16 | : (a, b) => -descendingComparator(a, b, orderBy); 17 | } 18 | 19 | export function stableSort (array, comparator) { 20 | const stabilizedThis = array.map((el, index) => [el, index]); 21 | stabilizedThis.sort((a, b) => { 22 | const order = comparator(a[0], b[0]); 23 | if (order !== 0) return order; 24 | return a[1] - b[1]; 25 | }); 26 | return stabilizedThis.map((el) => el[0]); 27 | } 28 | 29 | 30 | export function getPythonTypeString(obj) { 31 | if(typeof obj == "number") { 32 | return REAL_TYPE.FLOAT 33 | } 34 | if(typeof obj == "string") { 35 | return REAL_TYPE.STR 36 | } 37 | if(typeof obj == "boolean") { 38 | return REAL_TYPE.BOOL 39 | } 40 | return undefined; 41 | } -------------------------------------------------------------------------------- /webapp/components/general/AdapterComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import Grid from '@material-ui/core/Grid'; 3 | 4 | /** 5 | * The adapter component provides a mechanism to group graphical components. 6 | * that act as a single component when communicating to python. 7 | * This creates a 1-to-n mapping between the python variable and the 8 | * multiple js components. 9 | */ 10 | 11 | export default class AdapterComponent extends Component { 12 | constructor (props) { 13 | super(props); 14 | /** 15 | * the state is constructed dynamically from the id props of each children 16 | * in this way we are declaring a controlled component that can handle his own 17 | * state when this is modified by a new input or action of the user 18 | * 19 | */ 20 | this.stateBuilder = {}; 21 | this.props.children.forEach((child, index) => { 22 | this.stateBuilder[child.props.id] = ''; 23 | }); 24 | this.state = this.stateBuilder; 25 | 26 | this.handleChildChange = this.handleChildChange.bind(this); 27 | } 28 | 29 | componentDidUpdate (prevProps, prevState) { 30 | if (this.props.commands !== prevProps.commands) 31 | this.forceUpdate(); 32 | const newValue = this.props.convertFromPython(prevProps, prevState, this.props.value); 33 | if (newValue != undefined) { 34 | this.setState(newValue); 35 | } 36 | } 37 | 38 | handleChildChange (event) { 39 | // Update State 40 | const newState = this.state; 41 | let { value } = event.target; 42 | if (value === '') { 43 | value = 0; 44 | } else if (isNaN(parseFloat(value))) { 45 | return ''; 46 | } 47 | 48 | newState.lastUpdated = event.target.id; 49 | newState[event.target.id] = value; 50 | this.setState(newState); 51 | 52 | // Call to conversion function 53 | const newValue = this.props.convertToPython(this.state); 54 | if (newValue != undefined && this.state.value != newValue && this.props.onChange) { 55 | this.props.onChange(null, null, newValue); 56 | } 57 | } 58 | 59 | render () { 60 | const childrenWithExtraProp = React.Children.map(this.props.children, (child) => React.cloneElement(child, { 61 | onChange: this.handleChildChange, 62 | value: this.state[child.props.id], 63 | })); 64 | 65 | return ( 66 | 67 | {childrenWithExtraProp[0]} 68 | {childrenWithExtraProp[1]} 69 | 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /webapp/components/general/Checkbox.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import Box from '@material-ui/core/Box'; 3 | import FormGroup from '@material-ui/core/FormGroup'; 4 | import MuiCheckbox from '@material-ui/core/Checkbox'; 5 | import FormControlLabel from '@material-ui/core/FormControlLabel'; 6 | 7 | import { bgLight } from '../../theme'; 8 | 9 | export default class Checkbox extends Component { 10 | componentDidUpdate (prevProps, prevState) { 11 | if (this.props.commands !== prevProps.commands) 12 | this.forceUpdate(); 13 | } 14 | render () { 15 | const { 16 | fullWidth, 17 | noBackground, 18 | styles, 19 | } = this.props; 20 | const localStyle = fullWidth ? { width: '100%' } : {}; 21 | if (noBackground) { 22 | localStyle.backgroundColor = 'inherit'; 23 | } 24 | 25 | return ( 26 | 35 | 40 | 47 | 48 | )} 49 | /> 50 | 51 | 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /webapp/components/general/DialogBox.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Dialog from '@material-ui/core/Dialog'; 3 | import Button from '@material-ui/core/Button'; 4 | import DialogActions from '@material-ui/core/DialogActions'; 5 | import DialogContent from '@material-ui/core/DialogContent'; 6 | import DialogContentText from '@material-ui/core/DialogContentText'; 7 | import DialogTitle from '@material-ui/core/DialogTitle'; 8 | 9 | // index.js uses connect to bind redux state and actions, must stay a class. 10 | // eslint-disable-next-line react/prefer-stateless-function 11 | export default class DialogBox extends React.Component { 12 | render () { 13 | const { 14 | open, 15 | onDialogResponse, 16 | textForDialog, 17 | } = this.props; 18 | 19 | return ( 20 | 23 | {textForDialog?.heading} 24 | 25 | 26 | {textForDialog?.content} 27 | 28 | 29 | 30 | 36 | 43 | 44 | 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /webapp/components/general/ExpansionPanel.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import Accordion from '@material-ui/core/Accordion'; 3 | import AccordionSummary from '@material-ui/core/AccordionSummary'; 4 | import AccordionDetails from '@material-ui/core/AccordionDetails'; 5 | import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; 6 | import ExpandLessIcon from '@material-ui/icons/ExpandLess'; 7 | import { withStyles } from '@material-ui/core/styles'; 8 | import Tooltip from './Tooltip'; 9 | 10 | const styles = ({ spacing }) => ({ button: { marginRight: 0 } }); 11 | 12 | class NetPyNEAccordion extends Component { 13 | constructor (props) { 14 | super(props); 15 | this.state = { expanded: false }; 16 | } 17 | 18 | render () { 19 | const { 20 | children, 21 | classes, 22 | ...others 23 | } = this.props; 24 | const [summary, ...details] = children; 25 | 26 | return ( 27 | 28 | this.setState((prevState) => ({ expanded: !prevState.expanded })), 31 | className: classes.button, 32 | }} 33 | expandIcon={( 34 | 38 | {this.state.expanded ? 39 | : } 40 | 41 | )} 42 | > 43 | {summary} 44 | 45 | 46 | {details} 47 | 48 | 49 | ); 50 | } 51 | } 52 | 53 | export default withStyles(styles)(NetPyNEAccordion); 54 | -------------------------------------------------------------------------------- /webapp/components/general/Filter.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import TextField from '@material-ui/core/TextField'; 3 | import Autocomplete from '@material-ui/lab/Autocomplete'; 4 | import { withStyles } from '@material-ui/core/styles'; 5 | import CloseIcon from '@material-ui/icons/Close'; 6 | import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; 7 | import { bgLight } from '../../theme'; 8 | import Tooltip from './Tooltip'; 9 | 10 | const styles = ({ spacing, shape }) => ({ 11 | root: { display: 'flex' }, 12 | adornment: { display: 'flex', alignItems: 'center' }, 13 | filter: { flex: 1, backgroundColor: bgLight }, 14 | underline: { 15 | '&&&:before': { }, 16 | '&&:after': { }, 17 | }, 18 | listbox: { color: 'white', maxHeight: '20vh' }, 19 | }); 20 | class Filter extends Component { 21 | constructor (props) { 22 | super(props); 23 | this.state = { open: false }; 24 | } 25 | 26 | render () { 27 | const { 28 | value, handleFilterChange, options, label, classes, ...others 29 | } = this.props; 30 | 31 | return ( 32 | this.setState({ open: false })} 35 | onOpen={() => this.setState({ open: true })} 36 | className={classes.filter} 37 | clearOnEscape 38 | autoComplete 39 | openOnFocus 40 | autoHighlight 41 | value={value === '' ? null : value} 42 | options={options} 43 | openText="" 44 | closeText="" 45 | clearText="" 46 | closeIcon={( 47 | 48 | 49 | 50 | )} 51 | popupIcon={( 52 | 53 | 54 | 55 | )} 56 | classes={{ inputRoot: classes.underline, listbox: classes.listbox }} 57 | onChange={(event, newValue) => handleFilterChange(newValue)} 58 | renderInput={(props) => } 59 | {...others} 60 | /> 61 | 62 | ); 63 | } 64 | } 65 | 66 | export default withStyles(styles)(Filter); 67 | -------------------------------------------------------------------------------- /webapp/components/general/GridLayout.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Grid from '@material-ui/core/Grid'; 3 | import Card from '@material-ui/core/Card'; 4 | import CardContent from '@material-ui/core/CardContent'; 5 | 6 | export default function GridLayout ({ children, className = '' }) { 7 | // left-hand-side-top - left-hand-side-bottom - right-hand-side - others 8 | const [lhst, lhsb, rhs, ...others] = children; 9 | return ( 10 |
11 | 12 | 13 | 14 | 15 | 16 | {lhst} 17 | {lhsb} 18 | 19 | 20 | 21 | 22 | 23 | { rhs 24 | ? ( 25 | 26 | 27 | 28 | {[rhs]} 29 | 30 | 31 | 32 | ) : ''} 33 | 34 | {others} 35 |
36 | 37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /webapp/components/general/Loader.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | makeStyles, 4 | CircularProgress, 5 | } from '@material-ui/core'; 6 | import { 7 | fontColor, 8 | primaryColor, 9 | } from '../../theme'; 10 | 11 | const useStyles = makeStyles((theme) => ({ 12 | root: { 13 | position: 'relative', 14 | marginBottom: theme.spacing(1), 15 | }, 16 | bottom: { 17 | color: fontColor, 18 | }, 19 | top: { 20 | color: primaryColor, 21 | animationDuration: '550ms', 22 | position: 'absolute', 23 | left: 0, 24 | }, 25 | circle: { 26 | strokeLinecap: 'round', 27 | }, 28 | })); 29 | 30 | const CircularLoader = () => { 31 | const classes = useStyles(); 32 | 33 | return ( 34 |
35 | 42 | 52 |
53 | ); 54 | }; 55 | 56 | export default CircularLoader; 57 | -------------------------------------------------------------------------------- /webapp/components/general/NetPyNEAddNew.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import ContentAdd from '@material-ui/icons/Add'; 3 | import Fab from '@material-ui/core/Fab'; 4 | import { withStyles } from '@material-ui/core/styles'; 5 | import Tooltip from './Tooltip'; 6 | 7 | const styles = ({ spacing, palette }) => ({ plus: { color: palette.common.white } }); 8 | 9 | class NetPyNEAddNew extends React.Component { 10 | constructor (props) { 11 | super(props); 12 | this.state = {}; 13 | this.handleClick = this.handleClick.bind(this); 14 | } 15 | 16 | handleClick (event) { 17 | if (this.props.handleClick) { 18 | event.stopPropagation(); 19 | this.props.handleClick(); 20 | } 21 | } 22 | 23 | render () { 24 | const { classes, title } = this.props; 25 | return ( 26 | 27 | 35 | 36 | 37 | 38 | 39 | ); 40 | } 41 | } 42 | 43 | export default withStyles(styles)(NetPyNEAddNew); 44 | -------------------------------------------------------------------------------- /webapp/components/general/NetPyNEHome.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { makeStyles } from '@material-ui/core/styles'; 3 | import Tooltip from './Tooltip'; 4 | 5 | import { ArrowRightIcon } from './NetPyNEIcons'; 6 | 7 | const useStyles = makeStyles(({ spacing, palette }) => ({ 8 | home: { }, 9 | root: { 10 | display: 'flex', 11 | alignItems: 'center', 12 | }, 13 | })); 14 | 15 | export default ({ handleClick, selection }) => { 16 | const classes = useStyles(); 17 | 18 | return ( 19 |
20 | 21 |
{ 23 | event.stopPropagation(); 24 | handleClick(); 25 | }} 26 | > 27 | 28 |
29 |
30 | 31 | 32 |
33 | ); 34 | }; 35 | -------------------------------------------------------------------------------- /webapp/components/general/NetPyNETextField.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import TextField from '@material-ui/core/TextField'; 3 | import { withStyles } from '@material-ui/core/styles'; 4 | 5 | const styles = ({ spacing, palette }) => ({ 6 | home: { }, 7 | root: { 8 | display: 'flex', 9 | alignItems: 'center', 10 | }, 11 | }); 12 | 13 | class NetPyNETextField extends React.Component { 14 | render() { 15 | const { label, ...rest } = this.props; 16 | 17 | return ( 18 | 22 | ); 23 | } 24 | } 25 | 26 | export default withStyles(styles)(NetPyNETextField); -------------------------------------------------------------------------------- /webapp/components/general/PlotViewer.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactResizeDetector from 'react-resize-detector'; 3 | import HTMLViewer from './HTMLViewer'; 4 | const PlotViewer = ({ key, id, method }) => { 5 | const data = window.plotCache[id]; 6 | if (method.plotMethod.startsWith('iplot')) { 7 | return ( 8 | 9 |
19 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /webapp/tests/utilities/netpyne-server-status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | iterations=1 3 | Test () { 4 | request_cmd="$(curl -i -o - --silent -X GET --header 'Accept: application/json' --header 'Authorization: _your_auth_code==' 'http://localhost:8888/geppetto')" 5 | http_status=$(echo "$request_cmd" | grep HTTP | awk '{print $2}') 6 | echo $http_status 7 | if [ "$http_status" == "200" ]; then 8 | echo "$(date) - connected successfully!" 9 | else 10 | if [ "$iterations" == "200" ]; then 11 | exit 0 12 | else 13 | echo "Waiting for docker to finish building."; 14 | iterations=$((iterations+1)) 15 | sleep 1 16 | Test 17 | fi 18 | fi 19 | } 20 | 21 | Test 22 | -------------------------------------------------------------------------------- /webapp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./dist/", 4 | "sourceMap": true, 5 | "noImplicitAny": false, 6 | "module": "commonjs", 7 | "target": "es2017", 8 | "stripInternal":true, 9 | "skipLibCheck": true, 10 | "alwaysStrict":false, 11 | "forceConsistentCasingInFileNames": true, 12 | "noImplicitReturns": false, 13 | "strict": false, 14 | "noUnusedLocals": false, 15 | "jsx": "react", 16 | "types": [] 17 | }, 18 | "include": [ 19 | "./components/layout/*", "./node_modules/@geppettoengine/geppetto-client/js/components/interface/flexLayout2/src/**/*", "./@geppettoengine/geppetto-client/js/components/interface/flexLayout2/examples/demo/*" 20 | ], 21 | "exclude": [ 22 | "node_modules" 23 | ] 24 | } -------------------------------------------------------------------------------- /webapp/webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | const webpackBaseConfig = require('./webpack.config.js'); 2 | 3 | const extended = webpackBaseConfig(); 4 | 5 | extended.devServer = { 6 | progress: false, 7 | port: 8081, 8 | inline: true, 9 | publicPath: '/geppetto/build', 10 | proxy: [ 11 | { 12 | path: '/', 13 | target: 'http://localhost:8888', 14 | }, 15 | { 16 | path: '/org.geppetto.frontend', 17 | target: 'ws://localhost:8888', 18 | ws: true, 19 | }, 20 | { 21 | path: '/notebooks', 22 | target: 'http://localhost:8888', 23 | }, 24 | { 25 | path: '/api', 26 | target: 'http://localhost:8888', 27 | }, 28 | { 29 | path: '/api/kernels', 30 | target: 'ws://localhost:8888', 31 | ws: true, 32 | }, 33 | { 34 | path: '/static', 35 | target: 'http://localhost:8888', 36 | }, 37 | { 38 | path: '/custom', 39 | target: 'http://localhost:8888', 40 | }, 41 | 42 | { 43 | path: '/nbextensions', 44 | target: 'http://localhost:8888', 45 | }, 46 | ], 47 | }; 48 | 49 | extended.optimization = { 50 | ...extended.optimization, 51 | removeAvailableModules: false, 52 | removeEmptyChunks: false, 53 | }; 54 | 55 | extended.devtool = 'source-map'; 56 | 57 | module.exports = extended; 58 | -------------------------------------------------------------------------------- /webapp/yalc.lock: -------------------------------------------------------------------------------- 1 | { 2 | "version": "v1", 3 | "packages": { 4 | "@metacell/geppetto-meta-client": { 5 | "signature": "f8253da1d7c680b60db9b67c025a708e", 6 | "file": true 7 | }, 8 | "@metacell/geppetto-meta-core": { 9 | "signature": "6035c7ab1c09f88d7b16592bdf33b55a", 10 | "file": true 11 | }, 12 | "@metacell/geppetto-meta-ui": { 13 | "signature": "51d3ea402e9575eb4ea5d3ca61b157e1", 14 | "file": true 15 | } 16 | } 17 | } --------------------------------------------------------------------------------