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
28 changes: 14 additions & 14 deletions src/generatorprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
"#include <stdlib.h>\n";

mInterfaceVersionString = "extern const char VERSION[];\n";
mImplementationVersionString = "const char VERSION[] = \"0.7.0\";\n";
mImplementationVersionString = "const char VERSION[] = \"0.8.0\";\n";

mInterfaceLibcellmlVersionString = "extern const char LIBCELLML_VERSION[];\n";
mImplementationLibcellmlVersionString = "const char LIBCELLML_VERSION[] = \"[LIBCELLML_VERSION]\";\n";
Expand Down Expand Up @@ -269,13 +269,13 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
"[CODE]"
"};\n";

mInterfaceAlgebraicVariableInfoString = "extern const VariableInfo ALGEBRAIC_INFO[];\n";
mImplementationAlgebraicVariableInfoString = "const VariableInfo ALGEBRAIC_INFO[] = {\n"
mInterfaceAlgebraicVariableInfoString = "extern const VariableInfo ALGEBRAIC_VARIABLE_INFO[];\n";
mImplementationAlgebraicVariableInfoString = "const VariableInfo ALGEBRAIC_VARIABLE_INFO[] = {\n"
"[CODE]"
"};\n";

mInterfaceExternalVariableInfoString = "extern const VariableInfo EXTERNAL_INFO[];\n";
mImplementationExternalVariableInfoString = "const VariableInfo EXTERNAL_INFO[] = {\n"
mInterfaceExternalVariableInfoString = "extern const VariableInfo EXTERNAL_VARIABLE_INFO[];\n";
mImplementationExternalVariableInfoString = "const VariableInfo EXTERNAL_VARIABLE_INFO[] = {\n"
"[CODE]"
"};\n";

Expand Down Expand Up @@ -489,14 +489,14 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
"[CODE]"
"}\n";

mInterfaceComputeComputedConstantsMethodNonDiffString = "void computeComputedConstants(double *constants, double *computedConstants, double *algebraic);\n";
mImplementationComputeComputedConstantsMethodNonDiffString = "void computeComputedConstants(double *constants, double *computedConstants, double *algebraic)\n"
mInterfaceComputeComputedConstantsMethodNonDiffString = "void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables);\n";
mImplementationComputeComputedConstantsMethodNonDiffString = "void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables)\n"
"{\n"
"[CODE]"
"}\n";

mInterfaceComputeComputedConstantsMethodDiffString = "void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic);\n";
mImplementationComputeComputedConstantsMethodDiffString = "void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)\n"
mInterfaceComputeComputedConstantsMethodDiffString = "void computeComputedConstants(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);\n";
mImplementationComputeComputedConstantsMethodDiffString = "void computeComputedConstants(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)\n"
"{\n"
"[CODE]"
"}\n";
Expand Down Expand Up @@ -741,7 +741,7 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
"\n";

mInterfaceVersionString = "";
mImplementationVersionString = "__version__ = \"0.6.0\"\n";
mImplementationVersionString = "__version__ = \"0.7.0\"\n";

mInterfaceLibcellmlVersionString = "";
mImplementationLibcellmlVersionString = "LIBCELLML_VERSION = \"[LIBCELLML_VERSION]\"\n";
Expand Down Expand Up @@ -782,12 +782,12 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
"]\n";

mInterfaceAlgebraicVariableInfoString = "";
mImplementationAlgebraicVariableInfoString = "ALGEBRAIC_INFO = [\n"
mImplementationAlgebraicVariableInfoString = "ALGEBRAIC_VARIABLE_INFO = [\n"
"[CODE]"
"]\n";

mInterfaceExternalVariableInfoString = "";
mImplementationExternalVariableInfoString = "EXTERNAL_INFO = [\n"
mImplementationExternalVariableInfoString = "EXTERNAL_VARIABLE_INFO = [\n"
"[CODE]"
"]\n";

Expand Down Expand Up @@ -928,12 +928,12 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi

