Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ jobs:
run: uv pip install --system pytest pytest-html
- name: Install Sphinx and some Sphinx packages
if: ${{ matrix.documentation == 'ON' }}
run: uv pip install --system sphinx sphinx-copybutton sphinx-inline-tabs
run: uv pip install --system sphinx~=8.0 sphinx-copybutton sphinx-inline-tabs
- name: Install Doxygen
if: ${{ matrix.documentation == 'ON' }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.20251030.0
0.20251204.0
10 changes: 10 additions & 0 deletions cmake/environmentchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,19 @@ endif()

if(DOXYGEN_EXE AND PATCH_EXE AND PYTHON_EXE AND SPHINX_EXE)
set(EXPECTED_DOXYGEN_VERSION 1.9.3)
set(UNSUPPORTED_SPHINX_VERSION 9.0.0)

execute_process(COMMAND ${SPHINX_EXE} --version
OUTPUT_VARIABLE SPHINX_VERSION_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)

string(REGEX REPLACE "^sphinx-build ([0-9]+\\.[0-9]+\\.[0-9]+).*$" "\\1" SPHINX_VERSION "${SPHINX_VERSION_OUTPUT}")

if(NOT DOXYGEN_VERSION VERSION_EQUAL EXPECTED_DOXYGEN_VERSION)
set(DOCUMENTATION_AVAILABLE_ERROR_MESSAGE "Documentation is requested and Doxygen ${DOXYGEN_VERSION} was found, but version ${EXPECTED_DOXYGEN_VERSION} is needed.")
elseif(SPHINX_VERSION VERSION_GREATER_EQUAL UNSUPPORTED_SPHINX_VERSION)
set(DOCUMENTATION_AVAILABLE_ERROR_MESSAGE "Documentation is requested and Sphinx ${SPHINX_VERSION} was found, but version ${UNSUPPORTED_SPHINX_VERSION}+ is not supported." )
else()
check_python_package(sphinx-copybutton PYTHON_SPHINX_COPY_BUTTON_AVAILABLE)
check_python_package(sphinx-inline-tabs PYTHON_SPHINX_INLINE_TABS_AVAILABLE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function(retrieve_package PACKAGE_NAME PACKAGE_VERSION PACKAGE_REPOSITORY RELEAS
if("${PACKAGE_NAME}" STREQUAL "libCellML")
#---GRY--- USE THIS VERSION OF libCellML WHICH CORRESPONDS TO PR #1256 UNTIL IT GETS MERGED IN.

set(PACKAGE_URL "https://github.com/agarny/${PACKAGE_REPOSITORY}/releases/download/6d27883/${PACKAGE_FILE}")
set(PACKAGE_URL "https://github.com/agarny/${PACKAGE_REPOSITORY}/releases/download/7cc5bea/${PACKAGE_FILE}")
endif()

set(ATTEMPT 1)
Expand Down
2 changes: 1 addition & 1 deletion extern/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[libOpenCOR](https://opencor.ws/libopencor/index.html) relies on the following external projects:

- [GoogleTest](https://github.com/google/googletest) [1.17.0](https://github.com/google/googletest/releases/tag/v1.17.0)
- [modp_b64](https://chromium.googlesource.com/chromium/src/third_party/modp_b64/) at commit [bcb074f](https://chromium.googlesource.com/chromium/src/third_party/modp_b64/+/bcb074f6614b4cbda45c9f87f968f6743266a52a)
- [modp_b64](https://chromium.googlesource.com/chromium/src/third_party/modp_b64/) at commit [5068510](https://chromium.googlesource.com/chromium/src/third_party/modp_b64/+/50685101d51ef9aabbd60c94f52d9e026d39c509)
- [nanobind](https://github.com/wjakob/nanobind) [2.9.2](https://github.com/wjakob/nanobind/releases/tag/v2.9.2)
1 change: 1 addition & 0 deletions extern/modp_b64/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Short Name: stringencoders
URL: https://github.com/client9/stringencoders
Version: 2.0.0
Revision: 26701a1c1fcb98ae43eefcaee23abc58459a6e59
Update Mechanism: Static.HardFork (https://crbug.com/422922180)
License: BSD-3-Clause
License File: LICENSE
Security Critical: yes
Expand Down
20 changes: 10 additions & 10 deletions src/3rdparty/libCellML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,49 +34,49 @@ if(LIBOPENCOR_PREBUILT_LIBCELLML)
if(EMSCRIPTEN)
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
f3087749522fb85a72d440180b9b4c3b5bf77eb4)
5bee3b3c508fb274e084468243b43d9f83647beb)
else()
if(WIN32)
if(RELEASE_MODE)
if(INTEL_MODE)
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
b1bfb0c9d197e7b858f5f27f305bda5ae40a9ad7)
d277ce028be3806aa2514ba27ec4bed352faf069)
else()
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
4d06110bb96f71cff8f1fb0e0e463f94920f8fa9)
388a936417a5681fbcf835bdda20e8ed0fbf3382)
endif()
else()
if(INTEL_MODE)
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
214b685fbaf9c616739ad8786800b75d59a47f8b)
c768d8c59db5ee4a07baa0fc61d7a8ccac4ea6db)
else()
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
0d6d70f9fdf7443d82016216a78be7d2acea2e7e)
2fd521abaf83b480e5b07c746ae310be529faa7e)
endif()
endif()
elseif(APPLE)
if(INTEL_MODE)
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
8ccd4a8a95a3b4b243d900746340f167d9f31075)
055181384ac2e4e942603c6b1f3d0c20f439b523)
else()
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
72b1e4f2e4a2b76a0d45efced9ef96cbba263d66)
847c024d893e3a1f73172e8f6d2e55136e46dd86)
endif()
else()
if(INTEL_MODE)
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
623866e3cf071f652fe778a22868b5c6917db6f9)
f8d847dffd74264a3074e742149dca0ab4c57653)
else()
retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION}
${PACKAGE_REPOSITORY} ${RELEASE_TAG}
9742ef210ca1cc88549b802c6f0fc5d1c0670f25)
674bb536a67cc7e7d4afef553c843ac38d44d43f)
endif()
endif()
endif()
Expand All @@ -86,7 +86,7 @@ elseif(NOT ONLY_BUILD_JAVASCRIPT_THIRD_PARTY_LIBRARIES)
build_package(${PACKAGE_NAME}
URL
# https://github.com/opencor/${PACKAGE_REPOSITORY}/archive/refs/tags/${RELEASE_TAG}.tar.gz
https://github.com/agarny/${PACKAGE_REPOSITORY}/archive/refs/tags/6d27883.tar.gz
https://github.com/agarny/${PACKAGE_REPOSITORY}/archive/refs/tags/7cc5bea.tar.gz
DOWNLOAD_NO_PROGRESS ON
CMAKE_ARGS
-DBINDINGS_PYTHON=OFF
Expand Down
10 changes: 5 additions & 5 deletions src/api/libopencor/sedinstancetask.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class LIBOPENCOR_EXPORT SedInstanceTask: public Logger
* @return The number of algebraic variables.
*/

size_t algebraicCount() const;
size_t algebraicVariableCount() const;

/**
* @brief Get the values of the algebraic variable at the given index.
Expand All @@ -300,10 +300,10 @@ class LIBOPENCOR_EXPORT SedInstanceTask: public Logger
* @return The values of the algebraic variable, as a @c Doubles, if the index is valid, an empty vector otherwise.
*/

Doubles algebraic(size_t pIndex) const;
Doubles algebraicVariable(size_t pIndex) const;

#ifdef __EMSCRIPTEN__
emscripten::val algebraicAsArray(size_t pIndex) const;
emscripten::val algebraicVariableAsArray(size_t pIndex) const;
#endif

/**
Expand All @@ -317,7 +317,7 @@ class LIBOPENCOR_EXPORT SedInstanceTask: public Logger
* otherwise.
*/

std::string algebraicName(size_t pIndex) const;
std::string algebraicVariableName(size_t pIndex) const;

/**
* @brief Get the unit of the algebraic variable.
Expand All @@ -330,7 +330,7 @@ class LIBOPENCOR_EXPORT SedInstanceTask: public Logger
* otherwise.
*/

std::string algebraicUnit(size_t pIndex) const;
std::string algebraicVariableUnit(size_t pIndex) const;

private:
class Impl; /**< Forward declaration of the implementation class, @private. */
Expand Down
10 changes: 5 additions & 5 deletions src/bindings/javascript/sed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ void sedApi()
.function("computedConstantAsArray", &libOpenCOR::SedInstanceTask::computedConstantAsArray)
.function("computedConstantName", &libOpenCOR::SedInstanceTask::computedConstantName)
.function("computedConstantUnit", &libOpenCOR::SedInstanceTask::computedConstantUnit)
.property("algebraicCount", &libOpenCOR::SedInstanceTask::algebraicCount)
.function("algebraic", &libOpenCOR::SedInstanceTask::algebraic)
.function("algebraicAsArray", &libOpenCOR::SedInstanceTask::algebraicAsArray)
.function("algebraicName", &libOpenCOR::SedInstanceTask::algebraicName)
.function("algebraicUnit", &libOpenCOR::SedInstanceTask::algebraicUnit);
.property("algebraicVariableCount", &libOpenCOR::SedInstanceTask::algebraicVariableCount)
.function("algebraicVariable", &libOpenCOR::SedInstanceTask::algebraicVariable)
.function("algebraicVariableAsArray", &libOpenCOR::SedInstanceTask::algebraicVariableAsArray)
.function("algebraicVariableName", &libOpenCOR::SedInstanceTask::algebraicVariableName)
.function("algebraicVariableUnit", &libOpenCOR::SedInstanceTask::algebraicVariableUnit);

// SedModel API.

Expand Down
8 changes: 4 additions & 4 deletions src/bindings/python/sed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ void sedApi(nb::module_ &m)
.def("computed_constant", &libOpenCOR::SedInstanceTask::computedConstant, "Return the values of a computed constant.")
.def("computed_constant_name", &libOpenCOR::SedInstanceTask::computedConstantName, "Return the name of a computed constant.")
.def("computed_constant_unit", &libOpenCOR::SedInstanceTask::computedConstantUnit, "Return the unit of a computed constant.")
.def_prop_ro("algebraic_count", &libOpenCOR::SedInstanceTask::algebraicCount, "Return the number of algebraic variables.")
.def("algebraic", &libOpenCOR::SedInstanceTask::algebraic, "Return the values of an algebraic variable.")
.def("algebraic_name", &libOpenCOR::SedInstanceTask::algebraicName, "Return the name of an algebraic variable.")
.def("algebraic_unit", &libOpenCOR::SedInstanceTask::algebraicUnit, "Return the unit of an algebraic variable.");
.def_prop_ro("algebraic_variable_count", &libOpenCOR::SedInstanceTask::algebraicVariableCount, "Return the number of algebraic variables.")
.def("algebraic_variable", &libOpenCOR::SedInstanceTask::algebraicVariable, "Return the values of an algebraic variable.")
.def("algebraic_variable_name", &libOpenCOR::SedInstanceTask::algebraicVariableName, "Return the name of an algebraic variable.")
.def("algebraic_variable_unit", &libOpenCOR::SedInstanceTask::algebraicVariableUnit, "Return the unit of an algebraic variable.");

// SedModel API.

Expand Down
10 changes: 5 additions & 5 deletions src/sed/sedchangeattribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void SedChangeAttribute::Impl::apply(const SedInstanceTaskPtr &pInstanceTask,
auto voiVariable {pAnalyserModel->voi()->variable()};
auto voiComponent {owningComponent(voiVariable)};

addWarning(std::string("The variable of integration '").append(voiVariable->name()).append("' in component '").append(voiComponent->name()).append("'cannot be changed. Only state variables and constants can be changed."));
addWarning(std::string("The variable of integration '").append(voiVariable->name()).append("' in component '").append(voiComponent->name()).append("' cannot be changed. Only state variables and constants can be changed."));

return;
}
Expand Down Expand Up @@ -140,9 +140,9 @@ void SedChangeAttribute::Impl::apply(const SedInstanceTaskPtr &pInstanceTask,
}

if (!isParameterSet) {
for (size_t i {0}; i < pAnalyserModel->algebraicCount(); ++i) {
if (instanceTaskPimpl->algebraicName(i) == changeName) {
auto algebraicVariable {pAnalyserModel->algebraic()[i]->variable()};
for (size_t i {0}; i < pAnalyserModel->algebraicVariableCount(); ++i) {
if (instanceTaskPimpl->algebraicVariableName(i) == changeName) {
auto algebraicVariable {pAnalyserModel->algebraicVariables()[i]->variable()};
auto algebraicComponent {owningComponent(algebraicVariable)};

addWarning(std::string("The algebraic variable '").append(algebraicVariable->name()).append("' in component '").append(algebraicComponent->name()).append("' cannot be changed. Only state variables and constants can be changed."));
Expand All @@ -155,7 +155,7 @@ void SedChangeAttribute::Impl::apply(const SedInstanceTaskPtr &pInstanceTask,
}

if (!isParameterSet) {
addWarning(std::string("The variable '").append(mComponentName).append("' in component '").append(mVariableName).append("'could not be found and therefore could not be changed."));
addWarning(std::string("The variable '").append(mVariableName).append("' in component '").append(mComponentName).append("' could not be found and therefore could not be changed."));
}
}

Expand Down
58 changes: 29 additions & 29 deletions src/sed/sedinstancetask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ SedInstanceTask::Impl::Impl(const SedAbstractTaskPtr &pTask)

mConstantDoubles.resize(mAnalyserModel->constantCount(), NAN);
mComputedConstantDoubles.resize(mAnalyserModel->computedConstantCount(), NAN);
mAlgebraicDoubles.resize(mAnalyserModel->algebraicCount(), NAN);
mAlgebraicDoubles.resize(mAnalyserModel->algebraicVariableCount(), NAN);

mConstants = mConstantDoubles.data();
mComputedConstants = mComputedConstantDoubles.data();
mAlgebraic = mAlgebraicDoubles.data();

mResults.constants.resize(mAnalyserModel->constantCount(), {});
mResults.computedConstants.resize(mAnalyserModel->computedConstantCount(), {});
mResults.algebraic.resize(mAnalyserModel->algebraicCount(), {});
mResults.algebraic.resize(mAnalyserModel->algebraicVariableCount(), {});
}

void SedInstanceTask::Impl::trackResults(size_t pIndex)
Expand All @@ -124,7 +124,7 @@ void SedInstanceTask::Impl::trackResults(size_t pIndex)
mResults.computedConstants[i][pIndex] = mComputedConstants[i]; // NOLINT
}

for (size_t i {0}; i < mAnalyserModel->algebraicCount(); ++i) {
for (size_t i {0}; i < mAnalyserModel->algebraicVariableCount(); ++i) {
mResults.algebraic[i][pIndex] = mAlgebraic[i]; // NOLINT
}
}
Expand Down Expand Up @@ -157,15 +157,15 @@ void SedInstanceTask::Impl::initialise()
mVoi = mSedUniformTimeCourse->pimpl()->mOutputStartTime;

#ifdef __EMSCRIPTEN__
mRuntime->initialiseVariablesForDifferentialModel(mStates, mRates, mConstants, mComputedConstants, mAlgebraic);
mRuntime->initialiseArraysForDifferentialModel(mStates, mRates, mConstants, mComputedConstants, mAlgebraic);
#else
mRuntime->initialiseVariablesForDifferentialModel()(mStates, mRates, mConstants, mComputedConstants, mAlgebraic);
mRuntime->initialiseArraysForDifferentialModel()(mStates, mRates, mConstants, mComputedConstants, mAlgebraic);
#endif
} else {
#ifdef __EMSCRIPTEN__
mRuntime->initialiseVariablesForAlgebraicModel(mConstants, mComputedConstants, mAlgebraic);
mRuntime->initialiseArraysForAlgebraicModel(mConstants, mComputedConstants, mAlgebraic);
#else
mRuntime->initialiseVariablesForAlgebraicModel()(mConstants, mComputedConstants, mAlgebraic);
mRuntime->initialiseArraysForAlgebraicModel()(mConstants, mComputedConstants, mAlgebraic);
#endif
}

Expand Down Expand Up @@ -245,7 +245,7 @@ double SedInstanceTask::Impl::run()
mResults.computedConstants[i].resize(resultsSize, NAN);
}

for (size_t i {0}; i < mAnalyserModel->algebraicCount(); ++i) {
for (size_t i {0}; i < mAnalyserModel->algebraicVariableCount(); ++i) {
mResults.algebraic[i].resize(resultsSize, NAN);
}

Expand Down Expand Up @@ -302,7 +302,7 @@ double SedInstanceTask::Impl::run()
mResults.computedConstants[i].resize(1, mComputedConstants[i]); // NOLINT
}

for (size_t i {0}; i < mAnalyserModel->algebraicCount(); ++i) {
for (size_t i {0}; i < mAnalyserModel->algebraicVariableCount(); ++i) {
mResults.algebraic[i].resize(1, mAlgebraic[i]); // NOLINT
}
}
Expand Down Expand Up @@ -467,36 +467,36 @@ std::string SedInstanceTask::Impl::computedConstantUnit(size_t pIndex) const
return mAnalyserModel->computedConstants()[pIndex]->variable()->units()->name();
}

