myokit 1.36.0__py3-none-any.whl → 1.37.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- myokit/__init__.py +6 -19
- myokit/_datablock.py +45 -55
- myokit/_datalog.py +2 -2
- myokit/_err.py +26 -3
- myokit/_expressions.py +241 -127
- myokit/_model_api.py +19 -13
- myokit/_myokit_version.py +1 -1
- myokit/_sim/cvodessim.c +221 -149
- myokit/_sim/jacobian.py +3 -3
- myokit/_sim/mcl.h +54 -0
- myokit/_sim/openclsim.py +5 -5
- myokit/_sim/rhs.py +1 -1
- myokit/formats/__init__.py +4 -9
- myokit/formats/ansic/_ewriter.py +4 -20
- myokit/formats/heka/_patchmaster.py +16 -10
- myokit/formats/opencl/_ewriter.py +3 -42
- myokit/formats/opencl/template/minilog.py +1 -1
- myokit/formats/sympy/_ereader.py +2 -1
- myokit/formats/wcp/_wcp.py +3 -3
- myokit/gui/datalog_viewer.py +12 -7
- myokit/lib/hh.py +3 -0
- myokit/lib/markov.py +2 -2
- myokit/lib/plots.py +4 -4
- myokit/tests/data/formats/wcp-file-empty.wcp +0 -0
- myokit/tests/test_datablock.py +10 -10
- myokit/tests/test_datalog.py +4 -1
- myokit/tests/test_expressions.py +532 -251
- myokit/tests/test_formats_ansic.py +6 -18
- myokit/tests/test_formats_cpp.py +0 -5
- myokit/tests/test_formats_cuda.py +7 -15
- myokit/tests/test_formats_easyml.py +4 -9
- myokit/tests/test_formats_latex.py +10 -11
- myokit/tests/test_formats_matlab.py +0 -8
- myokit/tests/test_formats_opencl.py +0 -29
- myokit/tests/test_formats_python.py +2 -19
- myokit/tests/test_formats_stan.py +0 -13
- myokit/tests/test_formats_sympy.py +3 -3
- myokit/tests/test_formats_wcp.py +15 -0
- myokit/tests/test_lib_hh.py +36 -0
- myokit/tests/test_model.py +20 -20
- myokit/tests/test_parsing.py +19 -0
- {myokit-1.36.0.dist-info → myokit-1.37.0.dist-info}/METADATA +1 -1
- {myokit-1.36.0.dist-info → myokit-1.37.0.dist-info}/RECORD +47 -46
- {myokit-1.36.0.dist-info → myokit-1.37.0.dist-info}/LICENSE.txt +0 -0
- {myokit-1.36.0.dist-info → myokit-1.37.0.dist-info}/WHEEL +0 -0
- {myokit-1.36.0.dist-info → myokit-1.37.0.dist-info}/entry_points.txt +0 -0
- {myokit-1.36.0.dist-info → myokit-1.37.0.dist-info}/top_level.txt +0 -0
myokit/_model_api.py
CHANGED
|
@@ -716,7 +716,10 @@ class VarOwner(ModelPart, VarProvider):
|
|
|
716
716
|
If ``recursive`` is ``True``, any child variables will be deleted as
|
|
717
717
|
well.
|
|
718
718
|
|
|
719
|
-
A :class:`myokit.IntegrityError` will be raised if
|
|
719
|
+
A :class:`myokit.IntegrityError` will be raised if the variable cannot
|
|
720
|
+
be removed because other variables depend on it. (Although dependencies
|
|
721
|
+
from child variables will be ignored if ``recursive`` is set to
|
|
722
|
+
``True``).
|
|
720
723
|
"""
|
|
721
724
|
if variable.parent() != self:
|
|
722
725
|
raise ValueError(
|
|
@@ -1095,9 +1098,7 @@ class Model(ObjectWithMetaData, VarProvider):
|
|
|
1095
1098
|
raise myokit.IncompatibleUnitError(msg, var._token)
|
|
1096
1099
|
|
|
1097
1100
|
def clone(self):
|
|
1098
|
-
"""
|
|
1099
|
-
Returns a (deep) clone of this model.
|
|
1100
|
-
"""
|
|
1101
|
+
""" Returns a (deep) clone of this model. """
|
|
1101
1102
|
clone = Model()
|
|
1102
1103
|
|
|
1103
1104
|
# Copy meta data
|
|
@@ -4520,16 +4521,10 @@ class Variable(VarOwner):
|
|
|
4520
4521
|
warnings.warn('The keyword argument `state_value` is deprecated.'
|
|
4521
4522
|
' Please use `initial_value` instead.')
|
|
4522
4523
|
|
|
4523
|
-
#
|
|
4524
|
-
|
|
4525
|
-
if not isinstance(initial_value, myokit.Expression):
|
|
4526
|
-
if isinstance(initial_value, str):
|
|
4527
|
-
# Expressions are evaluated in model context
|
|
4528
|
-
initial_value = myokit.parse_expression(
|
|
4529
|
-
initial_value, context=model)
|
|
4530
|
-
elif initial_value is not None:
|
|
4531
|
-
initial_value = myokit.Number(initial_value)
|
|
4524
|
+
# Parse initial value
|
|
4525
|
+
initial_value = self._set_initial_value(initial_value, False)
|
|
4532
4526
|
|
|
4527
|
+
model = self.model()
|
|
4533
4528
|
try:
|
|
4534
4529
|
# Set lhs to derivative expression
|
|
4535
4530
|
self._lhs = myokit.Derivative(myokit.Name(self))
|
|
@@ -4854,6 +4849,9 @@ class Variable(VarOwner):
|
|
|
4854
4849
|
x.set_rhs(myokit.Plus(myokit.Number(1), myokit.Name(y)))
|
|
4855
4850
|
x.set_rhs('1 + y')
|
|
4856
4851
|
|
|
4852
|
+
Expressions used as a variable's right-hand side must be numerical:
|
|
4853
|
+
:class:`myokit.Condition` operators can not be used as RHS.
|
|
4854
|
+
|
|
4857
4855
|
Calling `set_rhs` will reset the validation status of the model this
|
|
4858
4856
|
variable belongs to.
|
|
4859
4857
|
"""
|
|
@@ -5107,6 +5105,14 @@ class Equation:
|
|
|
5107
5105
|
def __init__(self, lhs, rhs):
|
|
5108
5106
|
self._lhs = lhs
|
|
5109
5107
|
self._rhs = rhs
|
|
5108
|
+
if not isinstance(lhs, myokit.Expression):
|
|
5109
|
+
raise myokit.IntegrityError(
|
|
5110
|
+
'Both sides of an equation must be myokit.Expression objects.'
|
|
5111
|
+
f' Found {type(lhs)} for LHS.')
|
|
5112
|
+
if not isinstance(rhs, myokit.Expression):
|
|
5113
|
+
raise myokit.IntegrityError(
|
|
5114
|
+
'Both sides of an equation must be myokit.Expression objects.'
|
|
5115
|
+
f' Found {type(lhs)} for RHS.')
|
|
5110
5116
|
|
|
5111
5117
|
def __eq__(self, other):
|
|
5112
5118
|
if not isinstance(other, Equation):
|
myokit/_myokit_version.py
CHANGED
|
@@ -14,7 +14,7 @@ __release__ = True
|
|
|
14
14
|
# incompatibility
|
|
15
15
|
# - Changes to revision indicate bugfixes, tiny new features
|
|
16
16
|
# - There is no significance to odd/even numbers
|
|
17
|
-
__version_tuple__ = 1,
|
|
17
|
+
__version_tuple__ = 1, 37, 0
|
|
18
18
|
|
|
19
19
|
# String version of the version number
|
|
20
20
|
__version__ = '.'.join([str(x) for x in __version_tuple__])
|