mInterfaceComputeComputedConstantsMethodNonDiffString = "";
mImplementationComputeComputedConstantsMethodNonDiffString = "\n"
"def compute_computed_constants(constants, computed_constants, algebraic):\n"
"def compute_computed_constants(constants, computed_constants, algebraic_variables):\n"
"[CODE]";

mInterfaceComputeComputedConstantsMethodDiffString = "";
mImplementationComputeComputedConstantsMethodDiffString = "\n"
"def compute_computed_constants(states, rates, constants, computed_constants, algebraic):\n"
"def compute_computed_constants(voi, states, rates, constants, computed_constants, algebraic_variables):\n"
"[CODE]";

mInterfaceComputeRatesMethodWoevString = "";
Expand Down
4 changes: 2 additions & 2 deletions src/generatorprofilesha1values.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace libcellml {
* The content of this file is generated, do not edit this file directly.
* See docs/dev_utilities.rst for further information.
*/
static const char C_GENERATOR_PROFILE_SHA1[] = "24b7a2f82510d2f79aeaee509a1b1b04ea1d749b";
static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "b117a2500aae147f477127f0bfb0e2c9e242c6c8";
static const char C_GENERATOR_PROFILE_SHA1[] = "949c36b0108bc8cf9f41ff563f9ec1369d399a7c";
static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "83fd0b434381e6afb19fce7ab2f4002ad884f3cb";

} // namespace libcellml
2 changes: 1 addition & 1 deletion tests/bindings/javascript/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ set(TEST_PACKAGE_JSON "{
\"author\": \"\",
\"license\": \"Apache-2.0\",
\"devDependencies\": {
\"jest\": \"^26.6.3\"
\"jest\": \"^30.2.0\"
},
\"dependencies\": {
\"libcellml.js\": \"file:${_RELATIVE_PATH}\"
Expand Down
18 changes: 9 additions & 9 deletions tests/bindings/python/test_generator_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,12 @@ def test_implementation_compute_computed_constants_method_string(self):

g = GeneratorProfile()