size_t SedInstanceTask::Impl::algebraicCount() const
size_t SedInstanceTask::Impl::algebraicVariableCount() const
{
return mAnalyserModel->algebraicCount();
return mAnalyserModel->algebraicVariableCount();
}

Doubles SedInstanceTask::Impl::algebraic(size_t pIndex) const
Doubles SedInstanceTask::Impl::algebraicVariable(size_t pIndex) const
{
if (pIndex >= mAnalyserModel->algebraicCount()) {
if (pIndex >= mAnalyserModel->algebraicVariableCount()) {
return {};
}

return mResults.algebraic[pIndex];
}

std::string SedInstanceTask::Impl::algebraicName(size_t pIndex) const
std::string SedInstanceTask::Impl::algebraicVariableName(size_t pIndex) const
{
if (pIndex >= mAnalyserModel->algebraicCount()) {
if (pIndex >= mAnalyserModel->algebraicVariableCount()) {
return {};
}

return name(mAnalyserModel->algebraic()[pIndex]->variable());
return name(mAnalyserModel->algebraicVariables()[pIndex]->variable());
}

std::string SedInstanceTask::Impl::algebraicUnit(size_t pIndex) const
std::string SedInstanceTask::Impl::algebraicVariableUnit(size_t pIndex) const
{
if (pIndex >= mAnalyserModel->algebraicCount()) {
if (pIndex >= mAnalyserModel->algebraicVariableCount()) {
return {};
}

return mAnalyserModel->algebraic()[pIndex]->variable()->units()->name();
return mAnalyserModel->algebraicVariables()[pIndex]->variable()->units()->name();
}

SedInstanceTask::SedInstanceTask(const SedAbstractTaskPtr &pTask)
Expand Down Expand Up @@ -649,31 +649,31 @@ std::string SedInstanceTask::computedConstantUnit(size_t pIndex) const
return pimpl()->computedConstantUnit(pIndex);
}

size_t SedInstanceTask::algebraicCount() const
size_t SedInstanceTask::algebraicVariableCount() const
{
return pimpl()->algebraicCount();
return pimpl()->algebraicVariableCount();
}

Doubles SedInstanceTask::algebraic(size_t pIndex) const
Doubles SedInstanceTask::algebraicVariable(size_t pIndex) const
{
return pimpl()->algebraic(pIndex);
return pimpl()->algebraicVariable(pIndex);
}

#ifdef __EMSCRIPTEN__
emscripten::val SedInstanceTask::algebraicAsArray(size_t pIndex) const
emscripten::val SedInstanceTask::algebraicVariableAsArray(size_t pIndex) const
{
return emscripten::val::array(algebraic(pIndex));
return emscripten::val::array(algebraicVariable(pIndex));
}
#endif

std::string SedInstanceTask::algebraicName(size_t pIndex) const
std::string SedInstanceTask::algebraicVariableName(size_t pIndex) const
{
return pimpl()->algebraicName(pIndex);
return pimpl()->algebraicVariableName(pIndex);
}

std::string SedInstanceTask::algebraicUnit(size_t pIndex) const
std::string SedInstanceTask::algebraicVariableUnit(size_t pIndex) const
{
return pimpl()->algebraicUnit(pIndex);
return pimpl()->algebraicVariableUnit(pIndex);
}

} // namespace libOpenCOR
8 changes: 4 additions & 4 deletions src/sed/sedinstancetask_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ class SedInstanceTask::Impl: public Logger::Impl
std::string computedConstantName(size_t pIndex) const;
std::string computedConstantUnit(size_t pIndex) const;

size_t algebraicCount() const;
Doubles algebraic(size_t pIndex) const;
std::string algebraicName(size_t pIndex) const;
std::string algebraicUnit(size_t pIndex) const;
size_t algebraicVariableCount() const;
Doubles algebraicVariable(size_t pIndex) const;
std::string algebraicVariableName(size_t pIndex) const;
std::string algebraicVariableUnit(size_t pIndex) const;
};

} // namespace libOpenCOR
Loading
Loading