Skip to content
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
2 changes: 1 addition & 1 deletion k8s/cf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ steps:

debug:
enabled: false
image: 'codefresh/cfstep-helm:2.12.2'
image: 'codefresh/cfstep-helm:2.15.2'
title: Installing chart
stage: deploy
environment:
Expand Down
2 changes: 1 addition & 1 deletion utilities/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def main(argv):
clone_repo(project='openworm',
repo_name='geppetto-client',
folder='geppetto-client',
default_branch='feature/178',
default_branch='feature/269',
cwdp='webapp/',
recursive=False,
)
Expand Down
3 changes: 3 additions & 0 deletions webapp/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ module.exports = {
"./node_modules/@geppettoengine/geppetto-client/.eslintrc.js",
"plugin:jest/recommended"
],
rules: {
'multiline-comment-style': 0,
},
plugins: ["jest"],
globals: {
page: true,
Expand Down
16 changes: 11 additions & 5 deletions webapp/components/NetPyNE.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
LayoutManager,
Drawer
} from "netpyne/components";

import Splash from './general/Splash'
import { withStyles } from '@material-ui/core/styles'
import Utils from '../Utils';
const styles = ({ zIndex, palette, spacing }) => ({
const styles = ({ zIndex }) => ({
root: { height: '100%', overflow: 'hidden' },
container: {
height: "100%",
Expand All @@ -17,7 +17,12 @@ const styles = ({ zIndex, palette, spacing }) => ({
flexDirection: "column"
},
topbar: { position: "relative", zIndex: zIndex.drawer + 1 },
content: { flexGrow:1, display: 'flex', flexDirection: 'row', position: 'relative' }
content: {
flexGrow:1,
display: 'flex',
flexDirection: 'row',
position: 'relative'
}
});

import { EDIT_WIDGETS, PYTHON_CONSOLE_WIDGET, WidgetStatus } from '../constants'
Expand Down Expand Up @@ -47,11 +52,12 @@ class NetPyNE extends React.Component {
GEPPETTO.Manager.loadExperiment(1, [], []);
Utils.execPythonMessage('from netpyne_ui.netpyne_geppetto import netpyne_geppetto');
Utils.evalPythonMessage('netpyne_geppetto.getData',[]).then(response => {
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, "LOADING NETPYNE-UI");
const data = Utils.convertToJSON(response);
this.addMetadataToWindow(data);
this.props.modelLoaded();
this.props.setWidgets(EDIT_WIDGETS);
GEPPETTO.trigger("spinner:hide");
this.props.modelLoaded();
GEPPETTO.trigger(GEPPETTO.Events.Hide_spinner);
})

});
Expand Down
145 changes: 78 additions & 67 deletions webapp/components/definition/cellRules/NetPyNECellRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import MenuItem from '@material-ui/core/MenuItem';
import TextField from '@material-ui/core/TextField';

import Button from '@material-ui/core/Button';

import Box from '@material-ui/core/Box'
import Dialog from '@material-ui/core/Dialog/Dialog';

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

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

export default class NetPyNECellRule extends React.Component {
class NetPyNECellRule extends React.Component {

constructor (props) {
super(props);
Expand Down Expand Up @@ -68,7 +70,7 @@ export default class NetPyNECellRule extends React.Component {
}

render () {

const { classes } = this.props
var dialogPop = (this.state.errorMessage != undefined ? (
<Dialog
open={true}
Expand All @@ -92,85 +94,94 @@ export default class NetPyNECellRule extends React.Component {
)
return (
<div>
<div>
<div className={classes.root}>

<TextField
variant="filled"
onChange={this.handleRenameChange}
value={this.state.currentName}
disabled={this.renaming}
label="The name of the cell rule"
className={"netpyneField"}
label="The name of the cell type"
id={"cellRuleName"}
style={{ marginTop: 8 }}
/>

<div style={{ float: 'left', marginTop: '20px' }}>
<b>Conditions:</b>
</div>

<NetPyNEField id={"netParams.cellParams.conds.cellType"} >
<NetPyNESelectField
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['cellType']"}
method={"netpyne_geppetto.getAvailableCellTypes"}
postProcessItems={this.postProcessMenuItems}
multiple={true}
/>
</NetPyNEField>

<NetPyNEField id={"netParams.cellParams.conds.cellModel"} >
<NetPyNESelectField
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['cellModel']"}
method={"netpyne_geppetto.getAvailableCellModels"}
postProcessItems={this.postProcessMenuItems}
multiple={true}
/>
</NetPyNEField>

<NetPyNEField id={"netParams.cellParams.conds.pop"} >
<NetPyNESelectField
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['pop']"}
method={"netpyne_geppetto.getAvailablePops"}
postProcessItems={this.postProcessMenuItems}
multiple={true}
<ExpansionPanel className={classes.expandable} elevation={0}>
<Box mb={1}>
<b>Conditions (optional):</b>
</Box>

<NetPyNEField id={"netParams.cellParams.conds.cellModel"} >
<NetPyNESelectField
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['cellModel']"}
method={"netpyne_geppetto.getAvailableCellModels"}
postProcessItems={this.postProcessMenuItems}
multiple={true}
/>
</NetPyNEField>

<NetPyNEField id={"netParams.cellParams.conds.pop"} >
<NetPyNESelectField
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['pop']"}
method={"netpyne_geppetto.getAvailablePops"}
postProcessItems={this.postProcessMenuItems}
multiple={true}
/>
</NetPyNEField>

<NetPyNECoordsRange
id="xRangeCellParams"
name={this.state.currentName}
model={'netParams.cellParams'}
conds={'conds'}
items={[
{ value: 'x', label: 'Absolute' },
{ value: 'xnorm', label: 'Normalized' }
]}
/>
</NetPyNEField>

<NetPyNECoordsRange
id="xRangeCellParams"
name={this.state.currentName}
model={'netParams.cellParams'}
conds={'conds'}
items={[
{ value: 'x', label: 'Absolute' },
{ value: 'xnorm', label: 'Normalized' }
]}
/>

<NetPyNECoordsRange
id="yRangeCellParams"
name={this.state.currentName}
model={'netParams.cellParams'}
conds={'conds'}
items={[
{ value: 'y', label: 'Absolute' },
{ value: 'ynorm', label: 'Normalized' }
]}
/>

<NetPyNECoordsRange
id="zRangeCellParams"
name={this.state.currentName}
model={'netParams.cellParams'}
conds={'conds'}
items={[
{ value: 'z', label: 'Absolute' },
{ value: 'znorm', label: 'Normalized' }
]}
/>
<NetPyNECoordsRange
id="yRangeCellParams"
name={this.state.currentName}
model={'netParams.cellParams'}
conds={'conds'}
items={[
{ value: 'y', label: 'Absolute' },
{ value: 'ynorm', label: 'Normalized' }
]}
/>

<NetPyNECoordsRange
id="zRangeCellParams"
name={this.state.currentName}
model={'netParams.cellParams'}
conds={'conds'}
items={[
{ value: 'z', label: 'Absolute' },
{ value: 'znorm', label: 'Normalized' }
]}
/>

</ExpansionPanel>
</div>
{dialogPop}
</div>
);
}
}


const styles = ({ shape, spacing }) => ({
expandable: {
borderRadius: shape.borderRadius,
backgroundColor: 'inherit',
paddingTop: spacing(2),
"&::before": { content: 'unset' }
},
root: {
display: 'flex',
flexDirection: 'column'
}
})

export default withStyles(styles)(NetPyNECellRule)
24 changes: 12 additions & 12 deletions webapp/components/definition/cellRules/NetPyNECellRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Button from '@material-ui/core/Button';
import ContentAdd from '@material-ui/icons/Add';
import NavigationMoreHoriz from '@material-ui/icons/MoreHoriz';
import Fab from '@material-ui/core/Fab';

import Icon from '@material-ui/core/Icon';

import {
NetPyNECellRule,
Expand All @@ -18,7 +18,7 @@ import NetPyNESection from './sections/NetPyNESection';
import NetPyNEMechanism from './sections/mechanisms/NetPyNEMechanism';
import NetPyNENewMechanism from './sections/mechanisms/NetPyNENewMechanism';

import NavigationChevronRight from '@material-ui/icons/ChevronRight';

import Dialog from '@material-ui/core/Dialog/Dialog';

import Utils from '../../../Utils';
Expand Down Expand Up @@ -154,10 +154,10 @@ export default class NetPyNECellRules extends React.Component {
model[selectedCellRule].secs[selectedSection]['mechs'] = {};
Utils.execPythonMessage('netpyne_geppetto.netParams.cellParams["' + selectedCellRule + '"]["secs"]["' + selectedSection + '"]["mechs"] = {}');
}
var params = {};
Utils
.evalPythonMessage("netpyne_geppetto.getMechParams", [mechanism])
.then(response => {
const params = {};
response.forEach(param => params[param] = 0);
Utils.execPythonMessage('netpyne_geppetto.netParams.cellParams["' + selectedCellRule + '"]["secs"]["' + selectedSection + '"]["mechs"]["' + mechanism + '"] = ' + JSON.stringify(params));
})
Expand Down Expand Up @@ -343,7 +343,7 @@ export default class NetPyNECellRules extends React.Component {
*/
if (nextPage === page) {
if (page === "main") {
this.handleNewCellRule({ 'CellRule': { 'conds':{}, 'secs':{} } });
this.handleNewCellRule({ 'CellType': { 'conds':{}, 'secs':{} } });
} else if (page === "sections") {
this.handleNewSection({ 'Section': { 'geom': {}, 'topol': {}, 'mechs': {} } });
}
Expand Down Expand Up @@ -472,7 +472,7 @@ export default class NetPyNECellRules extends React.Component {
switch (rule) {
case 'cellRule':
if (page !== 'main'){
return 'CR'
return 'CT'
} else {
return <ContentAdd style={{ color: 'white' }}/>
}
Expand Down Expand Up @@ -653,7 +653,7 @@ export default class NetPyNECellRules extends React.Component {

<div>
<ExpansionPanel>
<div className="breadcrumby">
<div className="breadcrumb">
<NetPyNEHome
selection={selectedCellRule}
handleClick={() => this.setState({ page: 'main', selectedCellRule: undefined, selectedSection: undefined, selectedMechanism: undefined })}
Expand All @@ -670,9 +670,9 @@ export default class NetPyNECellRules extends React.Component {
</Fab>
</Tooltip>
</div>
<NavigationChevronRight
className='ml-2'
color='disabled'
<Icon
color="disabled"
className="fa fa-angle-right breadcrumb-spacer"
/>
<div className='ml-2'>
<Tooltip title={this.createTooltip('section')} placement="top">
Expand All @@ -693,9 +693,9 @@ export default class NetPyNECellRules extends React.Component {

</div>

<NavigationChevronRight
className='ml-2'
color='disabled'
<Icon
color="disabled"
className="fa fa-angle-right breadcrumb-spacer"
/>
<NetPyNENewMechanism
className="ml-2"
Expand Down
Loading