Skip to content

Commit

Permalink
updating for refactored COMBINE and SED-ML validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Apr 18, 2021
1 parent ee0da47 commit 1253c9b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Base OS
FROM continuumio/miniconda3:4.9.2

ARG VERSION=0.1.12
ARG VERSION=0.1.13
ARG SIMULATOR_VERSION="0.9.9"
ARG PYTHON_VERSION=3.7

Expand Down
2 changes: 1 addition & 1 deletion biosimulators_pysces/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.12'
__version__ = '0.1.13'
25 changes: 18 additions & 7 deletions biosimulators_pysces/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from biosimulators_utils.simulator.exceptions import AlgorithmDoesNotSupportModelFeatureException
from biosimulators_utils.simulator.utils import get_algorithm_substitution_policy
from biosimulators_utils.simulator.warnings import AlgorithmSubstitutedWarning
from biosimulators_utils.utils.core import raise_errors_warnings
import functools
import os
cwd = os.getcwd() # because PySCeS changes the working directory
Expand Down Expand Up @@ -79,13 +80,23 @@ def exec_sed_task(task, variables, log=None):
'''
log = log or TaskLog()

validation.validate_task(task)
validation.validate_model_language(task.model.language, ModelLanguage.SBML)
validation.validate_model_change_types(task.model.changes, ())
validation.validate_model_changes(task.model.changes)
validation.validate_simulation_type(task.simulation, (UniformTimeCourseSimulation, ))
validation.validate_uniform_time_course_simulation(task.simulation)
validation.validate_data_generator_variables(variables)
model = task.model
sim = task.simulation

raise_errors_warnings(validation.validate_task(task),
error_summary='Task `{}` is invalid.'.format(task.id))
raise_errors_warnings(validation.validate_model_language(task.model.language, ModelLanguage.SBML),
error_summary='Language for model `{}` is not supported.'.format(model.id))
raise_errors_warnings(validation.validate_model_change_types(task.model.changes, ()),
error_summary='Changes for model `{}` are not supported.'.format(model.id))
raise_errors_warnings(validation.validate_model_changes(task.model),
error_summary='Changes for model `{}` are invalid.'.format(model.id))
raise_errors_warnings(validation.validate_simulation_type(task.simulation, (UniformTimeCourseSimulation, )),
error_summary='{} `{}` is not supported.'.format(sim.__class__.__name__, sim.id))
raise_errors_warnings(validation.validate_simulation(task.simulation),
error_summary='Simulation `{}` is invalid.'.format(sim.id))
raise_errors_warnings(validation.validate_data_generator_variables(variables),
error_summary='Data generator variables for task `{}` are invalid.'.format(task.id))
target_x_paths_to_sbml_ids = validation.validate_variable_xpaths(variables, task.model.source, attr='id')

# Get the current working directory because PySCeS opaquely changes it
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
biosimulators_utils[logging] >= 0.1.52
biosimulators_utils[logging] >= 0.1.53
pysces

0 comments on commit 1253c9b

Please sign in to comment.