Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:stochss/stochss into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
seanebum committed Jul 19, 2021
2 parents 31241fe + ee50c8d commit 4201e67
Show file tree
Hide file tree
Showing 226 changed files with 5,164 additions and 3,693 deletions.
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ build: deps webpack
--build-arg JUPYTER_CONFIG_DIR=$(JUPYTER_CONFIG_DIR) \
-t $(DOCKER_STOCHSS_IMAGE):latest .

test: build
test: create_working_dir
docker run --rm \
--name $(DOCKER_STOCHSS_IMAGE) \
--env-file .env \
Expand All @@ -124,6 +124,8 @@ test: build
$(DOCKER_STOCHSS_IMAGE):latest \
/stochss/stochss/tests/run_tests.py

build_and_test: build test

run: create_working_dir
docker run --rm \
--name $(DOCKER_STOCHSS_IMAGE) \
Expand Down
2 changes: 1 addition & 1 deletion client/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/graphics.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
25 changes: 18 additions & 7 deletions client/modals.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -424,15 +424,26 @@ module.exports = {

return templates.select(modalID, selectID, title, label, options)
},
selectSpeciesHTML : (species) => {
let modalID = "speciesSelectModal";
let selectID = "speciesSelectList";
let title = "Preview Variable Selection";
let label = "Select a variable to preview: ";
selectPreviewTargetHTML : (species) => {
let modalID = "previewTargetSelectModal";
let selectID = "previewTargetSelectList";
let title = "Preview Target Selection";
let label = "Select a variable or property to preview: ";
var options = species.map(function (name) {
return `<option value="${name}">${name}</option>`
});
options = options.join(" ");
options = `<optgroup label='Variables'>
${options.join(" ")}
</optgroup>
<optgroup label='Properties'>
<option value='type'>Type</option>
<option value='v[1]'>X Velocity</option>
<option value='v[2]'>Y Velocity</option>
<option value='v[3]'>Z Velocity</option>
<option value='rho'>Density</option>
<option value='mass'>Mass</option>
<option value='nu'>Viscosity</option>
</optgroup>`;

return templates.select(modalID, selectID, title, label, options)
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -16,11 +16,14 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

//views
var View = require('ampersand-view');
//templates
var template = require('../templates/includes/domainTypesViewer.pug');
//models
var State = require('ampersand-state');

module.exports = View.extend({
template: template,
module.exports = State.extend({
props: {
compID: 'number',
name: 'string',
expression: 'string',
annotation: 'string'
}
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -16,11 +16,20 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

//views
var View = require('ampersand-view');
//templates
var template = require('../templates/includes/viewRules.pug');
//collections
var Collection = require('ampersand-collection');
//models
var BoundaryCondition = require('./boundary-condition');

module.exports = View.extend({
template: template,
module.exports = Collection.extend({
model: BoundaryCondition,
addNewBoundaryCondition: function (name, expression) {
let id = this.parent.getDefaultID();
let boundaryCondition = this.add({
compID: id,
name: name,
expression: expression,
annotation: ""
});
}
});
2 changes: 1 addition & 1 deletion client/models/creator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/creators.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/domain-type.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/domain-types.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/domain.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/event-assignment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/event-assignments.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/event.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/events.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/function-definition.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/function-definitions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
11 changes: 6 additions & 5 deletions client/models/initial-condition.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -23,11 +23,12 @@ var Specie = require('./specie');
module.exports = State.extend({
props: {
icType: 'string',
count: 'number',
annotation: 'string',
count: 'any',
types: 'object',
x: 'number',
y: 'number',
z: 'number',
x: 'any',
y: 'any',
z: 'any',
},
children: {
specie: Specie,
Expand Down
3 changes: 2 additions & 1 deletion client/models/initial-conditions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -26,6 +26,7 @@ module.exports = Collection.extend({
addInitialCondition: function (initialConditionType, types) {
var initialCondition = new InitialCondition({
icType: initialConditionType,
annotation: "",
types: types,
count: 0,
x: 0,
Expand Down
2 changes: 1 addition & 1 deletion client/models/job.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/jobs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/me.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/metadata.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
17 changes: 12 additions & 5 deletions client/models/model.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -16,6 +16,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

let _ = require('underscore');
//support files
var app = require('../app');
var path = require('path');
//models
Expand All @@ -30,6 +32,7 @@ var Reactions = require('./reactions');
var Rules = require('./rules');
var Events = require('./events');
var FunctionDefinitions = require('./function-definitions');
var BoundaryConditions = require('./boundary-conditions');

module.exports = Model.extend({
url: function () {
Expand All @@ -49,7 +52,8 @@ module.exports = Model.extend({
reactions: Reactions,
rules: Rules,
eventsCollection: Events,
functionDefinitions: FunctionDefinitions
functionDefinitions: FunctionDefinitions,
boundaryConditions: BoundaryConditions
},
children: {
modelSettings: TimespanSettings,
Expand Down Expand Up @@ -91,12 +95,12 @@ module.exports = Model.extend({
this.rules.on('add change remove', this.updateValid, this);
},
validateModel: function () {
if(!this.species.validateCollection()) return false;
if(!this.species.validateCollection(this.is_spatial)) return false;
if(!this.parameters.validateCollection()) return false;
if(!this.reactions.validateCollection()) return false;
if(!this.eventsCollection.validateCollection()) return false;
if(!this.rules.validateCollection()) return false;
if(this.reactions.length <= 0 && this.eventsCollection.length <= 0 && this.rules.length <= 0) {
if(!this.is_spatial && this.reactions.length <= 0 && this.eventsCollection.length <= 0 && this.rules.length <= 0) {
this.error = {"type":"process"}
return false;
}
Expand Down Expand Up @@ -124,7 +128,10 @@ module.exports = Model.extend({
return id;
},
autoSave: function () {
//TODO: implement auto save
let self = this;
setTimeout(function () {
app.postXHR(self.url(), self.toJSON(), { success: _.bind(self.autoSave, self) });
}, 120000);
},
//called when save button is clicked
saveModel: function (cb=null) {
Expand Down
2 changes: 1 addition & 1 deletion client/models/parameter-sweep-settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion client/models/parameter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
StochSS is a platform for simulating biochemical systems
Copyright (C) 2019-2020 StochSS developers.
Copyright (C) 2019-2021 StochSS developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
Loading

0 comments on commit 4201e67

Please sign in to comment.