Skip to content

Commit f0edbbc

Browse files
authored
Merge pull request #647 from MetaCell/feature/643
Feature/643 fix 'Model' > 'Simulate Network' also instantiates the model
2 parents 3c85b0d + 2459709 commit f0edbbc

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

netpyne_ui/netpyne_geppetto.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,18 @@ def simulateNetPyNEModelInGeppetto(self, args):
305305
return self.simulate_single_model(experiment, use_prev_inst)
306306
except Exception:
307307
experiment.state = model.ExperimentState.ERROR
308-
message = ("Unknown error during simulation of Experiment. SimulationId %i" % sim_id)
308+
message = f"Unknown error during simulation of Experiment. SimulationId {sim_id}"
309309
logging.exception(message)
310-
return utils.getJSONError("Unknown error during simulation of Experiment", sys.exc_info(), { "sim_id": sim_id})
310+
# return utils.getJSONError("Unknown error during simulation of Experiment", sys.exc_info(), { "sim_id": sim_id})
311+
return utils.getJSONError("Unknown error during simulation of Experiment", sys.exc_info())
311312

312313
else:
313314
return self.simulate_single_model(use_prev_inst=use_prev_inst)
314315

315316
except Exception as e :
316-
message = ("Error while simulating the NetPyNE model: %s. SimulationId %f" % (e, sim_id))
317+
message = f"Error while simulating the NetPyNE model: {e}. SimulationId {sim_id}"
317318
logging.exception(message)
318-
return utils.getJSONError(message, sys.exc_info(), { "sim_id": sim_id})
319+
return utils.getJSONError(message, sys.exc_info())
319320

320321
def _prepare_simulation_files(self, experiment: model.Experiment = None, use_prev_inst: bool = False) -> str:
321322
"""Prepares template files and netpyne model files for a single simulation """

webapp/components/topbar/menuConfiguration.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
setTheme,
1515
} from '../../redux/actions/general';
1616
import {
17+
MODEL_STATE,
1718
TOPBAR_CONSTANTS, THEMES, TUTORIALS_LIST,
1819
} from '../../constants';
1920
import { openLaunchDialog } from '../../redux/actions/experiments';
@@ -328,7 +329,8 @@ export const getModelMenu = (props) => (
328329
? [openLaunchDialog()]
329330
// TODO: (#263) this logic causes issues by potentially simulating
330331
// old instance with modified netParams and simConfig
331-
: [props.modelState ? createAndSimulateNetwork : simulateNetwork],
332+
// : [props.modelState ? createAndSimulateNetwork : simulateNetwork],
333+
: [props.modelState === MODEL_STATE.NOT_INSTANTIATED ? createAndSimulateNetwork : simulateNetwork()],
332334
},
333335
},
334336
{

0 commit comments

Comments
 (0)