Skip to content

Commit 4fa3b71

Browse files
authored
Merge pull request #567 from MetaCell/feature/566
#566 fix experiments param assigment
2 parents 5183521 + 3ba78c3 commit 4fa3b71

6 files changed

Lines changed: 54 additions & 15 deletions

File tree

netpyne_ui/__init__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
1+
import logging
2+
import sys
3+
import os
4+
15
from jupyter_geppetto.webapi import RouteManager
26
from netpyne_ui import api
7+
from netpyne_ui.constants import HERE
38
import sentry_sdk
49

510
sentry_sdk.init(
611
"https://d8bf7e40eec34cb9891f6dd8207b5e83@sentry.metacell.us/6"
712
)
813

14+
def init_eeg():
15+
import sys
16+
from netpyne_ui.constants import HERE
17+
# FIXES library asking for input to download
18+
sys.stdin = open(os.path.join(HERE, "resources/stdin.txt"),'r')
19+
from lfpykit.eegmegcalc import NYHeadModel
20+
try:
21+
NYHeadModel() # Downloads the model if does not exist
22+
except:
23+
logging.error("Error initializing the EEG head model", exc_info=True)
24+
25+
from multiprocessing import Process
26+
thread = Process(target = init_eeg)
27+
thread.start()
28+
29+
930
RouteManager.add_controller(api.NetPyNEController)
31+
32+

netpyne_ui/netpyne_geppetto.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ def __init__(self):
7575
if not simulations.local.is_running():
7676
[experiments.set_to_error(e) for e in running_exps]
7777

78+
# sys.stdin = open(os.path.join(constants.HERE, "stdin.txt"),'r') # FIXES library asking for input to download -- eg lfpykit models
79+
80+
# from ipykernel import kernelbase
81+
82+
# def raw_input(self, prompt=''):
83+
# return "y"
84+
# kernelbase.Kernel.raw_input = raw_input
85+
86+
# from lfpykit.eegmegcalc import NYHeadModel
87+
# NYHeadModel()
7888

7989
def getData(self):
8090
return {

netpyne_ui/resources/stdin.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
y
2+
y
3+
y
4+
y
5+
y

netpyne_ui/templates/batch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ def run_batch(experiment):
4646
params = specs.ODict()
4747
grouped_params = []
4848
for param in experiment["params"]:
49-
params[param["mapsTo"].replace("simConfig.", "")] = param["values"]
49+
params[param["mapsTo"].replace("netParams.", "")] = param["values"]
5050
if param["inGroup"]:
51-
grouped_params.append(param["mapsTo"].replace("simConfig.", ""))
51+
grouped_params.append(param["mapsTo"].replace("netParams.", ""))
5252

5353
with open("netParams.json", "r") as f:
5454
net_params = json.load(f)

webapp/components/topbar/dialogs/LaunchDialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ const LaunchDialog = (props) => {
317317
<Box className="wrap">
318318
<img src={value === LAUNCH_MODAL.experimentState ? experimentSelected : experimentUnselected} alt="completeExperiment" />
319319
<Typography>
320-
All Trials (
320+
All Conditions (
321321
{numberOfTrials}
322322
)
323323
</Typography>

webapp/constants.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -571,34 +571,35 @@ export const EDIT_WIDGETS = {
571571
model: 'netParams.stimTargetParams',
572572
},
573573
},
574-
analysis: {
575-
id: 'analysis',
576-
name: 'Plot Settings',
577-
model: 'simConfig.analysis',
574+
rxd: {
575+
id: 'rxd',
576+
name: 'Reaction-Diffusion',
577+
model: 'netParams.rxdParams',
578578
status: WidgetStatus.HIDDEN,
579579
hideOnClose: true,
580-
component: 'analysis',
580+
component: 'rxd',
581581
panelName: TOP_PANEL,
582582
enableRename: false,
583583
pos: 6,
584584
props: {
585-
model: 'simConfig.analysis',
585+
model: 'netParams.rxdParams',
586586
},
587587
},
588-
rxd: {
589-
id: 'rxd',
590-
name: 'Rxd Configuration',
591-
model: 'netParams.rxdParams',
588+
analysis: {
589+
id: 'analysis',
590+
name: 'Plot Settings',
591+
model: 'simConfig.analysis',
592592
status: WidgetStatus.HIDDEN,
593593
hideOnClose: true,
594-
component: 'rxd',
594+
component: 'analysis',
595595
panelName: TOP_PANEL,
596596
enableRename: false,
597597
pos: 7,
598598
props: {
599-
model: 'netParams.rxdParams',
599+
model: 'simConfig.analysis',
600600
},
601601
},
602+
602603
simConfig: {
603604
id: 'simConfig',
604605
name: 'Configuration',

0 commit comments

Comments
 (0)