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 Apr 28, 2021
2 parents 860c977 + 9fb9f54 commit af1e390
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 28 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ COPY --chown=jovyan:users jupyter_notebook_config.py $JUPYTER_CONFIG_DIR/jupyter

USER root

RUN wget -q https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.2-linux-x86_64.tar.gz \
&& tar -xvzf julia-1.4.2-linux-x86_64.tar.gz \
&& mv julia-1.4.2 /usr/local/ \
&& chown -R jovyan:users /usr/local/julia-1.4.2/
RUN wget -q https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.2-linux-x86_64.tar.gz
RUN tar -xvzf julia-1.4.2-linux-x86_64.tar.gz
RUN mv julia-1.4.2 /usr/local/
RUN chown -R jovyan:users /usr/local/julia-1.4.2/

USER jovyan

Expand Down
4 changes: 2 additions & 2 deletions client/templates/includes/editInitialCondition.pug
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ tr

td

if this.model.icType === "Place"
div(data-hook="place-details")
span <b>Location:</b>
div
div.inline(data-hook="x-container")
div.inline(data-hook="y-container")
div.inline(data-hook="z-container")
else
div(data-hook="scatter-details")
span <b>Active in Types:</b>
div(data-hook="initial-condition-types")

Expand Down
20 changes: 20 additions & 0 deletions client/templates/includes/spatialSpeciesEditor.pug
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ div#species-editor.card.card-body

tbody(data-hook="specie-list")

table.table
thead
tr
th(scope="col", colspan="3")

div

div.inline Model Mode

div.tooltip-icon(data-html="true" data-toggle="tooltip" title=this.tooltips.spatialSpeciesMode) <sup><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="info" class="svg-inline--fa fa-info fa-w-6" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512"><path fill="currentColor" d="M20 424.229h20V279.771H20c-11.046 0-20-8.954-20-20V212c0-11.046 8.954-20 20-20h112c11.046 0 20 8.954 20 20v212.229h20c11.046 0 20 8.954 20 20V492c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20v-47.771c0-11.046 8.954-20 20-20zM96 0C56.235 0 24 32.235 24 72s32.235 72 72 72 72-32.235 72-72S135.764 0 96 0z"></path></svg></sup>

tbody
tr
td
input(type="radio", name="species-mode", data-hook="all-continuous", data-name="continuous")
| Concentration
td
input(type="radio", name="species-mode", data-hook="all-discrete", data-name="discrete")
| Population

button.btn.btn-outline-primary.box-shadow(data-hook="add-species") Add Variable

button.btn.btn-outline-primary.box-shadow.ml-2(data-hook="save-species") Save Variables
3 changes: 3 additions & 0 deletions client/tooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ module.exports = {
speciesMode: "Concentration - Variables will only be represented using continuous (floating point) values.<br>Population - Variables will only be represented "+
"using discrete (integer count) values.<br>Hybrid Concentration/Population - Allows a variables to be represented using continuous and/or discrete values.",

spatialSpeciesMode: "Concentration - Variables will only be represented using continuous (floating point) values.<br>Population - Variables will only be represented "+
"using discrete (integer count) values.",

mode: "Concentration - Variables will only be represented using continuous (floating point) values.<br>Population - Variables will only be represented "+
"using discrete (integer count) values.<br>Hybrid Concentration/Population - Allows a variables to be represented using continuous and/or discrete values.",

Expand Down
9 changes: 5 additions & 4 deletions client/views/edit-initial-condition.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ 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('jquery');
var tests = require('./tests');
//views
var View = require('ampersand-view');
Expand Down Expand Up @@ -74,19 +75,19 @@ module.exports = View.extend({
},
renderDetailsView: function () {
if(this.model.icType === "Place") {
$(this.queryByHook("scatter-details")).css("display", "none")
$(this.queryByHook("place-details")).css("display", "block")
this.renderLocation();
}else {
$(this.queryByHook("place-details")).css("display", "none")
$(this.queryByHook("scatter-details")).css("display", "block")
this.renderTypes();
}
},
renderLocation: function () {
if(this.xCoord) {
this.xCoord.remove();
}
if(this.yCoord) {
this.yCoord.remove();
}
if(this.zCoord) {
this.zCoord.remove();
}
this.xCoord = new InputView({parent: this, required: true,
Expand Down
34 changes: 18 additions & 16 deletions client/views/species-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,24 @@ module.exports = View.extend({
},
setAllSpeciesModes: function (defaultMode, cb) {
this.collection.parent.defaultMode = defaultMode;
if(defaultMode === "continuous") {
$(this.parent.queryByHook("system-volume-container")).collapse("hide")
}else{
$(this.parent.queryByHook("system-volume-container")).collapse("show")
}
this.collection.map(function (specie) {
specie.mode = defaultMode
cb(specie)
});
if(defaultMode === "dynamic"){
this.renderSpeciesAdvancedView()
$(this.queryByHook('advanced-species')).collapse('show');
}
else{
this.speciesAdvancedView.views[0].updateInputValidation()
$(this.queryByHook('advanced-species')).collapse('hide');
if(!this.collection.parent.is_spatial) {
if(defaultMode === "continuous") {
$(this.parent.queryByHook("system-volume-container")).collapse("hide")
}else{
$(this.parent.queryByHook("system-volume-container")).collapse("show")
}
this.collection.map(function (specie) {
specie.mode = defaultMode
cb(specie)
});
if(defaultMode === "dynamic"){
this.renderSpeciesAdvancedView()
$(this.queryByHook('advanced-species')).collapse('show');
}
else{
this.speciesAdvancedView.views[0].updateInputValidation()
$(this.queryByHook('advanced-species')).collapse('hide');
}
}
},
renderEditSpeciesView: function () {
Expand Down
6 changes: 4 additions & 2 deletions jupyterhub/Dockerfile.jupyterhub
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
locales \
python3-pip \
python3-pycurl \
nodejs \
npm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -

RUN apt-get install -y nodejs

ENV SHELL=/bin/bash LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8

RUN locale-gen $LC_ALL
Expand Down
1 change: 1 addition & 0 deletions stochss/handlers/util/scripts/run_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def run_preview(wkfl):
model = StochSSSpatialModel(path=args.path)
wkfl = SpatialSimulation(path="", preview=True, species=args.species)
wkfl.s_py_model = model.convert_to_spatialpy()
wkfl.s_model = model.model
else:
log_stm = setup_logger()
model = StochSSModel(path=args.path)
Expand Down
2 changes: 2 additions & 0 deletions stochss/handlers/util/spatial_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def run(self, preview=False, verbose=False):
# self.species = list(self.s_py_model.get_all_species().keys())[0]
t_ndx_list = list(range(len(os.listdir(results.result_dir)) - 1))
plot = results.plot_species(species=self.species, t_ndx_list=t_ndx_list, animated=True,
concentration=self.s_model['defaultMode'] == "continuous",
deterministic=self.s_model['defaultMode'] == "discrete",
width=None, height=None, return_plotly_figure=True,
f_duration=100, t_duration=100)
plot["layout"]["autosize"] = True
Expand Down

0 comments on commit af1e390

Please sign in to comment.