Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNS 24 - #830

Merged
merged 8 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions netpyne_ui/netpyne_geppetto.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,9 @@ def simulateNetPyNEModelInGeppetto(self, args):
use_prev_inst = args.get('usePrevInst', False)
sim_id = args.get('simId', 0)
try:
self.validate_netParams()
# Note this has been commented for CNS 24 since some models were failing
# there is a discussion about making this non blocker, to follow up with Salva and Padraig
# self.validate_netParams()

experiment = experiments.get_current()
if experiment:
Expand Down Expand Up @@ -805,7 +807,9 @@ def deleteModel(self, modelParams):
return utils.getJSONReply()

def instantiateNetPyNEModel(self):
self.validate_netParams()
# Note this has been commented for CNS 24 since some models were failing
# there is a discussion about making this non blocker, to follow up with Salva and Padraig
# self.validate_netParams()
with redirect_stdout(sys.__stdout__):
saveData = sim.allSimData if hasattr(sim, 'allSimData') and 'spkt' in sim.allSimData.keys() and len(
sim.allSimData['spkt']) > 0 else False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export default class NetPyNEConnectivityRule extends React.Component {
};
}

UNSAFE_componentWillReceiveProps (nextProps) {
this.setState({ currentName: nextProps.name });
}

handleRenameChange = (event) => {
const storedValue = this.props.name;
const newValue = Utils.nameValidation(event.target.value);
Expand Down Expand Up @@ -60,19 +64,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
}
};

triggerUpdate (updateMethod) {
// common strategy when triggering processing of a value change, delay it, every time there is a change we reset
// eslint-disable-next-line eqeqeq
if (this.updateTimer !== undefined) {
clearTimeout(this.updateTimer);
}
this.updateTimer = setTimeout(updateMethod, 1000);
}

select = (index, sectionId) => this.setState({
selectedIndex: index,
sectionId,
});
handleChange = (event, index, values) => this.setState({ values });

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

select = (index, sectionId) => this.setState({
selectedIndex: index,
sectionId,
});

triggerUpdate (updateMethod) {
// common strategy when triggering processing of a value change, delay it, every time there is a change we reset
// eslint-disable-next-line eqeqeq
if (this.updateTimer !== undefined) {
clearTimeout(this.updateTimer);
}
this.updateTimer = setTimeout(updateMethod, 1000);
}

postProcessMenuItems (pythonData, selected) {
return pythonData.map((name) => (
<MenuItem
Expand All @@ -99,10 +105,6 @@ export default class NetPyNEConnectivityRule extends React.Component {
));
}

UNSAFE_componentWillReceiveProps (nextProps) {
this.setState({ currentName: nextProps.name });
}

render () {
const dialogPop = this.state.errorMessage !== undefined ? (
<Dialog open style={{ whiteSpace: 'pre-wrap' }}>
Expand Down Expand Up @@ -445,6 +447,4 @@ export default class NetPyNEConnectivityRule extends React.Component {
</div>
);
}

handleChange = (event, index, values) => this.setState({ values });
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ export default class NetPyNEConnectivityRules extends Component {
}

componentDidUpdate (prevProps, prevState) {
if (this.props.commands !== prevProps.commands)
if (this.props.commands !== prevProps.commands) {
this.forceUpdate();
}
// 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
const newConnectivityRuleName = this.hasSelectedConnectivityRuleBeenRenamed(
prevState,
Expand Down
Loading