Skip to content

Commit 89785f0

Browse files
authored
Merge pull request #150 from MetaCell/feature/147
Feature/147
2 parents a9955da + 8a194a3 commit 89785f0

100 files changed

Lines changed: 2414 additions & 2430 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

k8s/cf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ steps:
117117

118118
debug:
119119
enabled: false
120-
image: 'codefresh/cfstep-helm:2.12.2'
120+
image: 'codefresh/cfstep-helm:2.15.2'
121121
title: Installing chart
122122
stage: deploy
123123
environment:

utilities/install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def main(argv):
7171
clone_repo(project='openworm',
7272
repo_name='geppetto-client',
7373
folder='geppetto-client',
74-
default_branch='feature/178',
74+
default_branch='feature/269',
7575
cwdp='webapp/',
7676
recursive=False,
7777
)

webapp/.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ module.exports = {
33
"./node_modules/@geppettoengine/geppetto-client/.eslintrc.js",
44
"plugin:jest/recommended"
55
],
6+
rules: {
7+
'multiline-comment-style': 0,
8+
},
69
plugins: ["jest"],
710
globals: {
811
page: true,

webapp/components/NetPyNE.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import {
55
LayoutManager,
66
Drawer
77
} from "netpyne/components";
8-
8+
import Splash from './general/Splash'
99
import { withStyles } from '@material-ui/core/styles'
1010
import Utils from '../Utils';
11-
const styles = ({ zIndex, palette, spacing }) => ({
11+
const styles = ({ zIndex }) => ({
1212
root: { height: '100%', overflow: 'hidden' },
1313
container: {
1414
height: "100%",
@@ -17,7 +17,12 @@ const styles = ({ zIndex, palette, spacing }) => ({
1717
flexDirection: "column"
1818
},
1919
topbar: { position: "relative", zIndex: zIndex.drawer + 1 },
20-
content: { flexGrow:1, display: 'flex', flexDirection: 'row', position: 'relative' }
20+
content: {
21+
flexGrow:1,
22+
display: 'flex',
23+
flexDirection: 'row',
24+
position: 'relative'
25+
}
2126
});
2227

2328
import { EDIT_WIDGETS, PYTHON_CONSOLE_WIDGET, WidgetStatus } from '../constants'
@@ -47,11 +52,12 @@ class NetPyNE extends React.Component {
4752
GEPPETTO.Manager.loadExperiment(1, [], []);
4853
Utils.execPythonMessage('from netpyne_ui.netpyne_geppetto import netpyne_geppetto');
4954
Utils.evalPythonMessage('netpyne_geppetto.getData',[]).then(response => {
55+
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, "LOADING NETPYNE-UI");
5056
const data = Utils.convertToJSON(response);
5157
this.addMetadataToWindow(data);
52-
this.props.modelLoaded();
5358
this.props.setWidgets(EDIT_WIDGETS);
54-
GEPPETTO.trigger("spinner:hide");
59+
this.props.modelLoaded();
60+
GEPPETTO.trigger(GEPPETTO.Events.Hide_spinner);
5561
})
5662

5763
});

webapp/components/definition/cellRules/NetPyNECellRule.js

Lines changed: 78 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import MenuItem from '@material-ui/core/MenuItem';
33
import TextField from '@material-ui/core/TextField';
44

55
import Button from '@material-ui/core/Button';
6-
6+
import Box from '@material-ui/core/Box'
77
import Dialog from '@material-ui/core/Dialog/Dialog';
88

99
import DialogActions from '@material-ui/core/DialogActions';
@@ -13,8 +13,10 @@ import DialogTitle from '@material-ui/core/DialogTitle';
1313

1414
import { NetPyNESelectField, NetPyNEField, NetPyNECoordsRange } from 'netpyne/components';
1515
import Utils from '../../../Utils';
16+
import ExpansionPanel from '../../general/ExpansionPanel'
17+
import { withStyles } from "@material-ui/core/styles"
1618

17-
export default class NetPyNECellRule extends React.Component {
19+
class NetPyNECellRule extends React.Component {
1820

1921
constructor (props) {
2022
super(props);
@@ -68,7 +70,7 @@ export default class NetPyNECellRule extends React.Component {
6870
}
6971

7072
render () {
71-
73+
const { classes } = this.props
7274
var dialogPop = (this.state.errorMessage != undefined ? (
7375
<Dialog
7476
open={true}
@@ -92,85 +94,94 @@ export default class NetPyNECellRule extends React.Component {
9294
)
9395
return (
9496
<div>
95-
<div>
97+
<div className={classes.root}>
9698

9799
<TextField
100+
variant="filled"
98101
onChange={this.handleRenameChange}
99102
value={this.state.currentName}
100103
disabled={this.renaming}
101-
label="The name of the cell rule"
102-
className={"netpyneField"}
104+
label="The name of the cell type"
103105
id={"cellRuleName"}
104-
style={{ marginTop: 8 }}
105106
/>
106107

107-
<div style={{ float: 'left', marginTop: '20px' }}>
108-
<b>Conditions:</b>
109-
</div>
110-
111-
<NetPyNEField id={"netParams.cellParams.conds.cellType"} >
112-
<NetPyNESelectField
113-
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['cellType']"}
114-
method={"netpyne_geppetto.getAvailableCellTypes"}
115-
postProcessItems={this.postProcessMenuItems}
116-
multiple={true}
117-
/>
118-
</NetPyNEField>
119108

120-
<NetPyNEField id={"netParams.cellParams.conds.cellModel"} >
121-
<NetPyNESelectField
122-
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['cellModel']"}
123-
method={"netpyne_geppetto.getAvailableCellModels"}
124-
postProcessItems={this.postProcessMenuItems}
125-
multiple={true}
126-
/>
127-
</NetPyNEField>
128-
129-
<NetPyNEField id={"netParams.cellParams.conds.pop"} >
130-
<NetPyNESelectField
131-
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['pop']"}
132-
method={"netpyne_geppetto.getAvailablePops"}
133-
postProcessItems={this.postProcessMenuItems}
134-
multiple={true}
109+
<ExpansionPanel className={classes.expandable} elevation={0}>
110+
<Box mb={1}>
111+
<b>Conditions (optional):</b>
112+
</Box>
113+
114+
<NetPyNEField id={"netParams.cellParams.conds.cellModel"} >
115+
<NetPyNESelectField
116+
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['cellModel']"}
117+
method={"netpyne_geppetto.getAvailableCellModels"}
118+
postProcessItems={this.postProcessMenuItems}
119+
multiple={true}
120+
/>
121+
</NetPyNEField>
122+
123+
<NetPyNEField id={"netParams.cellParams.conds.pop"} >
124+
<NetPyNESelectField
125+
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['pop']"}
126+
method={"netpyne_geppetto.getAvailablePops"}
127+
postProcessItems={this.postProcessMenuItems}
128+
multiple={true}
129+
/>
130+
</NetPyNEField>
131+
132+
<NetPyNECoordsRange
133+
id="xRangeCellParams"
134+
name={this.state.currentName}
135+
model={'netParams.cellParams'}
136+
conds={'conds'}
137+
items={[
138+
{ value: 'x', label: 'Absolute' },
139+
{ value: 'xnorm', label: 'Normalized' }
140+
]}
135141
/>
136-
</NetPyNEField>
137-
138-
<NetPyNECoordsRange
139-
id="xRangeCellParams"
140-
name={this.state.currentName}
141-
model={'netParams.cellParams'}
142-
conds={'conds'}
143-
items={[
144-
{ value: 'x', label: 'Absolute' },
145-
{ value: 'xnorm', label: 'Normalized' }
146-
]}
147-
/>
148-
149-
<NetPyNECoordsRange
150-
id="yRangeCellParams"
151-
name={this.state.currentName}
152-
model={'netParams.cellParams'}
153-
conds={'conds'}
154-
items={[
155-
{ value: 'y', label: 'Absolute' },
156-
{ value: 'ynorm', label: 'Normalized' }
157-
]}
158-
/>
159142

160-
<NetPyNECoordsRange
161-
id="zRangeCellParams"
162-
name={this.state.currentName}
163-
model={'netParams.cellParams'}
164-
conds={'conds'}
165-
items={[
166-
{ value: 'z', label: 'Absolute' },
167-
{ value: 'znorm', label: 'Normalized' }
168-
]}
169-
/>
143+
<NetPyNECoordsRange
144+
id="yRangeCellParams"
145+
name={this.state.currentName}
146+
model={'netParams.cellParams'}
147+
conds={'conds'}
148+
items={[
149+
{ value: 'y', label: 'Absolute' },
150+
{ value: 'ynorm', label: 'Normalized' }
151+
]}
152+
/>
170153

154+
<NetPyNECoordsRange
155+
id="zRangeCellParams"
156+
name={this.state.currentName}
157+
model={'netParams.cellParams'}
158+
conds={'conds'}
159+
items={[
160+
{ value: 'z', label: 'Absolute' },
161+
{ value: 'znorm', label: 'Normalized' }
162+
]}
163+
/>
164+
165+
</ExpansionPanel>
171166
</div>
172167
{dialogPop}
173168
</div>
174169
);
175170
}
176171
}
172+
173+
174+
const styles = ({ shape, spacing }) => ({
175+
expandable: {
176+
borderRadius: shape.borderRadius,
177+
backgroundColor: 'inherit',
178+
paddingTop: spacing(2),
179+
"&::before": { content: 'unset' }
180+
},
181+
root: {
182+
display: 'flex',
183+
flexDirection: 'column'
184+
}
185+
})
186+
187+
export default withStyles(styles)(NetPyNECellRule)

webapp/components/definition/cellRules/NetPyNECellRules.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Button from '@material-ui/core/Button';
33
import ContentAdd from '@material-ui/icons/Add';
44
import NavigationMoreHoriz from '@material-ui/icons/MoreHoriz';
55
import Fab from '@material-ui/core/Fab';
6-
6+
import Icon from '@material-ui/core/Icon';
77

88
import {
99
NetPyNECellRule,
@@ -18,7 +18,7 @@ import NetPyNESection from './sections/NetPyNESection';
1818
import NetPyNEMechanism from './sections/mechanisms/NetPyNEMechanism';
1919
import NetPyNENewMechanism from './sections/mechanisms/NetPyNENewMechanism';
2020

21-
import NavigationChevronRight from '@material-ui/icons/ChevronRight';
21+
2222
import Dialog from '@material-ui/core/Dialog/Dialog';
2323

2424
import Utils from '../../../Utils';
@@ -154,10 +154,10 @@ export default class NetPyNECellRules extends React.Component {
154154
model[selectedCellRule].secs[selectedSection]['mechs'] = {};
155155
Utils.execPythonMessage('netpyne_geppetto.netParams.cellParams["' + selectedCellRule + '"]["secs"]["' + selectedSection + '"]["mechs"] = {}');
156156
}
157-
var params = {};
158157
Utils
159158
.evalPythonMessage("netpyne_geppetto.getMechParams", [mechanism])
160159
.then(response => {
160+
const params = {};
161161
response.forEach(param => params[param] = 0);
162162
Utils.execPythonMessage('netpyne_geppetto.netParams.cellParams["' + selectedCellRule + '"]["secs"]["' + selectedSection + '"]["mechs"]["' + mechanism + '"] = ' + JSON.stringify(params));
163163
})
@@ -343,7 +343,7 @@ export default class NetPyNECellRules extends React.Component {
343343
*/
344344
if (nextPage === page) {
345345
if (page === "main") {
346-
this.handleNewCellRule({ 'CellRule': { 'conds':{}, 'secs':{} } });
346+
this.handleNewCellRule({ 'CellType': { 'conds':{}, 'secs':{} } });
347347
} else if (page === "sections") {
348348
this.handleNewSection({ 'Section': { 'geom': {}, 'topol': {}, 'mechs': {} } });
349349
}
@@ -472,7 +472,7 @@ export default class NetPyNECellRules extends React.Component {
472472
switch (rule) {
473473
case 'cellRule':
474474
if (page !== 'main'){
475-
return 'CR'
475+
return 'CT'
476476
} else {
477477
return <ContentAdd style={{ color: 'white' }}/>
478478
}
@@ -653,7 +653,7 @@ export default class NetPyNECellRules extends React.Component {
653653

654654
<div>
655655
<ExpansionPanel>
656-
<div className="breadcrumby">
656+
<div className="breadcrumb">
657657
<NetPyNEHome
658658
selection={selectedCellRule}
659659
handleClick={() => this.setState({ page: 'main', selectedCellRule: undefined, selectedSection: undefined, selectedMechanism: undefined })}
@@ -670,9 +670,9 @@ export default class NetPyNECellRules extends React.Component {
670670
</Fab>
671671
</Tooltip>
672672
</div>
673-
<NavigationChevronRight
674-
className='ml-2'
675-
color='disabled'
673+
<Icon
674+
color="disabled"
675+
className="fa fa-angle-right breadcrumb-spacer"
676676
/>
677677
<div className='ml-2'>
678678
<Tooltip title={this.createTooltip('section')} placement="top">
@@ -693,9 +693,9 @@ export default class NetPyNECellRules extends React.Component {
693693

694694
</div>
695695

696-
<NavigationChevronRight
697-
className='ml-2'
698-
color='disabled'
696+
<Icon
697+
color="disabled"
698+
className="fa fa-angle-right breadcrumb-spacer"
699699
/>
700700
<NetPyNENewMechanism
701701
className="ml-2"

0 commit comments

Comments
 (0)