Skip to content

Commit 38b647d

Browse files
committed
Fix logic on single batch simulation
1 parent 898acf4 commit 38b647d

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

netpyne_ui/netpyne_geppetto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)

webapp/redux/middleware/middleware.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ const instantiateNetwork = (payload) => createSimulateBackendCall(
122122
GEPPETTO.Resources.INSTANTIATING_MODEL,
123123
);
124124

125-
const simulateNetwork = (payload) => createSimulateBackendCall(
125+
const simulateNetwork = (isBatch) => createSimulateBackendCall(
126126
NETPYNE_COMMANDS.simulateModel,
127-
payload,
127+
isBatch,
128128
'The NetPyNE model is getting simulated...',
129129
GEPPETTO.Resources.RUNNING_SIMULATION,
130130
);
@@ -185,6 +185,7 @@ export default (store) => (next) => (action) => {
185185

186186
const toNetworkCallback = (reset) => () => {
187187
switchLayoutAction(false, reset);
188+
getExperiments()
188189
next(action);
189190

190191
};
@@ -215,7 +216,7 @@ export default (store) => (next) => (action) => {
215216
const checkParametersThen = (callback, goToNetworkView = false) => {
216217
let allParams = true;
217218
const inDesignExp = store.getState().experiments?.inDesign;
218-
219+
219220
if(inDesignExp) {
220221
ExperimentsApi.getParameters()
221222
.then((params) => {
@@ -242,6 +243,7 @@ export default (store) => (next) => (action) => {
242243
}
243244
}, pythonErrorCallback);
244245
} else {
246+
next(GeppettoActions.waitData('Simulating the NetPyNE Model', GeppettoActions.layoutActions.SET_WIDGETS));
245247
callback().then(toNetworkCallback(goToNetworkView), pythonErrorCallback)
246248
}
247249

@@ -345,15 +347,13 @@ export default (store) => (next) => (action) => {
345347
break;
346348
}
347349
case CREATE_SIMULATE_NETWORK: {
348-
next(GeppettoActions.waitData('Simulating the NetPyNE Model', GeppettoActions.layoutActions.SET_WIDGETS));
350+
349351
checkParametersThen(() => simulateNetwork({ allTrials: false }))
350352

351353
break;
352354
}
353355
case SIMULATE_NETWORK: {
354-
if (!action.payload) {
355-
next(GeppettoActions.waitData('Simulating the NetPyNE Model', GeppettoActions.layoutActions.SET_WIDGETS));
356-
} else {
356+
if (action.payload) {
357357
next(GeppettoActions.activateWidget(EDIT_WIDGETS.experimentManager.id));
358358
}
359359

0 commit comments

Comments
 (0)