From 337ec33b890783fe5efd38e312cf5fcd4e36da7e Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 30 Oct 2025 17:52:04 +1300 Subject: [PATCH 1/2] Issue: added a context. --- src/api/libopencor/issue.h | 2 +- src/file/file.cpp | 6 +- src/logger/issue.cpp | 23 ++++- src/logger/issue_p.h | 3 +- src/logger/logger.cpp | 14 +-- src/logger/logger_p.h | 6 +- src/sed/seddocument.cpp | 2 +- src/sed/sedinstance.cpp | 6 +- src/sed/sedinstancetask.cpp | 12 +-- src/sed/sedmodel.cpp | 2 +- src/sed/sedtask.cpp | 4 +- src/support/cellml/cellmlfile.cpp | 4 +- src/support/cellml/cellmlfileruntime.cpp | 8 +- src/support/sedml/sedmlfile.cpp | 4 +- tests/api/sed/basictests.cpp | 2 +- tests/api/sed/coveragetests.cpp | 30 +++--- tests/api/sed/instancetests.cpp | 36 +++---- tests/api/sed/serialisetests.cpp | 84 ++++++++--------- tests/api/solver/coveragetests.cpp | 8 +- tests/api/solver/cvodetests.cpp | 16 ++-- tests/api/solver/forwardeulertests.cpp | 2 +- .../api/solver/fourthorderrungekuttatests.cpp | 2 +- tests/api/solver/heuntests.cpp | 2 +- tests/api/solver/kinsoltests.cpp | 10 +- .../api/solver/secondorderrungekuttatests.cpp | 2 +- tests/bindings/javascript/sed.basic.test.js | 2 +- .../bindings/javascript/sed.coverage.test.js | 31 +++--- .../bindings/javascript/sed.instance.test.js | 55 +++++++---- .../bindings/javascript/sed.serialise.test.js | 94 +++++++++++-------- .../javascript/solver.coverage.test.js | 8 +- .../bindings/javascript/solver.cvode.test.js | 40 ++++++-- .../javascript/solver.forwardeuler.test.js | 4 +- .../solver.fourthorderrungekutta.test.js | 7 +- tests/bindings/javascript/solver.heun.test.js | 4 +- .../bindings/javascript/solver.kinsol.test.js | 27 ++++-- .../solver.secondorderrungekutta.test.js | 7 +- tests/bindings/python/test_sed_basic.py | 2 +- tests/bindings/python/test_sed_coverage.py | 28 +++--- tests/bindings/python/test_sed_instance.py | 34 +++---- tests/bindings/python/test_sed_serialise.py | 82 ++++++++-------- tests/bindings/python/test_solver_coverage.py | 8 +- tests/bindings/python/test_solver_cvode.py | 16 ++-- .../python/test_solver_forwardeuler.py | 2 +- .../test_solver_fourthorderrungekutta.py | 2 +- tests/bindings/python/test_solver_heun.py | 2 +- tests/bindings/python/test_solver_kinsol.py | 10 +- .../test_solver_secondorderrungekutta.py | 2 +- tests/support/cellml/runtimetests.cpp | 4 +- 48 files changed, 435 insertions(+), 326 deletions(-) diff --git a/src/api/libopencor/issue.h b/src/api/libopencor/issue.h index 1233188e3..5f6ce8253 100644 --- a/src/api/libopencor/issue.h +++ b/src/api/libopencor/issue.h @@ -93,7 +93,7 @@ class LIBOPENCOR_EXPORT Issue Impl *mPimpl; /**< The private implementation, @private. */ - explicit Issue(Type pType, const std::string &pDescription); /**< Constructor, @private. */ + explicit Issue(Type pType, const std::string &pDescription, const std::string &pContext); /**< Constructor, @private. */ }; } // namespace libOpenCOR diff --git a/src/file/file.cpp b/src/file/file.cpp index b978cb8a2..5884af219 100644 --- a/src/file/file.cpp +++ b/src/file/file.cpp @@ -95,21 +95,21 @@ void File::Impl::checkType(const FilePtr &pOwner, bool pResetType) if (mCellmlFile != nullptr) { mType = Type::CELLML_FILE; - addIssues(mCellmlFile); + addIssues(mCellmlFile, "CellML file"); } else { mSedmlFile = SedmlFile::create(pOwner); if (mSedmlFile != nullptr) { mType = Type::SEDML_FILE; - addIssues(mSedmlFile); + addIssues(mSedmlFile, "SED-ML file"); } else { mCombineArchive = CombineArchive::create(pOwner); if (mCombineArchive != nullptr) { mType = Type::COMBINE_ARCHIVE; - addIssues(mCombineArchive); + addIssues(mCombineArchive, "COMBINE archive"); } else { addError("The file is not a CellML file, a SED-ML file, or a COMBINE archive."); } diff --git a/src/logger/issue.cpp b/src/logger/issue.cpp index e03ef92e9..c7349e05a 100644 --- a/src/logger/issue.cpp +++ b/src/logger/issue.cpp @@ -18,9 +18,10 @@ limitations under the License. namespace libOpenCOR { -Issue::Impl::Impl(Type pType, const std::string &pDescription) +Issue::Impl::Impl(Type pType, const std::string &pDescription, const std::string &pContext) : mType(pType) , mDescription(pDescription) + , mContext(pContext) { } @@ -36,11 +37,27 @@ std::string Issue::Impl::typeAsString() const std::string Issue::Impl::description() const { + // Check whether we have some context to add to the description. + + if (!mContext.empty()) { + auto description {mDescription}; + +#ifndef CODE_COVERAGE_ENABLED + if (std::isupper(description[0]) != 0) { +#endif + description[0] = static_cast(std::tolower(description[0])); +#ifndef CODE_COVERAGE_ENABLED + } +#endif + + return mContext + ": " + description; + } + return mDescription; } -Issue::Issue(Type pType, const std::string &pDescription) - : mPimpl(new Impl {pType, pDescription}) +Issue::Issue(Type pType, const std::string &pDescription, const std::string &pContext) + : mPimpl(new Impl {pType, pDescription, pContext}) { } diff --git a/src/logger/issue_p.h b/src/logger/issue_p.h index 43cfe5a6d..524a1ab8b 100644 --- a/src/logger/issue_p.h +++ b/src/logger/issue_p.h @@ -25,8 +25,9 @@ class Issue::Impl public: Type mType; std::string mDescription; + std::string mContext; - explicit Impl(Type pType, const std::string &pDescription); + explicit Impl(Type pType, const std::string &pDescription, const std::string &pContext); Type type() const; std::string typeAsString() const; diff --git a/src/logger/logger.cpp b/src/logger/logger.cpp index 0b8b70b91..1edbf56a6 100644 --- a/src/logger/logger.cpp +++ b/src/logger/logger.cpp @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +#include "issue_p.h" #include "logger_p.h" namespace libOpenCOR { @@ -90,27 +91,28 @@ IssuePtr Logger::Impl::warning(size_t pIndex) const return mWarnings[pIndex]; } -void Logger::Impl::addIssues(const LoggerPtr &pLogger) +void Logger::Impl::addIssues(const LoggerPtr &pLogger, const std::string &pContext) { for (const auto &issue : pLogger->issues()) { - addIssue(issue->type(), issue->description()); + addIssue(issue->type(), issue->mPimpl->mDescription, + issue->mPimpl->mContext.empty() ? pContext : pContext + " | " + issue->mPimpl->mContext); } } -void Logger::Impl::addIssues(const libcellml::LoggerPtr &pLogger) +void Logger::Impl::addIssues(const libcellml::LoggerPtr &pLogger, const std::string &pContext) { for (size_t i {0}; i < pLogger->issueCount(); ++i) { auto issue {pLogger->issue(i)}; addIssue((issue->level() == libcellml::Issue::Level::ERROR) ? Issue::Type::ERROR : Issue::Type::WARNING, - issue->description()); + issue->description(), pContext); } } -void Logger::Impl::addIssue(Issue::Type pType, const std::string &pDescription) +void Logger::Impl::addIssue(Issue::Type pType, const std::string &pDescription, const std::string &pContext) { - auto issue {IssuePtr {new Issue {pType, pDescription}}}; + auto issue {IssuePtr {new Issue {pType, pDescription, pContext}}}; mIssues.push_back(issue); if (pType == Issue::Type::ERROR) { diff --git a/src/logger/logger_p.h b/src/logger/logger_p.h index a12ed9772..6c3076f72 100644 --- a/src/logger/logger_p.h +++ b/src/logger/logger_p.h @@ -49,10 +49,10 @@ class Logger::Impl IssuePtrs warnings() const; IssuePtr warning(size_t pIndex) const; - void addIssues(const LoggerPtr &pLogger); - void addIssues(const libcellml::LoggerPtr &pLogger); + void addIssues(const LoggerPtr &pLogger, const std::string &pContext); + void addIssues(const libcellml::LoggerPtr &pLogger, const std::string &pContext); - void addIssue(Issue::Type pType, const std::string &pDescription); + void addIssue(Issue::Type pType, const std::string &pDescription, const std::string &pContext = ""); void addError(const std::string &pDescription); void addWarning(const std::string &pDescription); diff --git a/src/sed/seddocument.cpp b/src/sed/seddocument.cpp index c6ce98c96..99688e87c 100644 --- a/src/sed/seddocument.cpp +++ b/src/sed/seddocument.cpp @@ -91,7 +91,7 @@ void SedDocument::Impl::initialiseFromSedmlFile(const SedDocumentPtr &pOwner, co sedmlFile->populateDocument(pOwner); - addIssues(sedmlFile); + addIssues(sedmlFile, "SED-ML file"); } void SedDocument::Impl::initialiseFromCombineArchive(const SedDocumentPtr &pOwner, const FilePtr &pFile) diff --git a/src/sed/sedinstance.cpp b/src/sed/sedinstance.cpp index 1fd5e5cf1..3e792f361 100644 --- a/src/sed/sedinstance.cpp +++ b/src/sed/sedinstance.cpp @@ -48,7 +48,7 @@ SedInstance::Impl::Impl(const SedDocumentPtr &pDocument) // Make sure that the task is valid. if (!taskPimpl->isValid()) { - addIssues(task); + addIssues(task, "Task"); tasksValid = false; } @@ -63,7 +63,7 @@ SedInstance::Impl::Impl(const SedDocumentPtr &pDocument) mTasks.push_back(taskInstance); if (taskInstance->hasIssues()) { - addIssues(taskInstance); + addIssues(taskInstance, "Task instance"); } } } @@ -93,7 +93,7 @@ double SedInstance::Impl::run() res += task->pimpl()->run(); if (task->hasIssues()) { - addIssues(task); + addIssues(task, "Task"); // Reset the issues of the task so that they are not reported again should the instance be run again. diff --git a/src/sed/sedinstancetask.cpp b/src/sed/sedinstancetask.cpp index c7540bffc..ead72e0da 100644 --- a/src/sed/sedinstancetask.cpp +++ b/src/sed/sedinstancetask.cpp @@ -73,7 +73,7 @@ SedInstanceTask::Impl::Impl(const SedAbstractTaskPtr &pTask) #ifndef CODE_COVERAGE_ENABLED if (mRuntime->hasErrors()) { - addIssues(mRuntime); + addIssues(mRuntime, "Runtime"); return; } @@ -141,7 +141,7 @@ void SedInstanceTask::Impl::applyChanges() changeAttribute->pimpl()->apply(mOwner.lock(), mAnalyserModel); - addIssues(changeAttribute); + addIssues(changeAttribute, "Change attribute"); } } @@ -194,7 +194,7 @@ void SedInstanceTask::Impl::initialise() // Make sure that the NLA solver, should it have been used, didn't report any issues. if ((mNlaSolver != nullptr) && mNlaSolver->hasIssues()) { - addIssues(mNlaSolver); + addIssues(mNlaSolver, mNlaSolver->name()); return; } @@ -205,7 +205,7 @@ void SedInstanceTask::Impl::initialise() if (!mOdeSolver->pimpl()->initialise(mVoi, mAnalyserModel->stateCount(), mStates, mRates, mConstants, mComputedConstants, mAlgebraic, mRuntime)) { - addIssues(mOdeSolver); + addIssues(mOdeSolver, mOdeSolver->name()); return; } @@ -264,7 +264,7 @@ double SedInstanceTask::Impl::run() while (!fuzzyCompare(mVoi, voiEnd)) { if (!mOdeSolver->pimpl()->solve(mVoi, std::min(voiStart + static_cast(++voiCounter) * voiInterval, voiEnd))) { - addIssues(mOdeSolver); + addIssues(mOdeSolver, mOdeSolver->name()); return 0.0; } @@ -283,7 +283,7 @@ double SedInstanceTask::Impl::run() #ifndef CODE_COVERAGE_ENABLED if ((mNlaSolver != nullptr) && mNlaSolver->hasIssues()) { - addIssues(mNlaSolver); + addIssues(mNlaSolver, mNlaSolver->name()); return 0.0; } diff --git a/src/sed/sedmodel.cpp b/src/sed/sedmodel.cpp index 33b7cd916..565478afb 100644 --- a/src/sed/sedmodel.cpp +++ b/src/sed/sedmodel.cpp @@ -65,7 +65,7 @@ bool SedModel::Impl::isValid() break; } - addIssues(mFile->pimpl()->mCellmlFile); + addIssues(mFile->pimpl()->mCellmlFile, "CellML"); return !hasErrors(); } diff --git a/src/sed/sedtask.cpp b/src/sed/sedtask.cpp index 47e147b92..9a71d5ba4 100644 --- a/src/sed/sedtask.cpp +++ b/src/sed/sedtask.cpp @@ -58,13 +58,13 @@ bool SedTask::Impl::isValid() // Make sure that the model is valid. if (!mModel->pimpl()->isValid()) { - addIssues(mModel); + addIssues(mModel, "Model"); } // Make sure that the simulation is valid for the model. if (!mSimulation->pimpl()->isValid(mModel)) { - addIssues(mSimulation); + addIssues(mSimulation, "Simulation"); } return !hasIssues(); diff --git a/src/support/cellml/cellmlfile.cpp b/src/support/cellml/cellmlfile.cpp index e6faacbd4..138967eb6 100644 --- a/src/support/cellml/cellmlfile.cpp +++ b/src/support/cellml/cellmlfile.cpp @@ -39,7 +39,7 @@ CellmlFile::Impl::Impl(const FilePtr &pFile, const libcellml::ModelPtr &pModel, if (importer->resolveImports(mModel, pathToString(stringToPath(pFile->path()).parent_path()))) { mModel = importer->flattenModel(mModel); } else { - addIssues(importer); + addIssues(importer, "Importer"); } } @@ -53,7 +53,7 @@ CellmlFile::Impl::Impl(const FilePtr &pFile, const libcellml::ModelPtr &pModel, mAnalyserModel = mAnalyser->model(); if (mAnalyser->errorCount() != 0) { - addIssues(mAnalyser); + addIssues(mAnalyser, "Analyser"); } } diff --git a/src/support/cellml/cellmlfileruntime.cpp b/src/support/cellml/cellmlfileruntime.cpp index 15d3776f2..5703766a9 100644 --- a/src/support/cellml/cellmlfileruntime.cpp +++ b/src/support/cellml/cellmlfileruntime.cpp @@ -169,7 +169,7 @@ CellmlFileRuntime::Impl::Impl(const CellmlFilePtr &pCellmlFile, const SolverNlaP auto cellmlFileAnalyser {pCellmlFile->analyser()}; if (cellmlFileAnalyser->errorCount() != 0) { - addIssues(cellmlFileAnalyser); + addIssues(cellmlFileAnalyser, "Analyser"); } else { // Get an NLA solver, if needed. @@ -341,7 +341,7 @@ extern void nlaSolve(uintptr_t nlaSolverAddress, void (*objectiveFunction)(doubl if (!mCompiler->compile(implementationCode, mWasmModule)) { // The compilation failed, so add the issues it generated. - addIssues(mCompiler); + addIssues(mCompiler, "Compiler"); return; } @@ -376,7 +376,7 @@ extern void nlaSolve(uintptr_t nlaSolverAddress, void (*objectiveFunction)(doubl if (!mCompiler->compile(generator->implementationCode(pCellmlFile->analyserModel()))) { // The compilation failed, so add the issues it generated. - addIssues(mCompiler); + addIssues(mCompiler, "Compiler"); return; } @@ -393,7 +393,7 @@ extern void nlaSolve(uintptr_t nlaSolverAddress, void (*objectiveFunction)(doubl # ifndef CODE_COVERAGE_ENABLED if (!functionAdded) { - addIssues(mCompiler); + addIssues(mCompiler, "Compiler"); return; } diff --git a/src/support/sedml/sedmlfile.cpp b/src/support/sedml/sedmlfile.cpp index 05d299e13..2c65b5394 100644 --- a/src/support/sedml/sedmlfile.cpp +++ b/src/support/sedml/sedmlfile.cpp @@ -224,7 +224,7 @@ void SedmlFile::Impl::populateDocument(const SedDocumentPtr &pDocument) if (odeSolver != nullptr) { odeSolver->pimpl()->populate(sedAlgorithm); - addIssues(odeSolver); + addIssues(odeSolver, odeSolver->name()); simulation->setOdeSolver(odeSolver); } @@ -232,7 +232,7 @@ void SedmlFile::Impl::populateDocument(const SedDocumentPtr &pDocument) if (nlaSolver != nullptr) { nlaSolver->pimpl()->populate(sedAlgorithm); - addIssues(nlaSolver); + addIssues(nlaSolver, nlaSolver->name()); simulation->setNlaSolver(nlaSolver); } diff --git a/tests/api/sed/basictests.cpp b/tests/api/sed/basictests.cpp index 95c687df4..844187b5a 100644 --- a/tests/api/sed/basictests.cpp +++ b/tests/api/sed/basictests.cpp @@ -134,7 +134,7 @@ TEST(BasicSedTest, combineArchiveWithUnknownDirectCellmlFile) TEST(BasicSedTest, combineArchiveWithUnknownIndirectCellmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "Task 'task1' requires a model of CellML type."}, + {libOpenCOR::Issue::Type::ERROR, "Task: task 'task1' requires a model of CellML type."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/unknown_indirect_cellml_file.omex"))}; diff --git a/tests/api/sed/coveragetests.cpp b/tests/api/sed/coveragetests.cpp index e21b7d8c4..86c82c6ce 100644 --- a/tests/api/sed/coveragetests.cpp +++ b/tests/api/sed/coveragetests.cpp @@ -162,13 +162,13 @@ TEST(CoverageSedTest, changes) )")); static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES_1 {{ - {libOpenCOR::Issue::Type::ERROR, "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target 'invalidTarget'."}, - {libOpenCOR::Issue::Type::ERROR, "The new value 'invalidNewValue' for the change of type 'changeAttribute' is not a valid double value."}, - {libOpenCOR::Issue::Type::ERROR, "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name=''."}, - {libOpenCOR::Issue::Type::ERROR, "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName'."}, - {libOpenCOR::Issue::Type::ERROR, "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name=''."}, - {libOpenCOR::Issue::Type::ERROR, "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName'."}, - {libOpenCOR::Issue::Type::ERROR, "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName']Invalid'."}, + {libOpenCOR::Issue::Type::ERROR, "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target 'invalidTarget'."}, + {libOpenCOR::Issue::Type::ERROR, "SED-ML file: the new value 'invalidNewValue' for the change of type 'changeAttribute' is not a valid double value."}, + {libOpenCOR::Issue::Type::ERROR, "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name=''."}, + {libOpenCOR::Issue::Type::ERROR, "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName'."}, + {libOpenCOR::Issue::Type::ERROR, "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name=''."}, + {libOpenCOR::Issue::Type::ERROR, "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName'."}, + {libOpenCOR::Issue::Type::ERROR, "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName']Invalid'."}, }}; file = libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/invalid_sed_changes.omex")); @@ -180,10 +180,10 @@ TEST(CoverageSedTest, changes) )")); static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES_2 {{ - {libOpenCOR::Issue::Type::WARNING, "Only changes of type 'changeAttribute' are currently supported. The change of type 'addXML' has been ignored."}, - {libOpenCOR::Issue::Type::WARNING, "Only changes of type 'changeAttribute' are currently supported. The change of type 'changeXML' has been ignored."}, - {libOpenCOR::Issue::Type::WARNING, "Only changes of type 'changeAttribute' are currently supported. The change of type 'removeXML' has been ignored."}, - {libOpenCOR::Issue::Type::WARNING, "Only changes of type 'changeAttribute' are currently supported. The change of type 'computeChange' has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'addXML' has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'changeXML' has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'removeXML' has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'computeChange' has been ignored."}, }}; file = libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/unsupported_sed_changes.omex")); @@ -302,8 +302,8 @@ TEST(CoverageSedTest, tasks) EXPECT_EQ(document->serialise(), sedTaskExpectedSerialisation(false)); static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "Task 'task1' requires a model."}, - {libOpenCOR::Issue::Type::ERROR, "Task 'task1' requires a simulation."}, + {libOpenCOR::Issue::Type::ERROR, "Task: task 'task1' requires a model."}, + {libOpenCOR::Issue::Type::ERROR, "Task: task 'task1' requires a simulation."}, }}; auto instance {document->instantiate()}; @@ -414,7 +414,7 @@ TEST(CoverageSedTest, sedUniformTimeCourse) TEST(CoverageSedTest, sedInstanceAndSedInstanceTaskDifferentialModel) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The upper half-bandwidth cannot be equal to -1. It must be between 0 and 3."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | CVODE: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 3."}, }}; static const auto UPPER_HALF_BANDWIDTH {-1}; @@ -590,7 +590,7 @@ TEST(CoverageSedTest, math) TEST(CoverageSedTest, KinsolWithInfAndOrNanValues) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES = { - {libOpenCOR::Issue::Type::ERROR, "The input vector contains some Inf and/or NaN values."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the input vector contains some Inf and/or NaN values."}, }; auto file = libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/kinsol_with_inf_and_or_nan_values.cellml")); diff --git a/tests/api/sed/instancetests.cpp b/tests/api/sed/instancetests.cpp index 4969f6357..55d2c02ca 100644 --- a/tests/api/sed/instancetests.cpp +++ b/tests/api/sed/instancetests.cpp @@ -33,8 +33,8 @@ TEST(InstanceSedTest, noFile) TEST(InstanceSedTest, invalidCellmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The CellML file is invalid."}, - {libOpenCOR::Issue::Type::ERROR, "Equation 'x+y+z' in component 'my_component' is not an equality statement (i.e. LHS = RHS)."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Model: the CellML file is invalid."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Model | CellML | Analyser: equation 'x+y+z' in component 'my_component' is not an equality statement (i.e. LHS = RHS)."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath(libOpenCOR::ERROR_CELLML_FILE))}; @@ -47,8 +47,8 @@ TEST(InstanceSedTest, invalidCellmlFile) TEST(InstanceSedTest, overconstrainedCellmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The CellML file is overconstrained."}, - {libOpenCOR::Issue::Type::ERROR, "Variable 'x' in component 'my_component' is computed more than once."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Model: the CellML file is overconstrained."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Model | CellML | Analyser: variable 'x' in component 'my_component' is computed more than once."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/overconstrained.cellml"))}; @@ -61,8 +61,8 @@ TEST(InstanceSedTest, overconstrainedCellmlFile) TEST(InstanceSedTest, underconstrainedCellmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The CellML file is underconstrained."}, - {libOpenCOR::Issue::Type::ERROR, "The type of variable 'x' in component 'my_component' is unknown."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Model: the CellML file is underconstrained."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Model | CellML | Analyser: the type of variable 'x' in component 'my_component' is unknown."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/underconstrained.cellml"))}; @@ -75,9 +75,9 @@ TEST(InstanceSedTest, underconstrainedCellmlFile) TEST(InstanceSedTest, unsuitablyConstrainedCellmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The CellML file is unsuitably constrained."}, - {libOpenCOR::Issue::Type::ERROR, "Variable 'y' in component 'my_component' is computed more than once."}, - {libOpenCOR::Issue::Type::ERROR, "The type of variable 'x' in component 'my_component' is unknown."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Model: the CellML file is unsuitably constrained."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Model | CellML | Analyser: variable 'y' in component 'my_component' is computed more than once."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Model | CellML | Analyser: the type of variable 'x' in component 'my_component' is unknown."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/unsuitably_constrained.cellml"))}; @@ -102,13 +102,13 @@ TEST(InstanceSedTest, odeModel) { const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ #ifdef BUILDING_ON_INTEL - {libOpenCOR::Issue::Type::ERROR, "At t = 0.00140013827899996, mxstep steps taken before reaching tout."}, + {libOpenCOR::Issue::Type::ERROR, "Task | CVODE: at t = 0.00140013827899996, mxstep steps taken before reaching tout."}, #else {libOpenCOR::Issue::Type::ERROR, # ifdef BUILDING_ON_WINDOWS - "At t = 0.00140013827899821, mxstep steps taken before reaching tout." + "Task | CVODE: at t = 0.00140013827899821, mxstep steps taken before reaching tout." # else - "At t = 0.00140013827899707, mxstep steps taken before reaching tout." + "Task | CVODE: at t = 0.00140013827899707, mxstep steps taken before reaching tout." # endif }, #endif @@ -146,7 +146,7 @@ TEST(InstanceSedTest, odeModel) TEST(InstanceSedTest, odeModelWithNoOdeSolver) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "Simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath(libOpenCOR::CELLML_2_FILE))}; @@ -162,7 +162,7 @@ TEST(InstanceSedTest, odeModelWithNoOdeSolver) TEST(InstanceSedTest, nlaModel) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The upper half-bandwidth cannot be equal to -1. It must be between 0 and 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/nla.cellml"))}; @@ -187,7 +187,7 @@ TEST(InstanceSedTest, nlaModel) TEST(InstanceSedTest, nlaModelWithNoNlaSolver) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "Simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/nla.cellml"))}; @@ -203,7 +203,7 @@ TEST(InstanceSedTest, nlaModelWithNoNlaSolver) TEST(InstanceSedTest, daeModel) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The upper half-bandwidth cannot be equal to -1. It must be between 0 and 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/dae.cellml"))}; @@ -234,8 +234,8 @@ TEST(InstanceSedTest, daeModel) TEST(InstanceSedTest, daeModelWithNoOdeOrNlaSolver) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "Simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided."}, - {libOpenCOR::Issue::Type::ERROR, "Simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided."}, + {libOpenCOR::Issue::Type::ERROR, "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/dae.cellml"))}; diff --git a/tests/api/sed/serialisetests.cpp b/tests/api/sed/serialisetests.cpp index 862ae3f9b..38763eec0 100644 --- a/tests/api/sed/serialisetests.cpp +++ b/tests/api/sed/serialisetests.cpp @@ -524,7 +524,7 @@ TEST(SerialiseSedTest, oneStepSimulation) TEST(SerialiseSedTest, sedmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::WARNING, "The model 'cellml_2.cellml' could not be found in the file manager. It has been automatically added to it."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file: the model 'cellml_2.cellml' could not be found in the file manager. It has been automatically added to it."}, }}; static const std::string expectedSerialisation {R"( @@ -566,46 +566,46 @@ TEST(SerialiseSedTest, sedmlFile) TEST(SerialiseSedTest, sedSimulation) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::WARNING, "The solver 'KISAO:1234567' is not recognised. The CVODE solver will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The parameter 'KISAO:1234567' is not recognised. It will be ignored."}, - {libOpenCOR::Issue::Type::WARNING, "The step ('KISAO:0000483') cannot be equal to '-1.23'. It must be greater or equal to 0. A step of 1 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The step ('KISAO:0000483') cannot be equal to 'nan'. It must be greater or equal to 0. A step of 1 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The step ('KISAO:0000483') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A step of 1 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The parameter 'KISAO:1234567' is not recognised. It will be ignored."}, - {libOpenCOR::Issue::Type::WARNING, "The relative tolerance ('KISAO:0000209') cannot be equal to '-1e-03'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The absolute tolerance ('KISAO:0000211') cannot be equal to '-1e-05'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The maximum number of steps ('KISAO:0000415') cannot be equal to '-369'. It must be greater than 0. A maximum number of steps of 500 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The maximum step ('KISAO:0000467') cannot be equal to '-0.01'. It must be greater or equal to 0. A maximum step of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The relative tolerance ('KISAO:0000209') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The absolute tolerance ('KISAO:0000211') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The maximum number of steps ('KISAO:0000415') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of steps of 500 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The maximum step ('KISAO:0000467') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A maximum step of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The integration method ('KISAO:0000475') cannot be equal to 'Unknown'. It must be equal to 'BDF' or 'Adams-Moulton'. A BDF integration method will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The iteration type ('KISAO:0000476') cannot be equal to 'Unknown'. It must be equal to 'Functional' or 'Newton'. A Newton iteration type will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The preconditioner ('KISAO:0000478') cannot be equal to 'Unknown'. It must be equal to 'No' or 'Banded'. A Banded preconditioner will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The interpolate solution parameter ('KISAO:0000481') cannot be equal to 'True'. It must be equal to 'true' or 'false'. A value of true will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The relative tolerance ('KISAO:0000209') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The absolute tolerance ('KISAO:0000211') cannot be equal to '1.23e456789'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The maximum number of steps ('KISAO:0000415') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of steps of 500 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The maximum step ('KISAO:0000467') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A maximum step of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'Diagonal', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The parameter 'KISAO:1234567' is not recognised. It will be ignored."}, - {libOpenCOR::Issue::Type::WARNING, "The maximum number of iterations ('KISAO:0000486') cannot be equal to '-123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The maximum number of iterations ('KISAO:0000486') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of iterations of 200 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The maximum number of iterations ('KISAO:0000486') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, - {libOpenCOR::Issue::Type::WARNING, "The linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file: the solver 'KISAO:1234567' is not recognised. The CVODE solver will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | Forward Euler: the parameter 'KISAO:1234567' is not recognised. It will be ignored."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | Fourth-order Runge-Kutta: the step ('KISAO:0000483') cannot be equal to '-1.23'. It must be greater or equal to 0. A step of 1 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | Heun: the step ('KISAO:0000483') cannot be equal to 'nan'. It must be greater or equal to 0. A step of 1 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | Second-order Runge-Kutta: the step ('KISAO:0000483') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A step of 1 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the parameter 'KISAO:1234567' is not recognised. It will be ignored."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the relative tolerance ('KISAO:0000209') cannot be equal to '-1e-03'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the absolute tolerance ('KISAO:0000211') cannot be equal to '-1e-05'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the maximum number of steps ('KISAO:0000415') cannot be equal to '-369'. It must be greater than 0. A maximum number of steps of 500 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the maximum step ('KISAO:0000467') cannot be equal to '-0.01'. It must be greater or equal to 0. A maximum step of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the relative tolerance ('KISAO:0000209') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the absolute tolerance ('KISAO:0000211') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the maximum number of steps ('KISAO:0000415') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of steps of 500 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the maximum step ('KISAO:0000467') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A maximum step of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the integration method ('KISAO:0000475') cannot be equal to 'Unknown'. It must be equal to 'BDF' or 'Adams-Moulton'. A BDF integration method will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the iteration type ('KISAO:0000476') cannot be equal to 'Unknown'. It must be equal to 'Functional' or 'Newton'. A Newton iteration type will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the preconditioner ('KISAO:0000478') cannot be equal to 'Unknown'. It must be equal to 'No' or 'Banded'. A Banded preconditioner will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the interpolate solution parameter ('KISAO:0000481') cannot be equal to 'True'. It must be equal to 'true' or 'false'. A value of true will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the relative tolerance ('KISAO:0000209') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the absolute tolerance ('KISAO:0000211') cannot be equal to '1.23e456789'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the maximum number of steps ('KISAO:0000415') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of steps of 500 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the maximum step ('KISAO:0000467') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A maximum step of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | CVODE: the linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'Diagonal', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the parameter 'KISAO:1234567' is not recognised. It will be ignored."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the maximum number of iterations ('KISAO:0000486') cannot be equal to '-123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the maximum number of iterations ('KISAO:0000486') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of iterations of 200 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the maximum number of iterations ('KISAO:0000486') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead."}, + {libOpenCOR::Issue::Type::WARNING, "SED-ML file | KINSOL: the linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead."}, }}; static const std::string expectedSerialisation {R"( @@ -848,6 +848,6 @@ TEST(SerialiseSedTest, sedSimulation) auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/simulations.sedml"))}; auto document {libOpenCOR::SedDocument::create(file)}; - // EXPECT_EQ_ISSUES(document, EXPECTED_ISSUES); + EXPECT_EQ_ISSUES(document, EXPECTED_ISSUES); EXPECT_EQ(document->serialise(libOpenCOR::RESOURCE_LOCATION), expectedSerialisation); } diff --git a/tests/api/solver/coveragetests.cpp b/tests/api/solver/coveragetests.cpp index 860687f6c..016e19d2e 100644 --- a/tests/api/solver/coveragetests.cpp +++ b/tests/api/solver/coveragetests.cpp @@ -23,10 +23,10 @@ limitations under the License. TEST(CoverageSolverTest, odeChanges) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::WARNING, "The variable of integration 'time' in component 'environment'cannot be changed. Only state variables and constants can be changed."}, - {libOpenCOR::Issue::Type::WARNING, "The variable 'membrane' in component 'X'could not be found and therefore could not be changed."}, - {libOpenCOR::Issue::Type::WARNING, "The computed constant 'E_Na' in component 'sodium_channel' cannot be changed. Only state variables and constants can be changed."}, - {libOpenCOR::Issue::Type::WARNING, "The algebraic variable 'i_Stim' in component 'membrane' cannot be changed. Only state variables and constants can be changed."}, + {libOpenCOR::Issue::Type::WARNING, "Task instance | Change attribute: the variable of integration 'time' in component 'environment'cannot be changed. Only state variables and constants can be changed."}, + {libOpenCOR::Issue::Type::WARNING, "Task instance | Change attribute: the variable 'membrane' in component 'X'could not be found and therefore could not be changed."}, + {libOpenCOR::Issue::Type::WARNING, "Task instance | Change attribute: the computed constant 'E_Na' in component 'sodium_channel' cannot be changed. Only state variables and constants can be changed."}, + {libOpenCOR::Issue::Type::WARNING, "Task instance | Change attribute: the algebraic variable 'i_Stim' in component 'membrane' cannot be changed. Only state variables and constants can be changed."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode_sed_changes.omex"))}; diff --git a/tests/api/solver/cvodetests.cpp b/tests/api/solver/cvodetests.cpp index 275b2eef8..a2257367a 100644 --- a/tests/api/solver/cvodetests.cpp +++ b/tests/api/solver/cvodetests.cpp @@ -20,7 +20,7 @@ TEST(CvodeSolverTest, maximumStepValueWithInvalidNumber) { static const auto RELATIVE_TOLERANCE {-1.234}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The maximum step cannot be equal to -1.234. It must be greater or equal to 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | CVODE: the maximum step cannot be equal to -1.234. It must be greater or equal to 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; @@ -39,7 +39,7 @@ TEST(CvodeSolverTest, maximumNumberOfStepsValueWithInvalidNumber) { static const auto MAXIMUM_NUMBER_OF_STEPS {0}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The maximum number of steps cannot be equal to 0. It must be greater than 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | CVODE: the maximum number of steps cannot be equal to 0. It must be greater than 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; @@ -58,7 +58,7 @@ TEST(CvodeSolverTest, bandedLinearSolverAndUpperHalfBandwidthValueWithNumberTooS { static const auto UPPER_HALF_BANDWIDTH {-1}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The upper half-bandwidth cannot be equal to -1. It must be between 0 and 3."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | CVODE: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 3."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; @@ -78,7 +78,7 @@ TEST(CvodeSolverTest, bandedLinearSolverAndUpperHalfBandwidthValueWithNumberTooB { static const auto UPPER_HALF_BANDWIDTH {4}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The upper half-bandwidth cannot be equal to 4. It must be between 0 and 3."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | CVODE: the upper half-bandwidth cannot be equal to 4. It must be between 0 and 3."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; @@ -98,7 +98,7 @@ TEST(CvodeSolverTest, bandedLinearSolverAndLowerHalfBandwidthValueWithNumberTooS { static const auto LOWER_HALF_BANDWIDTH {-1}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The lower half-bandwidth cannot be equal to -1. It must be between 0 and 3."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | CVODE: the lower half-bandwidth cannot be equal to -1. It must be between 0 and 3."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; @@ -118,7 +118,7 @@ TEST(CvodeSolverTest, bandedLinearSolverAndLowerHalfBandwidthValueWithNumberTooB { static const auto LOWER_HALF_BANDWIDTH {4}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The lower half-bandwidth cannot be equal to 4. It must be between 0 and 3."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | CVODE: the lower half-bandwidth cannot be equal to 4. It must be between 0 and 3."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; @@ -138,7 +138,7 @@ TEST(CvodeSolverTest, relativeToleranceValueWithInvalidNumber) { static const auto RELATIVE_TOLERANCE {-1.234}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The relative tolerance cannot be equal to -1.234. It must be greater or equal to 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | CVODE: the relative tolerance cannot be equal to -1.234. It must be greater or equal to 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; @@ -157,7 +157,7 @@ TEST(CvodeSolverTest, absoluteToleranceValueWithInvalidNumber) { static const auto ABSOLUTE_TOLERANCE {-1.234}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The absolute tolerance cannot be equal to -1.234. It must be greater or equal to 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | CVODE: the absolute tolerance cannot be equal to -1.234. It must be greater or equal to 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; diff --git a/tests/api/solver/forwardeulertests.cpp b/tests/api/solver/forwardeulertests.cpp index 0f57cb4bc..9af6c719d 100644 --- a/tests/api/solver/forwardeulertests.cpp +++ b/tests/api/solver/forwardeulertests.cpp @@ -20,7 +20,7 @@ TEST(ForwardEulerSolverTest, stepValueWithInvalidNumber) { static const auto STEP {0.0}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The step cannot be equal to 0. It must be greater than 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | Forward Euler: the step cannot be equal to 0. It must be greater than 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; diff --git a/tests/api/solver/fourthorderrungekuttatests.cpp b/tests/api/solver/fourthorderrungekuttatests.cpp index d7c0fda95..c013ae630 100644 --- a/tests/api/solver/fourthorderrungekuttatests.cpp +++ b/tests/api/solver/fourthorderrungekuttatests.cpp @@ -20,7 +20,7 @@ TEST(FourthOrderRungeKuttaSolverTest, stepValueWithInvalidNumber) { static const auto STEP {0.0}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The step cannot be equal to 0. It must be greater than 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | Fourth-order Runge-Kutta: the step cannot be equal to 0. It must be greater than 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; diff --git a/tests/api/solver/heuntests.cpp b/tests/api/solver/heuntests.cpp index fb09b57e0..60354b928 100644 --- a/tests/api/solver/heuntests.cpp +++ b/tests/api/solver/heuntests.cpp @@ -20,7 +20,7 @@ TEST(HeunSolverTest, stepValueWithInvalidNumber) { static const auto STEP {0.0}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The step cannot be equal to 0. It must be greater than 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | Heun: the step cannot be equal to 0. It must be greater than 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; diff --git a/tests/api/solver/kinsoltests.cpp b/tests/api/solver/kinsoltests.cpp index c2cead6db..64055233a 100644 --- a/tests/api/solver/kinsoltests.cpp +++ b/tests/api/solver/kinsoltests.cpp @@ -21,7 +21,7 @@ limitations under the License. TEST(KinsolSolverTest, maximumNumberOfIterationsValueWithInvalidNumber) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The maximum number of iterations cannot be equal to 0. It must be greater than 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the maximum number of iterations cannot be equal to 0. It must be greater than 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/nla1.cellml"))}; @@ -39,7 +39,7 @@ TEST(KinsolSolverTest, maximumNumberOfIterationsValueWithInvalidNumber) TEST(KinsolSolverTest, bandedLinearSolverAndUpperHalfBandwidthValueWithNumberTooSmall) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The upper half-bandwidth cannot be equal to -1. It must be between 0 and 2."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 2."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/nla2.cellml"))}; @@ -58,7 +58,7 @@ TEST(KinsolSolverTest, bandedLinearSolverAndUpperHalfBandwidthValueWithNumberToo TEST(KinsolSolverTest, bandedLinearSolverAndUpperHalfBandwidthValueWithNumberTooBig) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The upper half-bandwidth cannot be equal to 1. It must be between 0 and 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the upper half-bandwidth cannot be equal to 1. It must be between 0 and 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/nla1.cellml"))}; @@ -77,7 +77,7 @@ TEST(KinsolSolverTest, bandedLinearSolverAndUpperHalfBandwidthValueWithNumberToo TEST(KinsolSolverTest, bandedLinearSolverAndLowerHalfBandwidthValueWithNumberTooSmall) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The lower half-bandwidth cannot be equal to -1. It must be between 0 and 2."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the lower half-bandwidth cannot be equal to -1. It must be between 0 and 2."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/nla2.cellml"))}; @@ -96,7 +96,7 @@ TEST(KinsolSolverTest, bandedLinearSolverAndLowerHalfBandwidthValueWithNumberToo TEST(KinsolSolverTest, bandedLinearSolverAndLowerHalfBandwidthValueWithNumberTooBig) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The lower half-bandwidth cannot be equal to 1. It must be between 0 and 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the lower half-bandwidth cannot be equal to 1. It must be between 0 and 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/nla1.cellml"))}; diff --git a/tests/api/solver/secondorderrungekuttatests.cpp b/tests/api/solver/secondorderrungekuttatests.cpp index d951e33fb..936518fe3 100644 --- a/tests/api/solver/secondorderrungekuttatests.cpp +++ b/tests/api/solver/secondorderrungekuttatests.cpp @@ -20,7 +20,7 @@ TEST(SecondOrderRungeKuttaSolverTest, stepValueWithInvalidNumber) { static const auto STEP {0.0}; static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "The step cannot be equal to 0. It must be greater than 0."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | Second-order Runge-Kutta: the step cannot be equal to 0. It must be greater than 0."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/solver/ode.cellml"))}; diff --git a/tests/bindings/javascript/sed.basic.test.js b/tests/bindings/javascript/sed.basic.test.js index cc6026038..623524a73 100644 --- a/tests/bindings/javascript/sed.basic.test.js +++ b/tests/bindings/javascript/sed.basic.test.js @@ -236,7 +236,7 @@ test.describe('Sed basic tests', () => { instance.run(); - assertIssues(loc, instance, [[loc.Issue.Type.ERROR, "Task 'task1' requires a model of CellML type."]]); + assertIssues(loc, instance, [[loc.Issue.Type.ERROR, "Task: task 'task1' requires a model of CellML type."]]); }); test('COMBINE archive with unknown SED-ML file', () => { diff --git a/tests/bindings/javascript/sed.coverage.test.js b/tests/bindings/javascript/sed.coverage.test.js index 49a2712f3..c85bd9c8f 100644 --- a/tests/bindings/javascript/sed.coverage.test.js +++ b/tests/bindings/javascript/sed.coverage.test.js @@ -153,31 +153,31 @@ test.describe('Sed coverage tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.ERROR, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target 'invalidTarget'." + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target 'invalidTarget'." ], [ loc.Issue.Type.ERROR, - "The new value 'invalidNewValue' for the change of type 'changeAttribute' is not a valid double value." + "SED-ML file: the new value 'invalidNewValue' for the change of type 'changeAttribute' is not a valid double value." ], [ loc.Issue.Type.ERROR, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name=''." + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name=''." ], [ loc.Issue.Type.ERROR, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName'." + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName'." ], [ loc.Issue.Type.ERROR, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name=''." + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name=''." ], [ loc.Issue.Type.ERROR, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName'." + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName'." ], [ loc.Issue.Type.ERROR, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName']Invalid'." + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName']Invalid'." ] ]); @@ -188,19 +188,19 @@ test.describe('Sed coverage tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.WARNING, - "Only changes of type 'changeAttribute' are currently supported. The change of type 'addXML' has been ignored." + "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'addXML' has been ignored." ], [ loc.Issue.Type.WARNING, - "Only changes of type 'changeAttribute' are currently supported. The change of type 'changeXML' has been ignored." + "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'changeXML' has been ignored." ], [ loc.Issue.Type.WARNING, - "Only changes of type 'changeAttribute' are currently supported. The change of type 'removeXML' has been ignored." + "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'removeXML' has been ignored." ], [ loc.Issue.Type.WARNING, - "Only changes of type 'changeAttribute' are currently supported. The change of type 'computeChange' has been ignored." + "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'computeChange' has been ignored." ] ]); }); @@ -297,8 +297,8 @@ test.describe('Sed coverage tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, "Task 'task1' requires a model."], - [loc.Issue.Type.ERROR, "Task 'task1' requires a simulation."] + [loc.Issue.Type.ERROR, "Task: task 'task1' requires a model."], + [loc.Issue.Type.ERROR, "Task: task 'task1' requires a simulation."] ]); assert.strictEqual(document.addTask(task), false); @@ -459,7 +459,10 @@ test.describe('Sed coverage tests', () => { instance.run(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The upper half-bandwidth cannot be equal to -1. It must be between 0 and 3.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | CVODE: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 3.' + ] ]); }); diff --git a/tests/bindings/javascript/sed.instance.test.js b/tests/bindings/javascript/sed.instance.test.js index c1e4a3bcc..150e10ed9 100644 --- a/tests/bindings/javascript/sed.instance.test.js +++ b/tests/bindings/javascript/sed.instance.test.js @@ -86,10 +86,10 @@ test.describe('Sed instance tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The CellML file is invalid.'], + [loc.Issue.Type.ERROR, 'Task | Model: the CellML file is invalid.'], [ loc.Issue.Type.ERROR, - "Equation 'x+y+z' in component 'my_component' is not an equality statement (i.e. LHS = RHS)." + "Task | Model | CellML | Analyser: equation 'x+y+z' in component 'my_component' is not an equality statement (i.e. LHS = RHS)." ] ]); }); @@ -103,8 +103,11 @@ test.describe('Sed instance tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The CellML file is overconstrained.'], - [loc.Issue.Type.ERROR, "Variable 'x' in component 'my_component' is computed more than once."] + [loc.Issue.Type.ERROR, 'Task | Model: the CellML file is overconstrained.'], + [ + loc.Issue.Type.ERROR, + "Task | Model | CellML | Analyser: variable 'x' in component 'my_component' is computed more than once." + ] ]); }); @@ -117,8 +120,11 @@ test.describe('Sed instance tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The CellML file is underconstrained.'], - [loc.Issue.Type.ERROR, "The type of variable 'x' in component 'my_component' is unknown."] + [loc.Issue.Type.ERROR, 'Task | Model: the CellML file is underconstrained.'], + [ + loc.Issue.Type.ERROR, + "Task | Model | CellML | Analyser: the type of variable 'x' in component 'my_component' is unknown." + ] ]); }); @@ -131,9 +137,15 @@ test.describe('Sed instance tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The CellML file is unsuitably constrained.'], - [loc.Issue.Type.ERROR, "Variable 'y' in component 'my_component' is computed more than once."], - [loc.Issue.Type.ERROR, "The type of variable 'x' in component 'my_component' is unknown."] + [loc.Issue.Type.ERROR, 'Task | Model: the CellML file is unsuitably constrained.'], + [ + loc.Issue.Type.ERROR, + "Task | Model | CellML | Analyser: variable 'y' in component 'my_component' is computed more than once." + ], + [ + loc.Issue.Type.ERROR, + "Task | Model | CellML | Analyser: the type of variable 'x' in component 'my_component' is unknown." + ] ]); }); @@ -168,7 +180,7 @@ test.describe('Sed instance tests', () => { instance.run(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'At t = 0.00140013827899996, mxstep steps taken before reaching tout.'] + [loc.Issue.Type.ERROR, 'Task | CVODE: at t = 0.00140013827899996, mxstep steps taken before reaching tout.'] ]); cvode.maximumNumberOfSteps = 500; @@ -194,7 +206,7 @@ test.describe('Sed instance tests', () => { assertIssues(loc, instance, [ [ loc.Issue.Type.ERROR, - "Simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided." + "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided." ] ]); }); @@ -214,7 +226,10 @@ test.describe('Sed instance tests', () => { let instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The upper half-bandwidth cannot be equal to -1. It must be between 0 and 0.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | KINSOL: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 0.' + ] ]); kinsol.linearSolver = loc.SolverKinsol.LinearSolver.DENSE; @@ -238,7 +253,7 @@ test.describe('Sed instance tests', () => { assertIssues(loc, instance, [ [ loc.Issue.Type.ERROR, - "Simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided." + "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided." ] ]); }); @@ -258,13 +273,19 @@ test.describe('Sed instance tests', () => { let instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The upper half-bandwidth cannot be equal to -1. It must be between 0 and 0.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | KINSOL: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 0.' + ] ]); instance.run(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The upper half-bandwidth cannot be equal to -1. It must be between 0 and 0.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | KINSOL: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 0.' + ] ]); kinsol.linearSolver = loc.SolverKinsol.LinearSolver.DENSE; @@ -292,11 +313,11 @@ test.describe('Sed instance tests', () => { assertIssues(loc, instance, [ [ loc.Issue.Type.ERROR, - "Simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided." + "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided." ], [ loc.Issue.Type.ERROR, - "Simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided." + "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided." ] ]); }); diff --git a/tests/bindings/javascript/sed.serialise.test.js b/tests/bindings/javascript/sed.serialise.test.js index a6e390de3..981bf238d 100644 --- a/tests/bindings/javascript/sed.serialise.test.js +++ b/tests/bindings/javascript/sed.serialise.test.js @@ -673,7 +673,7 @@ test.describe('Sed serialise tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.WARNING, - "The model 'cellml_2.cellml' could not be found in the file manager. It has been automatically added to it." + "SED-ML file: the model 'cellml_2.cellml' could not be found in the file manager. It has been automatically added to it." ] ]); assert.strictEqual(document.serialise(utils.RESOURCE_LOCATION), expectedSerialisation); @@ -925,153 +925,165 @@ test.describe('Sed serialise tests', () => { const document = new loc.SedDocument(file); assertIssues(loc, document, [ - [loc.Issue.Type.WARNING, "The solver 'KISAO:1234567' is not recognised. The CVODE solver will be used instead."], - [loc.Issue.Type.WARNING, "The parameter 'KISAO:1234567' is not recognised. It will be ignored."], [ loc.Issue.Type.WARNING, - "The step ('KISAO:0000483') cannot be equal to '-1.23'. It must be greater or equal to 0. A step of 1 will be used instead." + "SED-ML file: the solver 'KISAO:1234567' is not recognised. The CVODE solver will be used instead." ], [ loc.Issue.Type.WARNING, - "The step ('KISAO:0000483') cannot be equal to 'nan'. It must be greater or equal to 0. A step of 1 will be used instead." + "SED-ML file | Forward Euler: the parameter 'KISAO:1234567' is not recognised. It will be ignored." ], [ loc.Issue.Type.WARNING, - "The step ('KISAO:0000483') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A step of 1 will be used instead." + "SED-ML file | Fourth-order Runge-Kutta: the step ('KISAO:0000483') cannot be equal to '-1.23'. It must be greater or equal to 0. A step of 1 will be used instead." ], - [loc.Issue.Type.WARNING, "The parameter 'KISAO:1234567' is not recognised. It will be ignored."], [ loc.Issue.Type.WARNING, - "The relative tolerance ('KISAO:0000209') cannot be equal to '-1e-03'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead." + "SED-ML file | Heun: the step ('KISAO:0000483') cannot be equal to 'nan'. It must be greater or equal to 0. A step of 1 will be used instead." ], [ loc.Issue.Type.WARNING, - "The absolute tolerance ('KISAO:0000211') cannot be equal to '-1e-05'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead." + "SED-ML file | Second-order Runge-Kutta: the step ('KISAO:0000483') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A step of 1 will be used instead." ], [ loc.Issue.Type.WARNING, - "The maximum number of steps ('KISAO:0000415') cannot be equal to '-369'. It must be greater than 0. A maximum number of steps of 500 will be used instead." + "SED-ML file | CVODE: the parameter 'KISAO:1234567' is not recognised. It will be ignored." ], [ loc.Issue.Type.WARNING, - "The maximum step ('KISAO:0000467') cannot be equal to '-0.01'. It must be greater or equal to 0. A maximum step of 0 will be used instead." + "SED-ML file | CVODE: the relative tolerance ('KISAO:0000209') cannot be equal to '-1e-03'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead." ], [ loc.Issue.Type.WARNING, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." + "SED-ML file | CVODE: the absolute tolerance ('KISAO:0000211') cannot be equal to '-1e-05'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead." ], [ loc.Issue.Type.WARNING, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." + "SED-ML file | CVODE: the maximum number of steps ('KISAO:0000415') cannot be equal to '-369'. It must be greater than 0. A maximum number of steps of 500 will be used instead." ], [ loc.Issue.Type.WARNING, - "The relative tolerance ('KISAO:0000209') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead." + "SED-ML file | CVODE: the maximum step ('KISAO:0000467') cannot be equal to '-0.01'. It must be greater or equal to 0. A maximum step of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The absolute tolerance ('KISAO:0000211') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead." + "SED-ML file | CVODE: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The maximum number of steps ('KISAO:0000415') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of steps of 500 will be used instead." + "SED-ML file | CVODE: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The maximum step ('KISAO:0000467') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A maximum step of 0 will be used instead." + "SED-ML file | CVODE: the relative tolerance ('KISAO:0000209') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead." ], [ loc.Issue.Type.WARNING, - "The integration method ('KISAO:0000475') cannot be equal to 'Unknown'. It must be equal to 'BDF' or 'Adams-Moulton'. A BDF integration method will be used instead." + "SED-ML file | CVODE: the absolute tolerance ('KISAO:0000211') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead." ], [ loc.Issue.Type.WARNING, - "The iteration type ('KISAO:0000476') cannot be equal to 'Unknown'. It must be equal to 'Functional' or 'Newton'. A Newton iteration type will be used instead." + "SED-ML file | CVODE: the maximum number of steps ('KISAO:0000415') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of steps of 500 will be used instead." ], [ loc.Issue.Type.WARNING, - "The preconditioner ('KISAO:0000478') cannot be equal to 'Unknown'. It must be equal to 'No' or 'Banded'. A Banded preconditioner will be used instead." + "SED-ML file | CVODE: the maximum step ('KISAO:0000467') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A maximum step of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." + "SED-ML file | CVODE: the integration method ('KISAO:0000475') cannot be equal to 'Unknown'. It must be equal to 'BDF' or 'Adams-Moulton'. A BDF integration method will be used instead." ], [ loc.Issue.Type.WARNING, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." + "SED-ML file | CVODE: the iteration type ('KISAO:0000476') cannot be equal to 'Unknown'. It must be equal to 'Functional' or 'Newton'. A Newton iteration type will be used instead." ], [ loc.Issue.Type.WARNING, - "The interpolate solution parameter ('KISAO:0000481') cannot be equal to 'True'. It must be equal to 'true' or 'false'. A value of true will be used instead." + "SED-ML file | CVODE: the preconditioner ('KISAO:0000478') cannot be equal to 'Unknown'. It must be equal to 'No' or 'Banded'. A Banded preconditioner will be used instead." ], [ loc.Issue.Type.WARNING, - "The relative tolerance ('KISAO:0000209') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead." + "SED-ML file | CVODE: the upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The absolute tolerance ('KISAO:0000211') cannot be equal to '1.23e456789'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead." + "SED-ML file | CVODE: the lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The maximum number of steps ('KISAO:0000415') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of steps of 500 will be used instead." + "SED-ML file | CVODE: the interpolate solution parameter ('KISAO:0000481') cannot be equal to 'True'. It must be equal to 'true' or 'false'. A value of true will be used instead." ], [ loc.Issue.Type.WARNING, - "The maximum step ('KISAO:0000467') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A maximum step of 0 will be used instead." + "SED-ML file | CVODE: the relative tolerance ('KISAO:0000209') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead." ], [ loc.Issue.Type.WARNING, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." + "SED-ML file | CVODE: the absolute tolerance ('KISAO:0000211') cannot be equal to '1.23e456789'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead." ], [ loc.Issue.Type.WARNING, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." + "SED-ML file | CVODE: the maximum number of steps ('KISAO:0000415') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of steps of 500 will be used instead." ], [ loc.Issue.Type.WARNING, - "The linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'Diagonal', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead." + "SED-ML file | CVODE: the maximum step ('KISAO:0000467') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A maximum step of 0 will be used instead." ], - [loc.Issue.Type.WARNING, "The parameter 'KISAO:1234567' is not recognised. It will be ignored."], [ loc.Issue.Type.WARNING, - "The maximum number of iterations ('KISAO:0000486') cannot be equal to '-123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead." + "SED-ML file | CVODE: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." + "SED-ML file | CVODE: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." + "SED-ML file | CVODE: the linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'Diagonal', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead." ], [ loc.Issue.Type.WARNING, - "The maximum number of iterations ('KISAO:0000486') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of iterations of 200 will be used instead." + "SED-ML file | KINSOL: the parameter 'KISAO:1234567' is not recognised. It will be ignored." ], [ loc.Issue.Type.WARNING, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." + "SED-ML file | KINSOL: the maximum number of iterations ('KISAO:0000486') cannot be equal to '-123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead." ], [ loc.Issue.Type.WARNING, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." + "SED-ML file | KINSOL: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The maximum number of iterations ('KISAO:0000486') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead." + "SED-ML file | KINSOL: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." + "SED-ML file | KINSOL: the maximum number of iterations ('KISAO:0000486') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of iterations of 200 will be used instead." ], [ loc.Issue.Type.WARNING, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." + "SED-ML file | KINSOL: the upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." ], [ loc.Issue.Type.WARNING, - "The linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead." + "SED-ML file | KINSOL: the lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." + ], + [ + loc.Issue.Type.WARNING, + "SED-ML file | KINSOL: the maximum number of iterations ('KISAO:0000486') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead." + ], + [ + loc.Issue.Type.WARNING, + "SED-ML file | KINSOL: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead." + ], + [ + loc.Issue.Type.WARNING, + "SED-ML file | KINSOL: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead." + ], + [ + loc.Issue.Type.WARNING, + "SED-ML file | KINSOL: the linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead." ] ]); assert.strictEqual(document.serialise(utils.RESOURCE_LOCATION), expectedSerialisation); diff --git a/tests/bindings/javascript/solver.coverage.test.js b/tests/bindings/javascript/solver.coverage.test.js index fc1e4c2d0..55616e633 100644 --- a/tests/bindings/javascript/solver.coverage.test.js +++ b/tests/bindings/javascript/solver.coverage.test.js @@ -54,19 +54,19 @@ test.describe('Solver coverage tests', () => { assertIssues(loc, instance, [ [ loc.Issue.Type.WARNING, - "The variable of integration 'time' in component 'environment'cannot be changed. Only state variables and constants can be changed." + "Task instance | Change attribute: the variable of integration 'time' in component 'environment'cannot be changed. Only state variables and constants can be changed." ], [ loc.Issue.Type.WARNING, - "The variable 'membrane' in component 'X'could not be found and therefore could not be changed." + "Task instance | Change attribute: the variable 'membrane' in component 'X'could not be found and therefore could not be changed." ], [ loc.Issue.Type.WARNING, - "The computed constant 'E_Na' in component 'sodium_channel' cannot be changed. Only state variables and constants can be changed." + "Task instance | Change attribute: the computed constant 'E_Na' in component 'sodium_channel' cannot be changed. Only state variables and constants can be changed." ], [ loc.Issue.Type.WARNING, - "The algebraic variable 'i_Stim' in component 'membrane' cannot be changed. Only state variables and constants can be changed." + "Task instance | Change attribute: the algebraic variable 'i_Stim' in component 'membrane' cannot be changed. Only state variables and constants can be changed." ] ]); }); diff --git a/tests/bindings/javascript/solver.cvode.test.js b/tests/bindings/javascript/solver.cvode.test.js index 64f66cd70..12b46e8f3 100644 --- a/tests/bindings/javascript/solver.cvode.test.js +++ b/tests/bindings/javascript/solver.cvode.test.js @@ -52,7 +52,10 @@ test.describe('Solver CVODE tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The maximum step cannot be equal to -1.234. It must be greater or equal to 0.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | CVODE: the maximum step cannot be equal to -1.234. It must be greater or equal to 0.' + ] ]); }); @@ -70,7 +73,10 @@ test.describe('Solver CVODE tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The maximum number of steps cannot be equal to 0. It must be greater than 0.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | CVODE: the maximum number of steps cannot be equal to 0. It must be greater than 0.' + ] ]); }); @@ -89,7 +95,10 @@ test.describe('Solver CVODE tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The upper half-bandwidth cannot be equal to -1. It must be between 0 and 3.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | CVODE: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 3.' + ] ]); }); @@ -108,7 +117,10 @@ test.describe('Solver CVODE tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The upper half-bandwidth cannot be equal to 4. It must be between 0 and 3.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | CVODE: the upper half-bandwidth cannot be equal to 4. It must be between 0 and 3.' + ] ]); }); @@ -127,7 +139,10 @@ test.describe('Solver CVODE tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The lower half-bandwidth cannot be equal to -1. It must be between 0 and 3.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | CVODE: the lower half-bandwidth cannot be equal to -1. It must be between 0 and 3.' + ] ]); }); @@ -146,7 +161,10 @@ test.describe('Solver CVODE tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The lower half-bandwidth cannot be equal to 4. It must be between 0 and 3.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | CVODE: the lower half-bandwidth cannot be equal to 4. It must be between 0 and 3.' + ] ]); }); @@ -164,7 +182,10 @@ test.describe('Solver CVODE tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The relative tolerance cannot be equal to -1.234. It must be greater or equal to 0.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | CVODE: the relative tolerance cannot be equal to -1.234. It must be greater or equal to 0.' + ] ]); }); @@ -182,7 +203,10 @@ test.describe('Solver CVODE tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The absolute tolerance cannot be equal to -1.234. It must be greater or equal to 0.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | CVODE: the absolute tolerance cannot be equal to -1.234. It must be greater or equal to 0.' + ] ]); }); diff --git a/tests/bindings/javascript/solver.forwardeuler.test.js b/tests/bindings/javascript/solver.forwardeuler.test.js index 840f9c79f..0c401fd79 100644 --- a/tests/bindings/javascript/solver.forwardeuler.test.js +++ b/tests/bindings/javascript/solver.forwardeuler.test.js @@ -53,7 +53,9 @@ test.describe('Solver Forward Euler tests', () => { const instance = document.instantiate(); - assertIssues(loc, instance, [[loc.Issue.Type.ERROR, 'The step cannot be equal to 0. It must be greater than 0.']]); + assertIssues(loc, instance, [ + [loc.Issue.Type.ERROR, 'Task instance | Forward Euler: the step cannot be equal to 0. It must be greater than 0.'] + ]); }); test('Solve', () => { diff --git a/tests/bindings/javascript/solver.fourthorderrungekutta.test.js b/tests/bindings/javascript/solver.fourthorderrungekutta.test.js index ce59c4294..c447dd561 100644 --- a/tests/bindings/javascript/solver.fourthorderrungekutta.test.js +++ b/tests/bindings/javascript/solver.fourthorderrungekutta.test.js @@ -53,7 +53,12 @@ test.describe('Solver Fourth-Order Runge-Kutta tests', () => { const instance = document.instantiate(); - assertIssues(loc, instance, [[loc.Issue.Type.ERROR, 'The step cannot be equal to 0. It must be greater than 0.']]); + assertIssues(loc, instance, [ + [ + loc.Issue.Type.ERROR, + 'Task instance | Fourth-order Runge-Kutta: the step cannot be equal to 0. It must be greater than 0.' + ] + ]); }); test('Solve', () => { diff --git a/tests/bindings/javascript/solver.heun.test.js b/tests/bindings/javascript/solver.heun.test.js index ef6f25954..04c3417ae 100644 --- a/tests/bindings/javascript/solver.heun.test.js +++ b/tests/bindings/javascript/solver.heun.test.js @@ -53,7 +53,9 @@ test.describe('Solver Heun tests', () => { const instance = document.instantiate(); - assertIssues(loc, instance, [[loc.Issue.Type.ERROR, 'The step cannot be equal to 0. It must be greater than 0.']]); + assertIssues(loc, instance, [ + [loc.Issue.Type.ERROR, 'Task instance | Heun: the step cannot be equal to 0. It must be greater than 0.'] + ]); }); test('Solve', () => { diff --git a/tests/bindings/javascript/solver.kinsol.test.js b/tests/bindings/javascript/solver.kinsol.test.js index 99f77cbc2..5214f8968 100644 --- a/tests/bindings/javascript/solver.kinsol.test.js +++ b/tests/bindings/javascript/solver.kinsol.test.js @@ -50,12 +50,15 @@ test.describe('Solver KINSOL tests', () => { const simulation = document.simulations.get(0); const solver = simulation.nlaSolver; - solver.maximumNumberOfIterations = -1.234; + solver.maximumNumberOfIterations = 0; const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The maximum number of iterations cannot be equal to -1. It must be greater than 0.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | KINSOL: the maximum number of iterations cannot be equal to 0. It must be greater than 0.' + ] ]); }); @@ -74,7 +77,10 @@ test.describe('Solver KINSOL tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The upper half-bandwidth cannot be equal to -1. It must be between 0 and 2.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | KINSOL: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 2.' + ] ]); }); @@ -93,7 +99,10 @@ test.describe('Solver KINSOL tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The upper half-bandwidth cannot be equal to 1. It must be between 0 and 0.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | KINSOL: the upper half-bandwidth cannot be equal to 1. It must be between 0 and 0.' + ] ]); }); @@ -112,7 +121,10 @@ test.describe('Solver KINSOL tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The lower half-bandwidth cannot be equal to -1. It must be between 0 and 2.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | KINSOL: the lower half-bandwidth cannot be equal to -1. It must be between 0 and 2.' + ] ]); }); @@ -131,7 +143,10 @@ test.describe('Solver KINSOL tests', () => { const instance = document.instantiate(); assertIssues(loc, instance, [ - [loc.Issue.Type.ERROR, 'The lower half-bandwidth cannot be equal to 1. It must be between 0 and 0.'] + [ + loc.Issue.Type.ERROR, + 'Task instance | KINSOL: the lower half-bandwidth cannot be equal to 1. It must be between 0 and 0.' + ] ]); }); diff --git a/tests/bindings/javascript/solver.secondorderrungekutta.test.js b/tests/bindings/javascript/solver.secondorderrungekutta.test.js index 7e61b46d4..e84e53d6f 100644 --- a/tests/bindings/javascript/solver.secondorderrungekutta.test.js +++ b/tests/bindings/javascript/solver.secondorderrungekutta.test.js @@ -53,7 +53,12 @@ test.describe('Solver Second-Order Runge-Kutta tests', () => { const instance = document.instantiate(); - assertIssues(loc, instance, [[loc.Issue.Type.ERROR, 'The step cannot be equal to 0. It must be greater than 0.']]); + assertIssues(loc, instance, [ + [ + loc.Issue.Type.ERROR, + 'Task instance | Second-order Runge-Kutta: the step cannot be equal to 0. It must be greater than 0.' + ] + ]); }); test('Solve', () => { diff --git a/tests/bindings/python/test_sed_basic.py b/tests/bindings/python/test_sed_basic.py index 5714c6083..adceab324 100644 --- a/tests/bindings/python/test_sed_basic.py +++ b/tests/bindings/python/test_sed_basic.py @@ -141,7 +141,7 @@ def test_combine_archive_with_unknown_indirect_cellml_file(): expected_issues = [ [ loc.Issue.Type.Error, - "Task 'task1' requires a model of CellML type.", + "Task: task 'task1' requires a model of CellML type.", ], ] diff --git a/tests/bindings/python/test_sed_coverage.py b/tests/bindings/python/test_sed_coverage.py index d26c1dcaa..458e35890 100644 --- a/tests/bindings/python/test_sed_coverage.py +++ b/tests/bindings/python/test_sed_coverage.py @@ -103,31 +103,31 @@ def test_changes(): expected_issues_1 = [ [ loc.Issue.Type.Error, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target 'invalidTarget'.", + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target 'invalidTarget'.", ], [ loc.Issue.Type.Error, - "The new value 'invalidNewValue' for the change of type 'changeAttribute' is not a valid double value.", + "SED-ML file: the new value 'invalidNewValue' for the change of type 'changeAttribute' is not a valid double value.", ], [ loc.Issue.Type.Error, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name=''.", + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name=''.", ], [ loc.Issue.Type.Error, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName'.", + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName'.", ], [ loc.Issue.Type.Error, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name=''.", + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name=''.", ], [ loc.Issue.Type.Error, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName'.", + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName'.", ], [ loc.Issue.Type.Error, - "The component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName']Invalid'.", + "SED-ML file: the component and variable names could not be retrieved for the change of type 'changeAttribute' and of target '/cellml:model/cellml:component[@name='componentName']/cellml:variable[@name='variableName']Invalid'.", ], ] @@ -139,19 +139,19 @@ def test_changes(): expected_issues_2 = [ [ loc.Issue.Type.Warning, - "Only changes of type 'changeAttribute' are currently supported. The change of type 'addXML' has been ignored.", + "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'addXML' has been ignored.", ], [ loc.Issue.Type.Warning, - "Only changes of type 'changeAttribute' are currently supported. The change of type 'changeXML' has been ignored.", + "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'changeXML' has been ignored.", ], [ loc.Issue.Type.Warning, - "Only changes of type 'changeAttribute' are currently supported. The change of type 'removeXML' has been ignored.", + "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'removeXML' has been ignored.", ], [ loc.Issue.Type.Warning, - "Only changes of type 'changeAttribute' are currently supported. The change of type 'computeChange' has been ignored.", + "SED-ML file: only changes of type 'changeAttribute' are currently supported. The change of type 'computeChange' has been ignored.", ], ] @@ -269,11 +269,11 @@ def test_tasks(): expected_issues = [ [ loc.Issue.Type.Error, - "Task 'task1' requires a model.", + "Task: task 'task1' requires a model.", ], [ loc.Issue.Type.Error, - "Task 'task1' requires a simulation.", + "Task: task 'task1' requires a simulation.", ], ] @@ -366,7 +366,7 @@ def test_sed_instance_and_sed_instance_task_differential_model(): expected_issues = [ [ loc.Issue.Type.Error, - "The upper half-bandwidth cannot be equal to -1. It must be between 0 and 3.", + "Task instance | CVODE: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 3.", ], ] diff --git a/tests/bindings/python/test_sed_instance.py b/tests/bindings/python/test_sed_instance.py index 2b70228eb..ba35e93cc 100644 --- a/tests/bindings/python/test_sed_instance.py +++ b/tests/bindings/python/test_sed_instance.py @@ -37,11 +37,11 @@ def test_invalid_cellml_file(): expected_issues = [ [ loc.Issue.Type.Error, - "The CellML file is invalid.", + "Task | Model: the CellML file is invalid.", ], [ loc.Issue.Type.Error, - "Equation 'x+y+z' in component 'my_component' is not an equality statement (i.e. LHS = RHS).", + "Task | Model | CellML | Analyser: equation 'x+y+z' in component 'my_component' is not an equality statement (i.e. LHS = RHS).", ], ] @@ -56,11 +56,11 @@ def test_overconstrained_cellml_file(): expected_issues = [ [ loc.Issue.Type.Error, - "The CellML file is overconstrained.", + "Task | Model: the CellML file is overconstrained.", ], [ loc.Issue.Type.Error, - "Variable 'x' in component 'my_component' is computed more than once.", + "Task | Model | CellML | Analyser: variable 'x' in component 'my_component' is computed more than once.", ], ] @@ -75,11 +75,11 @@ def test_underconstrained_cellml_file(): expected_issues = [ [ loc.Issue.Type.Error, - "The CellML file is underconstrained.", + "Task | Model: the CellML file is underconstrained.", ], [ loc.Issue.Type.Error, - "The type of variable 'x' in component 'my_component' is unknown.", + "Task | Model | CellML | Analyser: the type of variable 'x' in component 'my_component' is unknown.", ], ] @@ -94,15 +94,15 @@ def test_unsuitable_constrained_cellml_file(): expected_issues = [ [ loc.Issue.Type.Error, - "The CellML file is unsuitably constrained.", + "Task | Model: the CellML file is unsuitably constrained.", ], [ loc.Issue.Type.Error, - "Variable 'y' in component 'my_component' is computed more than once.", + "Task | Model | CellML | Analyser: variable 'y' in component 'my_component' is computed more than once.", ], [ loc.Issue.Type.Error, - "The type of variable 'x' in component 'my_component' is unknown.", + "Task | Model | CellML | Analyser: the type of variable 'x' in component 'my_component' is unknown.", ], ] @@ -132,9 +132,9 @@ def run_ode_model(): [ loc.Issue.Type.Error, ( - "At t = 0.00140013827899707, mxstep steps taken before reaching tout." + "Task | CVODE: at t = 0.00140013827899707, mxstep steps taken before reaching tout." if platform.system() == "Darwin" - else "At t = 0.00140013827899996, mxstep steps taken before reaching tout." + else "Task | CVODE: at t = 0.00140013827899996, mxstep steps taken before reaching tout." ), ], ] @@ -171,7 +171,7 @@ def test_ode_model_with_no_ode_solver(): expected_issues = [ [ loc.Issue.Type.Error, - "Simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided.", + "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided.", ], ] @@ -189,7 +189,7 @@ def test_nla_model(): expected_issues = [ [ loc.Issue.Type.Error, - "The upper half-bandwidth cannot be equal to -1. It must be between 0 and 0.", + "Task instance | KINSOL: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 0.", ], ] @@ -216,7 +216,7 @@ def test_nla_model_with_no_nla_solver(): expected_issues = [ [ loc.Issue.Type.Error, - "Simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided.", + "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided.", ], ] @@ -234,7 +234,7 @@ def test_dae_model(): expected_issues = [ [ loc.Issue.Type.Error, - "The upper half-bandwidth cannot be equal to -1. It must be between 0 and 0.", + "Task instance | KINSOL: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 0.", ], ] @@ -267,11 +267,11 @@ def test_dae_model_with_no_ode_or_nla_solver(): expected_issues = [ [ loc.Issue.Type.Error, - "Simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided.", + "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an ODE solver but none is provided.", ], [ loc.Issue.Type.Error, - "Simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided.", + "Task | Simulation: simulation 'simulation1' is to be used with model 'model1' which requires an NLA solver but none is provided.", ], ] diff --git a/tests/bindings/python/test_sed_serialise.py b/tests/bindings/python/test_sed_serialise.py index 6c5bbdf6b..fbe7a540b 100644 --- a/tests/bindings/python/test_sed_serialise.py +++ b/tests/bindings/python/test_sed_serialise.py @@ -564,7 +564,7 @@ def test_sedml_file(): expected_issues = [ [ loc.Issue.Type.Warning, - "The model 'cellml_2.cellml' could not be found in the file manager. It has been automatically added to it.", + "SED-ML file: the model 'cellml_2.cellml' could not be found in the file manager. It has been automatically added to it.", ], ] expected_serialisation = """ @@ -608,163 +608,163 @@ def test_sed_simulation(): expected_issues = [ [ loc.Issue.Type.Warning, - "The solver 'KISAO:1234567' is not recognised. The CVODE solver will be used instead.", + "SED-ML file: the solver 'KISAO:1234567' is not recognised. The CVODE solver will be used instead.", ], [ loc.Issue.Type.Warning, - "The parameter 'KISAO:1234567' is not recognised. It will be ignored.", + "SED-ML file | Forward Euler: the parameter 'KISAO:1234567' is not recognised. It will be ignored.", ], [ loc.Issue.Type.Warning, - "The step ('KISAO:0000483') cannot be equal to '-1.23'. It must be greater or equal to 0. A step of 1 will be used instead.", + "SED-ML file | Fourth-order Runge-Kutta: the step ('KISAO:0000483') cannot be equal to '-1.23'. It must be greater or equal to 0. A step of 1 will be used instead.", ], [ loc.Issue.Type.Warning, - "The step ('KISAO:0000483') cannot be equal to 'nan'. It must be greater or equal to 0. A step of 1 will be used instead.", + "SED-ML file | Heun: the step ('KISAO:0000483') cannot be equal to 'nan'. It must be greater or equal to 0. A step of 1 will be used instead.", ], [ loc.Issue.Type.Warning, - "The step ('KISAO:0000483') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A step of 1 will be used instead.", + "SED-ML file | Second-order Runge-Kutta: the step ('KISAO:0000483') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A step of 1 will be used instead.", ], [ loc.Issue.Type.Warning, - "The parameter 'KISAO:1234567' is not recognised. It will be ignored.", + "SED-ML file | CVODE: the parameter 'KISAO:1234567' is not recognised. It will be ignored.", ], [ loc.Issue.Type.Warning, - "The relative tolerance ('KISAO:0000209') cannot be equal to '-1e-03'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead.", + "SED-ML file | CVODE: the relative tolerance ('KISAO:0000209') cannot be equal to '-1e-03'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead.", ], [ loc.Issue.Type.Warning, - "The absolute tolerance ('KISAO:0000211') cannot be equal to '-1e-05'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead.", + "SED-ML file | CVODE: the absolute tolerance ('KISAO:0000211') cannot be equal to '-1e-05'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead.", ], [ loc.Issue.Type.Warning, - "The maximum number of steps ('KISAO:0000415') cannot be equal to '-369'. It must be greater than 0. A maximum number of steps of 500 will be used instead.", + "SED-ML file | CVODE: the maximum number of steps ('KISAO:0000415') cannot be equal to '-369'. It must be greater than 0. A maximum number of steps of 500 will be used instead.", ], [ loc.Issue.Type.Warning, - "The maximum step ('KISAO:0000467') cannot be equal to '-0.01'. It must be greater or equal to 0. A maximum step of 0 will be used instead.", + "SED-ML file | CVODE: the maximum step ('KISAO:0000467') cannot be equal to '-0.01'. It must be greater or equal to 0. A maximum step of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", + "SED-ML file | CVODE: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", + "SED-ML file | CVODE: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The relative tolerance ('KISAO:0000209') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead.", + "SED-ML file | CVODE: the relative tolerance ('KISAO:0000209') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead.", ], [ loc.Issue.Type.Warning, - "The absolute tolerance ('KISAO:0000211') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead.", + "SED-ML file | CVODE: the absolute tolerance ('KISAO:0000211') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead.", ], [ loc.Issue.Type.Warning, - "The maximum number of steps ('KISAO:0000415') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of steps of 500 will be used instead.", + "SED-ML file | CVODE: the maximum number of steps ('KISAO:0000415') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of steps of 500 will be used instead.", ], [ loc.Issue.Type.Warning, - "The maximum step ('KISAO:0000467') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A maximum step of 0 will be used instead.", + "SED-ML file | CVODE: the maximum step ('KISAO:0000467') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A maximum step of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The integration method ('KISAO:0000475') cannot be equal to 'Unknown'. It must be equal to 'BDF' or 'Adams-Moulton'. A BDF integration method will be used instead.", + "SED-ML file | CVODE: the integration method ('KISAO:0000475') cannot be equal to 'Unknown'. It must be equal to 'BDF' or 'Adams-Moulton'. A BDF integration method will be used instead.", ], [ loc.Issue.Type.Warning, - "The iteration type ('KISAO:0000476') cannot be equal to 'Unknown'. It must be equal to 'Functional' or 'Newton'. A Newton iteration type will be used instead.", + "SED-ML file | CVODE: the iteration type ('KISAO:0000476') cannot be equal to 'Unknown'. It must be equal to 'Functional' or 'Newton'. A Newton iteration type will be used instead.", ], [ loc.Issue.Type.Warning, - "The preconditioner ('KISAO:0000478') cannot be equal to 'Unknown'. It must be equal to 'No' or 'Banded'. A Banded preconditioner will be used instead.", + "SED-ML file | CVODE: the preconditioner ('KISAO:0000478') cannot be equal to 'Unknown'. It must be equal to 'No' or 'Banded'. A Banded preconditioner will be used instead.", ], [ loc.Issue.Type.Warning, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", + "SED-ML file | CVODE: the upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", + "SED-ML file | CVODE: the lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The interpolate solution parameter ('KISAO:0000481') cannot be equal to 'True'. It must be equal to 'true' or 'false'. A value of true will be used instead.", + "SED-ML file | CVODE: the interpolate solution parameter ('KISAO:0000481') cannot be equal to 'True'. It must be equal to 'true' or 'false'. A value of true will be used instead.", ], [ loc.Issue.Type.Warning, - "The relative tolerance ('KISAO:0000209') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead.", + "SED-ML file | CVODE: the relative tolerance ('KISAO:0000209') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A relative tolerance of 1e-07 will be used instead.", ], [ loc.Issue.Type.Warning, - "The absolute tolerance ('KISAO:0000211') cannot be equal to '1.23e456789'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead.", + "SED-ML file | CVODE: the absolute tolerance ('KISAO:0000211') cannot be equal to '1.23e456789'. It must be greater or equal to 0. An absolute tolerance of 1e-07 will be used instead.", ], [ loc.Issue.Type.Warning, - "The maximum number of steps ('KISAO:0000415') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of steps of 500 will be used instead.", + "SED-ML file | CVODE: the maximum number of steps ('KISAO:0000415') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of steps of 500 will be used instead.", ], [ loc.Issue.Type.Warning, - "The maximum step ('KISAO:0000467') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A maximum step of 0 will be used instead.", + "SED-ML file | CVODE: the maximum step ('KISAO:0000467') cannot be equal to '1.23e456789'. It must be greater or equal to 0. A maximum step of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", + "SED-ML file | CVODE: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", + "SED-ML file | CVODE: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'Diagonal', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead.", + "SED-ML file | CVODE: the linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'Diagonal', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead.", ], [ loc.Issue.Type.Warning, - "The parameter 'KISAO:1234567' is not recognised. It will be ignored.", + "SED-ML file | KINSOL: the parameter 'KISAO:1234567' is not recognised. It will be ignored.", ], [ loc.Issue.Type.Warning, - "The maximum number of iterations ('KISAO:0000486') cannot be equal to '-123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead.", + "SED-ML file | KINSOL: the maximum number of iterations ('KISAO:0000486') cannot be equal to '-123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead.", ], [ loc.Issue.Type.Warning, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", + "SED-ML file | KINSOL: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '-1'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", + "SED-ML file | KINSOL: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '-2'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The maximum number of iterations ('KISAO:0000486') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of iterations of 200 will be used instead.", + "SED-ML file | KINSOL: the maximum number of iterations ('KISAO:0000486') cannot be equal to 'NotANumber'. It must be greater than 0. A maximum number of iterations of 200 will be used instead.", ], [ loc.Issue.Type.Warning, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", + "SED-ML file | KINSOL: the upper half-bandwidth ('KISAO:0000479') cannot be equal to 'NotANumber'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", + "SED-ML file | KINSOL: the lower half-bandwidth ('KISAO:0000480') cannot be equal to 'NotANumber'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The maximum number of iterations ('KISAO:0000486') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead.", + "SED-ML file | KINSOL: the maximum number of iterations ('KISAO:0000486') cannot be equal to '1234567890123'. It must be greater than 0. A maximum number of iterations of 200 will be used instead.", ], [ loc.Issue.Type.Warning, - "The upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", + "SED-ML file | KINSOL: the upper half-bandwidth ('KISAO:0000479') cannot be equal to '1234567890123'. It must be greater or equal to 0. An upper half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", + "SED-ML file | KINSOL: the lower half-bandwidth ('KISAO:0000480') cannot be equal to '1234567890123'. It must be greater or equal to 0. A lower half-bandwidth of 0 will be used instead.", ], [ loc.Issue.Type.Warning, - "The linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead.", + "SED-ML file | KINSOL: the linear solver ('KISAO:0000477') cannot be equal to 'Unknown'. It must be equal to 'Dense', 'Banded', 'GMRES', 'BiCGStab', or 'TFQMR'. A Dense linear solver will be used instead.", ], ] expected_serialisation = """ diff --git a/tests/bindings/python/test_solver_coverage.py b/tests/bindings/python/test_solver_coverage.py index 2beb536e0..8092a1901 100644 --- a/tests/bindings/python/test_solver_coverage.py +++ b/tests/bindings/python/test_solver_coverage.py @@ -23,19 +23,19 @@ def test_ode_changes(): expected_issues = [ [ loc.Issue.Type.Warning, - "The variable of integration 'time' in component 'environment'cannot be changed. Only state variables and constants can be changed.", + "Task instance | Change attribute: the variable of integration 'time' in component 'environment'cannot be changed. Only state variables and constants can be changed.", ], [ loc.Issue.Type.Warning, - "The variable 'membrane' in component 'X'could not be found and therefore could not be changed.", + "Task instance | Change attribute: the variable 'membrane' in component 'X'could not be found and therefore could not be changed.", ], [ loc.Issue.Type.Warning, - "The computed constant 'E_Na' in component 'sodium_channel' cannot be changed. Only state variables and constants can be changed.", + "Task instance | Change attribute: the computed constant 'E_Na' in component 'sodium_channel' cannot be changed. Only state variables and constants can be changed.", ], [ loc.Issue.Type.Warning, - "The algebraic variable 'i_Stim' in component 'membrane' cannot be changed. Only state variables and constants can be changed.", + "Task instance | Change attribute: the algebraic variable 'i_Stim' in component 'membrane' cannot be changed. Only state variables and constants can be changed.", ], ] diff --git a/tests/bindings/python/test_solver_cvode.py b/tests/bindings/python/test_solver_cvode.py index 81c882392..60c2d1cae 100644 --- a/tests/bindings/python/test_solver_cvode.py +++ b/tests/bindings/python/test_solver_cvode.py @@ -24,7 +24,7 @@ def test_maximum_step_value_with_invalid_number(): expected_issues = [ [ loc.Issue.Type.Error, - "The maximum step cannot be equal to -1.234. It must be greater or equal to 0.", + "Task instance | CVODE: the maximum step cannot be equal to -1.234. It must be greater or equal to 0.", ] ] @@ -44,7 +44,7 @@ def test_maximum_number_of_steps_value_with_invalid_number(): expected_issues = [ [ loc.Issue.Type.Error, - "The maximum number of steps cannot be equal to 0. It must be greater than 0.", + "Task instance | CVODE: the maximum number of steps cannot be equal to 0. It must be greater than 0.", ] ] @@ -64,7 +64,7 @@ def test_banded_linear_solver_and_upper_half_bandwidth_value_with_number_too_sma expected_issues = [ [ loc.Issue.Type.Error, - "The upper half-bandwidth cannot be equal to -1. It must be between 0 and 3.", + "Task instance | CVODE: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 3.", ] ] @@ -85,7 +85,7 @@ def test_banded_linear_solver_and_upper_half_bandwidth_value_with_number_too_big expected_issues = [ [ loc.Issue.Type.Error, - "The upper half-bandwidth cannot be equal to 4. It must be between 0 and 3.", + "Task instance | CVODE: the upper half-bandwidth cannot be equal to 4. It must be between 0 and 3.", ] ] @@ -106,7 +106,7 @@ def test_banded_linear_solver_and_lower_half_bandwidth_value_with_number_too_sma expected_issues = [ [ loc.Issue.Type.Error, - "The lower half-bandwidth cannot be equal to -1. It must be between 0 and 3.", + "Task instance | CVODE: the lower half-bandwidth cannot be equal to -1. It must be between 0 and 3.", ] ] @@ -127,7 +127,7 @@ def test_banded_linear_solver_and_lower_half_bandwidth_value_with_number_too_big expected_issues = [ [ loc.Issue.Type.Error, - "The lower half-bandwidth cannot be equal to 4. It must be between 0 and 3.", + "Task instance | CVODE: the lower half-bandwidth cannot be equal to 4. It must be between 0 and 3.", ] ] @@ -148,7 +148,7 @@ def test_relative_tolerance_value_with_invalid_number(): expected_issues = [ [ loc.Issue.Type.Error, - "The relative tolerance cannot be equal to -1.234. It must be greater or equal to 0.", + "Task instance | CVODE: the relative tolerance cannot be equal to -1.234. It must be greater or equal to 0.", ] ] @@ -168,7 +168,7 @@ def test_absolute_tolerance_value_with_invalid_number(): expected_issues = [ [ loc.Issue.Type.Error, - "The absolute tolerance cannot be equal to -1.234. It must be greater or equal to 0.", + "Task instance | CVODE: the absolute tolerance cannot be equal to -1.234. It must be greater or equal to 0.", ] ] diff --git a/tests/bindings/python/test_solver_forwardeuler.py b/tests/bindings/python/test_solver_forwardeuler.py index a1d57a3e1..0bedfc999 100644 --- a/tests/bindings/python/test_solver_forwardeuler.py +++ b/tests/bindings/python/test_solver_forwardeuler.py @@ -23,7 +23,7 @@ def test_step_value_with_invalid_number(): expected_issues = [ [ loc.Issue.Type.Error, - "The step cannot be equal to 0. It must be greater than 0.", + "Task instance | Forward Euler: the step cannot be equal to 0. It must be greater than 0.", ], ] diff --git a/tests/bindings/python/test_solver_fourthorderrungekutta.py b/tests/bindings/python/test_solver_fourthorderrungekutta.py index e987d9463..ea0c10860 100644 --- a/tests/bindings/python/test_solver_fourthorderrungekutta.py +++ b/tests/bindings/python/test_solver_fourthorderrungekutta.py @@ -23,7 +23,7 @@ def test_step_value_with_invalid_number(): expected_issues = [ [ loc.Issue.Type.Error, - "The step cannot be equal to 0. It must be greater than 0.", + "Task instance | Fourth-order Runge-Kutta: the step cannot be equal to 0. It must be greater than 0.", ], ] diff --git a/tests/bindings/python/test_solver_heun.py b/tests/bindings/python/test_solver_heun.py index c3d4cffb2..76451abb0 100644 --- a/tests/bindings/python/test_solver_heun.py +++ b/tests/bindings/python/test_solver_heun.py @@ -23,7 +23,7 @@ def test_step_value_with_invalid_number(): expected_issues = [ [ loc.Issue.Type.Error, - "The step cannot be equal to 0. It must be greater than 0.", + "Task instance | Heun: the step cannot be equal to 0. It must be greater than 0.", ], ] diff --git a/tests/bindings/python/test_solver_kinsol.py b/tests/bindings/python/test_solver_kinsol.py index 6e2b1706b..557de6c9f 100644 --- a/tests/bindings/python/test_solver_kinsol.py +++ b/tests/bindings/python/test_solver_kinsol.py @@ -24,7 +24,7 @@ def test_maximum_number_of_iterations_value_with_invalid_number(): expected_issues = [ [ loc.Issue.Type.Error, - "The maximum number of iterations cannot be equal to 0. It must be greater than 0.", + "Task instance | KINSOL: the maximum number of iterations cannot be equal to 0. It must be greater than 0.", ] ] @@ -44,7 +44,7 @@ def test_banded_linear_solver_and_upper_half_bandwidth_value_with_number_too_sma expected_issues = [ [ loc.Issue.Type.Error, - "The upper half-bandwidth cannot be equal to -1. It must be between 0 and 2.", + "Task instance | KINSOL: the upper half-bandwidth cannot be equal to -1. It must be between 0 and 2.", ] ] @@ -65,7 +65,7 @@ def test_banded_linear_solver_and_upper_half_bandwidth_value_with_number_too_big expected_issues = [ [ loc.Issue.Type.Error, - "The upper half-bandwidth cannot be equal to 1. It must be between 0 and 0.", + "Task instance | KINSOL: the upper half-bandwidth cannot be equal to 1. It must be between 0 and 0.", ] ] @@ -86,7 +86,7 @@ def test_banded_linear_solver_and_lower_half_bandwidth_value_with_number_too_sma expected_issues = [ [ loc.Issue.Type.Error, - "The lower half-bandwidth cannot be equal to -1. It must be between 0 and 2.", + "Task instance | KINSOL: the lower half-bandwidth cannot be equal to -1. It must be between 0 and 2.", ] ] @@ -107,7 +107,7 @@ def test_banded_linear_solver_and_lower_half_bandwidth_value_with_number_too_big expected_issues = [ [ loc.Issue.Type.Error, - "The lower half-bandwidth cannot be equal to 1. It must be between 0 and 0.", + "Task instance | KINSOL: the lower half-bandwidth cannot be equal to 1. It must be between 0 and 0.", ] ] diff --git a/tests/bindings/python/test_solver_secondorderrungekutta.py b/tests/bindings/python/test_solver_secondorderrungekutta.py index fb8c4c31a..6ad15ae78 100644 --- a/tests/bindings/python/test_solver_secondorderrungekutta.py +++ b/tests/bindings/python/test_solver_secondorderrungekutta.py @@ -23,7 +23,7 @@ def test_step_value_with_invalid_number(): expected_issues = [ [ loc.Issue.Type.Error, - "The step cannot be equal to 0. It must be greater than 0.", + "Task instance | Second-order Runge-Kutta: the step cannot be equal to 0. It must be greater than 0.", ], ] diff --git a/tests/support/cellml/runtimetests.cpp b/tests/support/cellml/runtimetests.cpp index 629edc03f..1c5a9503a 100644 --- a/tests/support/cellml/runtimetests.cpp +++ b/tests/support/cellml/runtimetests.cpp @@ -32,8 +32,8 @@ TEST(RuntimeCellmlTest, validRuntime) TEST(RuntimeCellmlTest, invalidRuntimeBecauseOfAnalysisIssues) { static const libOpenCOR::ExpectedIssues expectedIssues {{ - {libOpenCOR::Issue::Type::WARNING, "The units in 'x = 1.0' in component 'my_component' are not equivalent. 'x' is in 'volt' (i.e. 'ampere^-1 x kilogram x metre^2 x second^-3') while '1.0' is 'dimensionless'."}, - {libOpenCOR::Issue::Type::ERROR, "Variable 'x' in component 'my_component' is computed more than once."}, + {libOpenCOR::Issue::Type::WARNING, "Analyser: the units in 'x = 1.0' in component 'my_component' are not equivalent. 'x' is in 'volt' (i.e. 'ampere^-1 x kilogram x metre^2 x second^-3') while '1.0' is 'dimensionless'."}, + {libOpenCOR::Issue::Type::ERROR, "Analyser: variable 'x' in component 'my_component' is computed more than once."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("support/cellml/model_with_analysis_issues.cellml"))}; From 913a4a94d85b813d58b8c1230014a10c38bbf257 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 30 Oct 2025 19:28:57 +1300 Subject: [PATCH 2/2] KINSOL: add a more useful error message when an NLA system contains some Inf and/or NaN value. --- src/solver/solverkinsol.cpp | 2 +- tests/api/sed/coveragetests.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/solver/solverkinsol.cpp b/src/solver/solverkinsol.cpp index 90bcee29e..83427b8b5 100644 --- a/src/solver/solverkinsol.cpp +++ b/src/solver/solverkinsol.cpp @@ -389,7 +389,7 @@ bool SolverKinsol::Impl::solve(ComputeObjectiveFunction pComputeObjectiveFunctio #ifndef CODE_COVERAGE_ENABLED if (userData.infOrNanFound) { #endif - addError("The input vector contains some Inf and/or NaN values."); + addError("The NLA system could not be solved (it contains some Inf and/or NaN values)."); #ifndef CODE_COVERAGE_ENABLED } else { addError(mErrorMessage); diff --git a/tests/api/sed/coveragetests.cpp b/tests/api/sed/coveragetests.cpp index 86c82c6ce..935710e34 100644 --- a/tests/api/sed/coveragetests.cpp +++ b/tests/api/sed/coveragetests.cpp @@ -590,7 +590,7 @@ TEST(CoverageSedTest, math) TEST(CoverageSedTest, KinsolWithInfAndOrNanValues) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES = { - {libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the input vector contains some Inf and/or NaN values."}, + {libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the NLA system could not be solved (it contains some Inf and/or NaN values)."}, }; auto file = libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/kinsol_with_inf_and_or_nan_values.cellml"));