Skip to content

Commit f3ced3e

Browse files
Merge pull request #549 from MetaCell/feature/fix-experiment-manager
fix experiment manager
2 parents 9bd92f0 + 9bc2836 commit f3ced3e

36 files changed

Lines changed: 1417 additions & 1858 deletions

netpyne_ui/experiments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def edit_experiment(name: str, experiment: dict):
7474

7575
if exp.state != model.ExperimentState.DESIGN:
7676
raise ExperimentsError(
77-
f"Can only edit experiment in f{model.ExperimentState.DESIGN} state"
77+
f"Can only edit experiment in {model.ExperimentState.DESIGN} state"
7878
)
7979

8080
updated_exp = from_dict(model.Experiment, experiment)

netpyne_ui/netpyne_geppetto.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def getData(self):
9090
def getModelAsJson(self):
9191
# TODO: netpyne should offer a method asJSON (#240)
9292
# that returns the JSON model without dumping to to disk.
93-
obj = netpyne_utils.replaceFuncObj(self.netParams.__dict__)
93+
obj = netpyne_utils.replaceFuncObj({"netParams": self.netParams.__dict__, "simConfig": self.simConfig.__dict__})
9494
obj = netpyne_utils.replaceDictODict(obj)
9595
return obj
9696

@@ -218,7 +218,7 @@ def simulate_experiment_trials(self, experiment: model.Experiment):
218218
else:
219219
message = f"Experiment {experiment.name} finished, you can view the results in the Experiment Manager."
220220

221-
return utils.getJSONError(message, "")
221+
return dict(message=message)
222222

223223
def simulate_single_model(self, experiment: model.Experiment = None, use_prev_inst: bool = False):
224224
if experiment:
@@ -235,7 +235,7 @@ def simulate_single_model(self, experiment: model.Experiment = None, use_prev_in
235235
if self.run_config.asynchronous:
236236
message = "Experiment is pending! " \
237237
f"Results will be stored in your workspace at ./{os.path.join(constants.EXPERIMENTS_FOLDER, experiment.name)}"
238-
return utils.getJSONError(message, "")
238+
return dict(message=message)
239239
else:
240240
sim.load(f'{constants.MODEL_OUTPUT_FILENAME}.json')
241241
self.geppetto_model = self.model_interpreter.getGeppettoModel(sim)
@@ -374,7 +374,7 @@ def _prepare_batch_files(self, experiment: model.Experiment) -> str:
374374
exp.params = self.experiments.process_params(exp.params)
375375

376376
netParams = copy.deepcopy(self.netParams)
377-
netParams.mapping = {p.mapsTo: p.mapsTo.split('.') for p in exp.params}
377+
netParams.mapping = {p.mapsTo.replace('netParams.', ''): p.mapsTo.split('.')[1::] for p in exp.params if 'netParams' in p.mapsTo}
378378

379379
simCfg = copy.copy(self.simConfig)
380380
simCfg.saveJson = True

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"]] = param["values"]
49+
params[param["mapsTo"].replace("simConfig.", "")] = param["values"]
5050
if param["inGroup"]:
51-
grouped_params.append(param["mapsTo"])
51+
grouped_params.append(param["mapsTo"].replace("simConfig.", ""))
5252

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

netpyne_ui/templates/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ def run_sim():
5050
print("Experiment failed ...")
5151
print(e)
5252

53-
update_state(exp, "ERRROR")
53+
update_state(exp, "ERROR")
5454
sys.exit(1)

package-lock.json

Lines changed: 0 additions & 313 deletions
This file was deleted.

webapp/GeppettoConfiguration.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"embedderURL": ["/"],
77
"rootRedirect":"",
88
"noTest": false,
9+
"customSplash": "geppetto/build/static/splash.gif",
910
"extensions": {
1011
"geppetto-default/ComponentsInitialization": false,
1112
"geppetto-netpyne/ComponentsInitialization": true

0 commit comments

Comments
 (0)