diff --git a/Dockerfile b/Dockerfile index daea183f13..15de9c4fcb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/client/templates/includes/editInitialCondition.pug b/client/templates/includes/editInitialCondition.pug index 6742deef79..51d9602e52 100644 --- a/client/templates/includes/editInitialCondition.pug +++ b/client/templates/includes/editInitialCondition.pug @@ -8,13 +8,13 @@ tr td - if this.model.icType === "Place" + div(data-hook="place-details") span Location: 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 Active in Types: div(data-hook="initial-condition-types") diff --git a/client/templates/includes/spatialSpeciesEditor.pug b/client/templates/includes/spatialSpeciesEditor.pug index 59c4b2f76e..4adc51dfcb 100644 --- a/client/templates/includes/spatialSpeciesEditor.pug +++ b/client/templates/includes/spatialSpeciesEditor.pug @@ -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) + + 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 \ No newline at end of file diff --git a/client/tooltips.js b/client/tooltips.js index 5cef4f02ef..4c426230a2 100644 --- a/client/tooltips.js +++ b/client/tooltips.js @@ -29,6 +29,9 @@ module.exports = { speciesMode: "Concentration - Variables will only be represented using continuous (floating point) values.
Population - Variables will only be represented "+ "using discrete (integer count) values.
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.
Population - Variables will only be represented "+ + "using discrete (integer count) values.", + mode: "Concentration - Variables will only be represented using continuous (floating point) values.
Population - Variables will only be represented "+ "using discrete (integer count) values.
Hybrid Concentration/Population - Allows a variables to be represented using continuous and/or discrete values.", diff --git a/client/views/edit-initial-condition.js b/client/views/edit-initial-condition.js index 43dd0f663f..c00bbc4a00 100644 --- a/client/views/edit-initial-condition.js +++ b/client/views/edit-initial-condition.js @@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +let $ = require('jquery'); var tests = require('./tests'); //views var View = require('ampersand-view'); @@ -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, diff --git a/client/views/species-editor.js b/client/views/species-editor.js index 459987b1a1..6e47985b90 100644 --- a/client/views/species-editor.js +++ b/client/views/species-editor.js @@ -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 () { diff --git a/jupyterhub/Dockerfile.jupyterhub b/jupyterhub/Dockerfile.jupyterhub index 002a8321bd..ab0119b137 100644 --- a/jupyterhub/Dockerfile.jupyterhub +++ b/jupyterhub/Dockerfile.jupyterhub @@ -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 diff --git a/stochss/handlers/util/scripts/run_preview.py b/stochss/handlers/util/scripts/run_preview.py index 9c81a569f1..32db9a4975 100755 --- a/stochss/handlers/util/scripts/run_preview.py +++ b/stochss/handlers/util/scripts/run_preview.py @@ -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) diff --git a/stochss/handlers/util/spatial_simulation.py b/stochss/handlers/util/spatial_simulation.py index 5aadf392ff..43b28311b1 100644 --- a/stochss/handlers/util/spatial_simulation.py +++ b/stochss/handlers/util/spatial_simulation.py @@ -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