Skip to content

Commit cf81c8a

Browse files
committed
#496 mitigate kernel autorestart
1 parent 5fdc39e commit cf81c8a

4 files changed

Lines changed: 20 additions & 6 deletions

File tree

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ multimethod==1.3
4444
nbconvert==5.6.1
4545
nbformat==5.0.6
4646
neuromllite==0.1.9
47-
netpyne==1.0.0.2
47+
netpyne==1.0.2.1
4848
NEURON==7.8.1.1
4949
numpy==1.18.5
5050
oauthlib==3.0.1

webapp/components/NetPyNE.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,18 @@ class NetPyNE extends React.Component {
106106
}
107107

108108
openPythonCallDialog (event) {
109-
this.props.pythonCallErrorDialogBox({
110-
errorMessage: event.evalue,
111-
errorDetails: event.traceback.join('\n'),
112-
});
109+
if (event?.evalue && event?.traceback) {
110+
this.props.geppettoError();
111+
this.props.pythonCallErrorDialogBox({
112+
errorMessage: event.evalue,
113+
errorDetails: event.traceback.join('\n'),
114+
});
115+
} else {
116+
this.props.pythonCallErrorDialogBox({
117+
errorMessage: event.data.response.evalue,
118+
errorDetails: event.data.response.traceback.join('\n'),
119+
});
120+
}
113121
}
114122

115123
addMetadataToWindow (data) {

webapp/components/general/GeppettoJupyterUtils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ const handle_output = function (data) {
66
console.log(data.content.evalue.trim());
77
console.error('ERROR while executing a Python command:');
88
console.error(data.content.traceback);
9+
if (data.content.evalue === "name 'utils' is not defined") {
10+
execPythonMessage('from jupyter_geppetto import synchronization, utils, synchronization as jupyter_geppetto');
11+
execPythonMessage('from netpyne_ui.netpyne_geppetto import netpyne_geppetto');
12+
}
13+
// dispatch(GeppettoActions.geppettoError);
914
GEPPETTO.trigger(GEPPETTO.Events.Error_while_exec_python_command, data.content);
10-
GEPPETTO.trigger(GEPPETTO.Events.Hide_spinner);
1115
break;
1216
case 'execute_result':
1317
try {

webapp/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
updateWidget,
1010
newWidget,
1111
maximiseWidget,
12+
hideSpinner,
1213
} from '@metacell/geppetto-meta-client/common/actions';
1314
import { TOPBAR_CONSTANTS } from '../constants';
1415
import PythonControlledCapability from './general/PythonControlledCapability';
@@ -158,6 +159,7 @@ export const NetPyNE = connect(
158159
setDefaultWidgets: () => dispatch(setDefaultWidgets),
159160
modelLoaded: () => dispatch(modelLoaded),
160161
getExperiments: () => dispatch(getExperiments()),
162+
geppettoError: () => dispatch(hideSpinner()),
161163
}),
162164
)(_NetPyNE);
163165

0 commit comments

Comments
 (0)