From 022309e8f8561d02f35478b5ee1e36e9f73e0ec2 Mon Sep 17 00:00:00 2001 From: Jonathan Karr Date: Mon, 20 Dec 2021 17:00:28 -0500 Subject: [PATCH] feat: improved messages for invalid CellML files --- Dockerfile | 2 +- biosimulators_opencor/_version.py | 2 +- biosimulators_opencor/utils.py | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 623e185..00a9c83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # VERSION -ARG VERSION=0.0.10 +ARG VERSION=0.0.11 ARG SIMULATOR_VERSION="2021-10-05" # Base OS diff --git a/biosimulators_opencor/_version.py b/biosimulators_opencor/_version.py index 6820f36..ad3cf1d 100644 --- a/biosimulators_opencor/_version.py +++ b/biosimulators_opencor/_version.py @@ -1 +1 @@ -__version__ = '0.0.10' +__version__ = '0.0.11' diff --git a/biosimulators_opencor/utils.py b/biosimulators_opencor/utils.py index e2745bf..8e54b6e 100644 --- a/biosimulators_opencor/utils.py +++ b/biosimulators_opencor/utils.py @@ -409,7 +409,13 @@ def validate_opencor_simulation(sim): :obj:`ValueError`: if the simulation is invalid """ if sim.hasBlockingIssues() or not sim.valid(): - raise ValueError('The task does not describe a valid simulation.') + msg = 'The task does not describe a valid simulation:\n\n {}'.format( + '\n\n '.join( + ''.join(lxml.etree.fromstring('' + issue + '').itertext()) + for issue in sim.issues() + ) + ) + raise ValueError(msg) def get_results_from_opencor_simulation(opencor_sim, sed_task, sed_variables, opencor_variable_names):