Skip to content

Commit 783dc53

Browse files
authored
Merge pull request #830 from MetaCell/feature/netpyne-217
CNS 24 -
2 parents 28c50a6 + c5f884a commit 783dc53

File tree

8 files changed

+505
-445
lines changed

8 files changed

+505
-445
lines changed

netpyne_ui/netpyne_geppetto.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,9 @@ def simulateNetPyNEModelInGeppetto(self, args):
330330
use_prev_inst = args.get('usePrevInst', False)
331331
sim_id = args.get('simId', 0)
332332
try:
333-
self.validate_netParams()
333+
# Note this has been commented for CNS 24 since some models were failing
334+
# there is a discussion about making this non blocker, to follow up with Salva and Padraig
335+
# self.validate_netParams()
334336

335337
experiment = experiments.get_current()
336338
if experiment:
@@ -805,7 +807,9 @@ def deleteModel(self, modelParams):
805807
return utils.getJSONReply()
806808

807809
def instantiateNetPyNEModel(self):
808-
self.validate_netParams()
810+
# Note this has been commented for CNS 24 since some models were failing
811+
# there is a discussion about making this non blocker, to follow up with Salva and Padraig
812+
# self.validate_netParams()
809813
with redirect_stdout(sys.__stdout__):
810814
saveData = sim.allSimData if hasattr(sim, 'allSimData') and 'spkt' in sim.allSimData.keys() and len(
811815
sim.allSimData['spkt']) > 0 else False

webapp/components/definition/connectivity/NetPyNEConnectivityRule.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ export default class NetPyNEConnectivityRule extends React.Component {
3232
};
3333
}
3434

35+
UNSAFE_componentWillReceiveProps (nextProps) {
36+
this.setState({ currentName: nextProps.name });
37+
}
38+
3539
handleRenameChange = (event) => {
3640
const storedValue = this.props.name;
3741
const newValue = Utils.nameValidation(event.target.value);
@@ -60,19 +64,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
6064
}
6165
};
6266

63-
triggerUpdate (updateMethod) {
64-
// common strategy when triggering processing of a value change, delay it, every time there is a change we reset
65-
// eslint-disable-next-line eqeqeq
66-
if (this.updateTimer !== undefined) {
67-
clearTimeout(this.updateTimer);
68-
}
69-
this.updateTimer = setTimeout(updateMethod, 1000);
70-
}
71-
72-
select = (index, sectionId) => this.setState({
73-
selectedIndex: index,
74-
sectionId,
75-
});
67+
handleChange = (event, index, values) => this.setState({ values });
7668

7769
getBottomNavigationAction (index, sectionId, label, icon, id) {
7870
return (
@@ -86,6 +78,20 @@ export default class NetPyNEConnectivityRule extends React.Component {
8678
);
8779
}
8880

81+
select = (index, sectionId) => this.setState({
82+
selectedIndex: index,
83+
sectionId,
84+
});
85+
86+
triggerUpdate (updateMethod) {
87+
// common strategy when triggering processing of a value change, delay it, every time there is a change we reset
88+
// eslint-disable-next-line eqeqeq
89+
if (this.updateTimer !== undefined) {
90+
clearTimeout(this.updateTimer);
91+
}
92+
this.updateTimer = setTimeout(updateMethod, 1000);
93+
}
94+
8995
postProcessMenuItems (pythonData, selected) {
9096
return pythonData.map((name) => (
9197
<MenuItem
@@ -99,10 +105,6 @@ export default class NetPyNEConnectivityRule extends React.Component {
99105
));
100106
}
101107

102-
UNSAFE_componentWillReceiveProps (nextProps) {
103-
this.setState({ currentName: nextProps.name });
104-
}
105-
106108
render () {
107109
const dialogPop = this.state.errorMessage !== undefined ? (
108110
<Dialog open style={{ whiteSpace: 'pre-wrap' }}>
@@ -445,6 +447,4 @@ export default class NetPyNEConnectivityRule extends React.Component {
445447
</div>
446448
);
447449
}
448-
449-
handleChange = (event, index, values) => this.setState({ values });
450450
}

webapp/components/definition/connectivity/NetPyNEConnectivityRules.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ export default class NetPyNEConnectivityRules extends Component {
103103
}
104104

105105
componentDidUpdate (prevProps, prevState) {
106-
if (this.props.commands !== prevProps.commands)
106+
if (this.props.commands !== prevProps.commands) {
107107
this.forceUpdate();
108+
}
108109
// we need to check if any of the three entities have been renamed and if that's the case change the state for the selection variable
109110
const newConnectivityRuleName = this.hasSelectedConnectivityRuleBeenRenamed(
110111
prevState,

0 commit comments

Comments
 (0)