self.assertEqual('void computeComputedConstants(double *constants, double *computedConstants, double *algebraic)\n{\n[CODE]}\n',
self.assertEqual('void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables)\n{\n[CODE]}\n',
g.implementationComputeComputedConstantsMethodString(False))
g.setImplementationComputeComputedConstantsMethodString(False, GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.implementationComputeComputedConstantsMethodString(False))

self.assertEqual('void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)\n{\n[CODE]}\n',
self.assertEqual('void computeComputedConstants(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)\n{\n[CODE]}\n',
g.implementationComputeComputedConstantsMethodString(True))
g.setImplementationComputeComputedConstantsMethodString(True, GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.implementationComputeComputedConstantsMethodString(True))
Expand Down Expand Up @@ -895,7 +895,7 @@ def test_implementation_algebraic_info_string(self):

g = GeneratorProfile()

self.assertEqual('const VariableInfo ALGEBRAIC_INFO[] = {\n[CODE]};\n', g.implementationAlgebraicVariableInfoString())
self.assertEqual('const VariableInfo ALGEBRAIC_VARIABLE_INFO[] = {\n[CODE]};\n', g.implementationAlgebraicVariableInfoString())
g.setImplementationAlgebraicVariableInfoString(GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.implementationAlgebraicVariableInfoString())

Expand All @@ -904,7 +904,7 @@ def test_implementation_external_info_string(self):

g = GeneratorProfile()

self.assertEqual('const VariableInfo EXTERNAL_INFO[] = {\n[CODE]};\n', g.implementationExternalVariableInfoString())
self.assertEqual('const VariableInfo EXTERNAL_VARIABLE_INFO[] = {\n[CODE]};\n', g.implementationExternalVariableInfoString())
g.setImplementationExternalVariableInfoString(GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.implementationExternalVariableInfoString())

Expand Down Expand Up @@ -949,7 +949,7 @@ def test_implementation_version_string(self):

g = GeneratorProfile()

self.assertEqual('const char VERSION[] = "0.7.0";\n', g.implementationVersionString())
self.assertEqual('const char VERSION[] = "0.8.0";\n', g.implementationVersionString())
g.setImplementationVersionString(GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.implementationVersionString())

Expand Down Expand Up @@ -985,12 +985,12 @@ def test_interface_compute_computed_constants_method_string(self):

g = GeneratorProfile()

self.assertEqual('void computeComputedConstants(double *constants, double *computedConstants, double *algebraic);\n',
self.assertEqual('void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables);\n',
g.interfaceComputeComputedConstantsMethodString(False))
g.setInterfaceComputeComputedConstantsMethodString(False, GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.interfaceComputeComputedConstantsMethodString(False))

self.assertEqual('void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic);\n',
self.assertEqual('void computeComputedConstants(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);\n',
g.interfaceComputeComputedConstantsMethodString(True))
g.setInterfaceComputeComputedConstantsMethodString(True, GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.interfaceComputeComputedConstantsMethodString(True))
Expand Down Expand Up @@ -1178,7 +1178,7 @@ def test_interface_algebraic_info_string(self):

g = GeneratorProfile()

self.assertEqual('extern const VariableInfo ALGEBRAIC_INFO[];\n', g.interfaceAlgebraicVariableInfoString())
self.assertEqual('extern const VariableInfo ALGEBRAIC_VARIABLE_INFO[];\n', g.interfaceAlgebraicVariableInfoString())
g.setInterfaceAlgebraicVariableInfoString(GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.interfaceAlgebraicVariableInfoString())

Expand All @@ -1187,7 +1187,7 @@ def test_interface_external_info_string(self):

g = GeneratorProfile()

self.assertEqual('extern const VariableInfo EXTERNAL_INFO[];\n', g.interfaceExternalVariableInfoString())
self.assertEqual('extern const VariableInfo EXTERNAL_VARIABLE_INFO[];\n', g.interfaceExternalVariableInfoString())
g.setInterfaceExternalVariableInfoString(GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.interfaceExternalVariableInfoString())

Expand Down
18 changes: 9 additions & 9 deletions tests/generator/generatorprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ TEST(GeneratorProfile, defaultMiscellaneousValues)
generatorProfile->implementationHeaderString());

EXPECT_EQ("extern const char VERSION[];\n", generatorProfile->interfaceVersionString());
EXPECT_EQ("const char VERSION[] = \"0.7.0\";\n", generatorProfile->implementationVersionString());
EXPECT_EQ("const char VERSION[] = \"0.8.0\";\n", generatorProfile->implementationVersionString());

EXPECT_EQ("extern const char LIBCELLML_VERSION[];\n", generatorProfile->interfaceLibcellmlVersionString());
EXPECT_EQ("const char LIBCELLML_VERSION[] = \"[LIBCELLML_VERSION]\";\n", generatorProfile->implementationLibcellmlVersionString());
Expand Down Expand Up @@ -319,14 +319,14 @@ TEST(GeneratorProfile, defaultMiscellaneousValues)
"};\n",
generatorProfile->implementationComputedConstantInfoString());

EXPECT_EQ("extern const VariableInfo ALGEBRAIC_INFO[];\n", generatorProfile->interfaceAlgebraicVariableInfoString());
EXPECT_EQ("const VariableInfo ALGEBRAIC_INFO[] = {\n"
EXPECT_EQ("extern const VariableInfo ALGEBRAIC_VARIABLE_INFO[];\n", generatorProfile->interfaceAlgebraicVariableInfoString());
EXPECT_EQ("const VariableInfo ALGEBRAIC_VARIABLE_INFO[] = {\n"
"[CODE]"
"};\n",
generatorProfile->implementationAlgebraicVariableInfoString());

EXPECT_EQ("extern const VariableInfo EXTERNAL_INFO[];\n", generatorProfile->interfaceExternalVariableInfoString());
EXPECT_EQ("const VariableInfo EXTERNAL_INFO[] = {\n"
EXPECT_EQ("extern const VariableInfo EXTERNAL_VARIABLE_INFO[];\n", generatorProfile->interfaceExternalVariableInfoString());
EXPECT_EQ("const VariableInfo EXTERNAL_VARIABLE_INFO[] = {\n"
"[CODE]"
"};\n",
generatorProfile->implementationExternalVariableInfoString());
Expand Down Expand Up @@ -574,17 +574,17 @@ TEST(GeneratorProfile, defaultMiscellaneousValues)
"}\n",
generatorProfile->implementationInitialiseArraysMethodString(true));

EXPECT_EQ("void computeComputedConstants(double *constants, double *computedConstants, double *algebraic);\n",
EXPECT_EQ("void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables);\n",
generatorProfile->interfaceComputeComputedConstantsMethodString(false));
EXPECT_EQ("void computeComputedConstants(double *constants, double *computedConstants, double *algebraic)\n"
EXPECT_EQ("void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables)\n"
"{\n"
"[CODE]"
"}\n",
generatorProfile->implementationComputeComputedConstantsMethodString(false));

EXPECT_EQ("void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic);\n",
EXPECT_EQ("void computeComputedConstants(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);\n",
generatorProfile->interfaceComputeComputedConstantsMethodString(true));
EXPECT_EQ("void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)\n"
EXPECT_EQ("void computeComputedConstants(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)\n"
"{\n"
"[CODE]"
"}\n",
Expand Down
8 changes: 4 additions & 4 deletions tests/resources/coverage/generator/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.7.0";
const char VERSION[] = "0.8.0";
const char LIBCELLML_VERSION[] = "0.6.3";

const size_t STATE_COUNT = 1;
Expand Down Expand Up @@ -232,12 +232,12 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = {
{"eqnComputedConstant1", "dimensionless", "my_component"}
};

const VariableInfo ALGEBRAIC_INFO[] = {
const VariableInfo ALGEBRAIC_VARIABLE_INFO[] = {
{"eqnNlaVariable2", "dimensionless", "my_component"},
{"eqnNlaVariable1", "dimensionless", "my_component"}
};

const VariableInfo EXTERNAL_INFO[] = {
const VariableInfo EXTERNAL_VARIABLE_INFO[] = {
{"eqnPlus", "dimensionless", "my_component"}
};

Expand Down Expand Up @@ -452,7 +452,7 @@ void initialiseArrays(double *states, double *rates, double *constants, double *
algebraicVariables[1] = 1.0;
}

void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)
void computeComputedConstants(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)
{
computedConstants[0] = constants[1] == constants[0];
computedConstants[1] = constants[1]/(constants[0] == constants[0]);
Expand Down
6 changes: 3 additions & 3 deletions tests/resources/coverage/generator/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ extern const VariableInfo VOI_INFO;
extern const VariableInfo STATE_INFO[];
extern const VariableInfo CONSTANT_INFO[];
extern const VariableInfo COMPUTED_CONSTANT_INFO[];
extern const VariableInfo ALGEBRAIC_INFO[];
extern const VariableInfo EXTERNAL_INFO[];
extern const VariableInfo ALGEBRAIC_VARIABLE_INFO[];
extern const VariableInfo EXTERNAL_VARIABLE_INFO[];

double * createStatesArray();
double * createConstantsArray();
Expand All @@ -37,6 +37,6 @@ void deleteArray(double *array);
typedef double (* ExternalVariable)(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, size_t index);

void initialiseArrays(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic);
void computeComputedConstants(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);
void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, ExternalVariable externalVariable);
void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, ExternalVariable externalVariable);
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void initialiseArrays(double *states, double *rates, double *constants, double *
algebraicVariables[1] = 1.0;
}

void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)
void computeComputedConstants(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)
{
computedConstants[0] = eq(constants[1], constants[0]);
computedConstants[1] = constants[1]/eq(constants[0], constants[0]);
Expand Down
Loading
Loading