myokit 1.34.0__py3-none-any.whl → 1.35.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 +5 -23
- myokit/__main__.py +70 -117
- myokit/_aux.py +5 -8
- myokit/_config.py +22 -31
- myokit/_datablock.py +26 -70
- myokit/_datalog.py +23 -53
- myokit/_err.py +13 -15
- myokit/_expressions.py +35 -55
- myokit/_io.py +5 -22
- myokit/_model_api.py +34 -47
- myokit/_myokit_version.py +1 -5
- myokit/_parsing.py +17 -25
- myokit/_progress.py +4 -7
- myokit/_protocol.py +6 -9
- myokit/_sim/__init__.py +7 -24
- myokit/_sim/cable.c +1 -3
- myokit/_sim/cable.py +3 -5
- myokit/_sim/cmodel.h +1 -3
- myokit/_sim/cmodel.py +1 -4
- myokit/_sim/compiler.py +1 -4
- myokit/_sim/cvodessim.c +1 -4
- myokit/_sim/cvodessim.py +1 -4
- myokit/_sim/fiber_tissue.c +2 -6
- myokit/_sim/fiber_tissue.py +3 -5
- myokit/_sim/jacobian.py +6 -7
- myokit/_sim/mcl.h +51 -53
- myokit/_sim/opencl.py +9 -22
- myokit/_sim/openclsim.c +2 -6
- myokit/_sim/openclsim.py +6 -6
- myokit/_sim/pacing.h +2 -6
- myokit/_sim/rhs.c +3 -10
- myokit/_sim/rhs.py +4 -13
- myokit/_sim/sundials.py +1 -4
- myokit/_system.py +10 -16
- myokit/_unit.py +3 -12
- myokit/float.py +0 -3
- myokit/formats/__init__.py +8 -10
- myokit/formats/ansic/__init__.py +0 -3
- myokit/formats/ansic/_ewriter.py +2 -4
- myokit/formats/ansic/_exporter.py +0 -3
- myokit/formats/axon/__init__.py +1 -3
- myokit/formats/axon/_abf.py +12 -15
- myokit/formats/axon/_atf.py +5 -6
- myokit/formats/axon/_importer.py +0 -3
- myokit/formats/cellml/__init__.py +0 -3
- myokit/formats/cellml/_ewriter.py +3 -6
- myokit/formats/cellml/_exporter.py +3 -6
- myokit/formats/cellml/_importer.py +1 -4
- myokit/formats/cellml/v1/__init__.py +0 -4
- myokit/formats/cellml/v1/_api.py +7 -10
- myokit/formats/cellml/v1/_parser.py +2 -5
- myokit/formats/cellml/v1/_writer.py +2 -11
- myokit/formats/cellml/v2/__init__.py +0 -3
- myokit/formats/cellml/v2/_api.py +7 -16
- myokit/formats/cellml/v2/_parser.py +2 -5
- myokit/formats/cellml/v2/_writer.py +1 -4
- myokit/formats/channelml/__init__.py +0 -3
- myokit/formats/channelml/_importer.py +4 -14
- myokit/formats/cpp/__init__.py +1 -3
- myokit/formats/cpp/_ewriter.py +0 -3
- myokit/formats/cuda/__init__.py +0 -3
- myokit/formats/cuda/_ewriter.py +2 -4
- myokit/formats/cuda/_exporter.py +0 -3
- myokit/formats/easyml/__init__.py +0 -3
- myokit/formats/easyml/_ewriter.py +9 -11
- myokit/formats/easyml/_exporter.py +0 -3
- myokit/formats/html/__init__.py +0 -3
- myokit/formats/html/_exporter.py +0 -3
- myokit/formats/html/_flatten.py +5 -21
- myokit/formats/latex/__init__.py +0 -3
- myokit/formats/latex/_ewriter.py +1 -4
- myokit/formats/latex/_exporter.py +3 -5
- myokit/formats/mathml/__init__.py +0 -3
- myokit/formats/mathml/_ewriter.py +2 -11
- myokit/formats/mathml/_parser.py +3 -5
- myokit/formats/matlab/__init__.py +0 -3
- myokit/formats/matlab/_ewriter.py +1 -4
- myokit/formats/matlab/_exporter.py +0 -3
- myokit/formats/opencl/__init__.py +0 -3
- myokit/formats/opencl/_ewriter.py +2 -4
- myokit/formats/opencl/_exporter.py +0 -3
- myokit/formats/python/__init__.py +0 -3
- myokit/formats/python/_ewriter.py +2 -5
- myokit/formats/python/_exporter.py +0 -3
- myokit/formats/python/template/sim.py +10 -10
- myokit/formats/sbml/__init__.py +0 -3
- myokit/formats/sbml/_api.py +17 -11
- myokit/formats/sbml/_importer.py +1 -4
- myokit/formats/sbml/_parser.py +2 -5
- myokit/formats/stan/__init__.py +0 -3
- myokit/formats/stan/_ewriter.py +2 -4
- myokit/formats/stan/_exporter.py +1 -4
- myokit/formats/sympy/__init__.py +0 -3
- myokit/formats/sympy/_ereader.py +1 -4
- myokit/formats/sympy/_ewriter.py +2 -5
- myokit/formats/wcp/__init__.py +0 -3
- myokit/formats/wcp/_wcp.py +1 -7
- myokit/formats/xml/__init__.py +0 -3
- myokit/formats/xml/_exporter.py +0 -3
- myokit/formats/xml/_split.py +0 -3
- myokit/gui/__init__.py +75 -247
- myokit/gui/datablock_viewer.py +100 -83
- myokit/gui/datalog_viewer.py +32 -44
- myokit/gui/explorer.py +15 -21
- myokit/gui/ide.py +105 -125
- myokit/gui/progress.py +9 -9
- myokit/gui/source.py +405 -374
- myokit/gui/vargrapher.py +2 -12
- myokit/lib/deps.py +7 -8
- myokit/lib/guess.py +1 -2
- myokit/lib/hh.py +5 -7
- myokit/lib/markov.py +9 -11
- myokit/lib/multi.py +1 -3
- myokit/lib/plots.py +1 -3
- myokit/pacing.py +0 -3
- myokit/pype.py +7 -18
- myokit/tests/__init__.py +3 -6
- myokit/tests/ansic_event_based_pacing.py +1 -4
- myokit/tests/ansic_fixed_form_pacing.py +1 -4
- myokit/tests/test_aux.py +9 -23
- myokit/tests/test_cellml_v1_api.py +1 -16
- myokit/tests/test_cellml_v1_parser.py +0 -15
- myokit/tests/test_cellml_v1_writer.py +0 -9
- myokit/tests/test_cellml_v2_api.py +1 -16
- myokit/tests/test_cellml_v2_parser.py +0 -15
- myokit/tests/test_cellml_v2_writer.py +0 -9
- myokit/tests/test_cmodel.py +0 -9
- myokit/tests/test_compiler_detection.py +1 -11
- myokit/tests/test_component.py +0 -10
- myokit/tests/test_config.py +33 -66
- myokit/tests/test_datablock.py +1 -9
- myokit/tests/test_datalog.py +4 -21
- myokit/tests/test_dependency_checking.py +8 -23
- myokit/tests/test_expressions.py +0 -9
- myokit/tests/test_float.py +1 -5
- myokit/tests/test_formats.py +0 -9
- myokit/tests/test_formats_axon.py +1 -9
- myokit/tests/test_formats_cellml.py +0 -15
- myokit/tests/test_formats_channelml.py +0 -15
- myokit/tests/test_formats_easyml.py +0 -14
- myokit/tests/test_formats_exporters.py +1 -16
- myokit/tests/test_formats_expression_writers.py +1 -17
- myokit/tests/test_formats_html.py +0 -3
- myokit/tests/test_formats_importers.py +1 -16
- myokit/tests/test_formats_mathml_content.py +0 -9
- myokit/tests/test_formats_mathml_presentation.py +0 -9
- myokit/tests/test_formats_opencl.py +0 -10
- myokit/tests/test_formats_sbml.py +0 -15
- myokit/tests/test_formats_sympy.py +0 -9
- myokit/tests/test_formats_wcp.py +1 -3
- myokit/tests/test_io.py +6 -14
- myokit/tests/test_jacobian_calculator.py +1 -9
- myokit/tests/test_jacobian_tracer.py +0 -9
- myokit/tests/test_lib_deps.py +0 -9
- myokit/tests/test_lib_guess.py +0 -9
- myokit/tests/test_lib_hh.py +1 -9
- myokit/tests/test_lib_markov.py +1 -9
- myokit/tests/test_lib_multi.py +0 -9
- myokit/tests/test_lib_plots.py +0 -3
- myokit/tests/test_meta.py +0 -3
- myokit/tests/test_model.py +0 -10
- myokit/tests/test_model_building.py +2 -17
- myokit/tests/test_opencl_info.py +5 -14
- myokit/tests/test_pacing_factory.py +0 -3
- myokit/tests/test_pacing_system_c.py +0 -9
- myokit/tests/test_pacing_system_py.py +0 -9
- myokit/tests/test_parsing.py +5 -20
- myokit/tests/test_progress_reporters.py +0 -3
- myokit/tests/test_protocol.py +0 -9
- myokit/tests/test_protocol_floating_point.py +0 -9
- myokit/tests/test_protocol_time_series.py +0 -10
- myokit/tests/test_pype.py +0 -9
- myokit/tests/test_quantity.py +0 -9
- myokit/tests/test_rhs_benchmarker.py +1 -9
- myokit/tests/test_sbml_api.py +0 -15
- myokit/tests/test_sbml_parser.py +0 -15
- myokit/tests/test_simulation_1d.py +1 -10
- myokit/tests/test_simulation_cvodes.py +8 -16
- myokit/tests/test_simulation_cvodes_from_disk.py +0 -3
- myokit/tests/test_simulation_fiber_tissue.py +1 -10
- myokit/tests/test_simulation_log_interval.py +0 -9
- myokit/tests/test_simulation_opencl.py +1 -10
- myokit/tests/test_simulation_opencl_log_interval.py +1 -3
- myokit/tests/test_simulation_opencl_vs_cvode.py +1 -10
- myokit/tests/test_simulation_opencl_vs_sim1d.py +1 -10
- myokit/tests/test_system_info.py +1 -11
- myokit/tests/test_tools.py +0 -9
- myokit/tests/test_unit.py +0 -9
- myokit/tests/test_user_functions.py +0 -10
- myokit/tests/test_variable.py +0 -10
- myokit/tools.py +5 -21
- myokit/units.py +0 -3
- {myokit-1.34.0.dist-info → myokit-1.35.0.dist-info}/METADATA +7 -7
- {myokit-1.34.0.dist-info → myokit-1.35.0.dist-info}/RECORD +198 -200
- myokit/_exec_new.py +0 -15
- myokit/_exec_old.py +0 -15
- {myokit-1.34.0.dist-info → myokit-1.35.0.dist-info}/LICENSE.txt +0 -0
- {myokit-1.34.0.dist-info → myokit-1.35.0.dist-info}/WHEEL +0 -0
- {myokit-1.34.0.dist-info → myokit-1.35.0.dist-info}/entry_points.txt +0 -0
- {myokit-1.34.0.dist-info → myokit-1.35.0.dist-info}/top_level.txt +0 -0
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import unittest
|
|
12
9
|
|
|
13
10
|
import myokit.formats.html
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import os
|
|
12
9
|
import unittest
|
|
13
10
|
|
|
@@ -16,18 +13,6 @@ import myokit.formats as formats
|
|
|
16
13
|
|
|
17
14
|
from myokit.tests import DIR_FORMATS
|
|
18
15
|
|
|
19
|
-
# Unit testing in Python 2 and 3
|
|
20
|
-
try:
|
|
21
|
-
unittest.TestCase.assertRaisesRegex
|
|
22
|
-
except AttributeError: # pragma: no python 3 cover
|
|
23
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
24
|
-
|
|
25
|
-
# Strings in Python 2 and 3
|
|
26
|
-
try:
|
|
27
|
-
basestring
|
|
28
|
-
except NameError: # pragma: no python 2 cover
|
|
29
|
-
basestring = str
|
|
30
|
-
|
|
31
16
|
|
|
32
17
|
class ImporterTest(unittest.TestCase):
|
|
33
18
|
""" Test shared importer functionality. """
|
|
@@ -37,7 +22,7 @@ class ImporterTest(unittest.TestCase):
|
|
|
37
22
|
ims = myokit.formats.importers()
|
|
38
23
|
self.assertTrue(len(ims) > 0)
|
|
39
24
|
for i in ims:
|
|
40
|
-
self.assertIsInstance(i,
|
|
25
|
+
self.assertIsInstance(i, str)
|
|
41
26
|
i = myokit.formats.importer(i)
|
|
42
27
|
self.assertTrue(isinstance(i, myokit.formats.Importer))
|
|
43
28
|
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import re
|
|
12
9
|
import unittest
|
|
13
10
|
|
|
@@ -16,12 +13,6 @@ import lxml.etree as etree
|
|
|
16
13
|
import myokit
|
|
17
14
|
import myokit.formats.mathml as mathml
|
|
18
15
|
|
|
19
|
-
# Unit testing in Python 2 and 3
|
|
20
|
-
try:
|
|
21
|
-
unittest.TestCase.assertRaisesRegex
|
|
22
|
-
except AttributeError:
|
|
23
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
24
|
-
|
|
25
16
|
|
|
26
17
|
class ContentMathMLParserTest(unittest.TestCase):
|
|
27
18
|
""" Tests content MathML parsing. """
|
|
@@ -5,21 +5,12 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import re
|
|
12
9
|
import unittest
|
|
13
10
|
|
|
14
11
|
import myokit
|
|
15
12
|
import myokit.formats.mathml as mathml
|
|
16
13
|
|
|
17
|
-
# Unit testing in Python 2 and 3
|
|
18
|
-
try:
|
|
19
|
-
unittest.TestCase.assertRaisesRegex
|
|
20
|
-
except AttributeError:
|
|
21
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
22
|
-
|
|
23
14
|
|
|
24
15
|
class PresentationMathMLTest(unittest.TestCase):
|
|
25
16
|
"""
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import unittest
|
|
12
9
|
|
|
13
10
|
import myokit
|
|
@@ -15,13 +12,6 @@ import myokit.formats
|
|
|
15
12
|
import myokit.formats.opencl
|
|
16
13
|
|
|
17
14
|
|
|
18
|
-
# Unit testing in Python 2 and 3
|
|
19
|
-
try:
|
|
20
|
-
unittest.TestCase.assertRaisesRegex
|
|
21
|
-
except AttributeError: # pragma: no python 3 cover
|
|
22
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
23
|
-
|
|
24
|
-
|
|
25
15
|
class OpenCLExpressionWriterTest(unittest.TestCase):
|
|
26
16
|
""" Test the OpenCL ewriter class. """
|
|
27
17
|
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import os
|
|
12
9
|
import unittest
|
|
13
10
|
|
|
@@ -20,18 +17,6 @@ import myokit.formats.sbml
|
|
|
20
17
|
# from shared import DIR_FORMATS, WarningCollector
|
|
21
18
|
from myokit.tests import DIR_FORMATS, WarningCollector
|
|
22
19
|
|
|
23
|
-
# Unit testing in Python 2 and 3
|
|
24
|
-
try:
|
|
25
|
-
unittest.TestCase.assertRaisesRegex
|
|
26
|
-
except AttributeError: # pragma: no python 3 cover
|
|
27
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
28
|
-
|
|
29
|
-
# Strings in Python 2 and 3
|
|
30
|
-
try:
|
|
31
|
-
basestring
|
|
32
|
-
except NameError: # pragma: no python 2 cover
|
|
33
|
-
basestring = str
|
|
34
|
-
|
|
35
20
|
|
|
36
21
|
class SBMLImporterTest(unittest.TestCase):
|
|
37
22
|
"""
|
|
@@ -5,20 +5,11 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import unittest
|
|
12
9
|
|
|
13
10
|
import myokit
|
|
14
11
|
import myokit.formats.sympy as mypy
|
|
15
12
|
|
|
16
|
-
# Unit testing in Python 2 and 3
|
|
17
|
-
try:
|
|
18
|
-
unittest.TestCase.assertRaisesRegex
|
|
19
|
-
except AttributeError:
|
|
20
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
21
|
-
|
|
22
13
|
|
|
23
14
|
class SymPyReadWriteTest(unittest.TestCase):
|
|
24
15
|
"""
|
myokit/tests/test_formats_wcp.py
CHANGED
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import os
|
|
12
9
|
import unittest
|
|
10
|
+
|
|
13
11
|
import numpy as np
|
|
14
12
|
|
|
15
13
|
import myokit.formats.wcp as wcp
|
myokit/tests/test_io.py
CHANGED
|
@@ -6,23 +6,15 @@
|
|
|
6
6
|
# This file is part of Myokit.
|
|
7
7
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
8
8
|
#
|
|
9
|
-
from __future__ import absolute_import, division
|
|
10
|
-
from __future__ import print_function, unicode_literals
|
|
11
|
-
|
|
12
9
|
import os
|
|
13
10
|
import unittest
|
|
11
|
+
|
|
14
12
|
import numpy as np
|
|
15
13
|
|
|
16
14
|
import myokit
|
|
17
15
|
|
|
18
16
|
from myokit.tests import DIR_DATA, TemporaryDirectory
|
|
19
17
|
|
|
20
|
-
# Strings in Python 2 and 3
|
|
21
|
-
try:
|
|
22
|
-
basestring
|
|
23
|
-
except NameError:
|
|
24
|
-
basestring = str
|
|
25
|
-
|
|
26
18
|
|
|
27
19
|
class LoadSaveMmtTest(unittest.TestCase):
|
|
28
20
|
"""Tests load/save functions for mmt files."""
|
|
@@ -105,7 +97,7 @@ class LoadSaveMmtTest(unittest.TestCase):
|
|
|
105
97
|
m, p, x = myokit.load(spath)
|
|
106
98
|
self.assertIsNone(m)
|
|
107
99
|
self.assertIsNone(p)
|
|
108
|
-
self.assertTrue(isinstance(x,
|
|
100
|
+
self.assertTrue(isinstance(x, str))
|
|
109
101
|
|
|
110
102
|
self.assertRaises(
|
|
111
103
|
myokit.SectionNotFoundError, myokit.load_model, ppath)
|
|
@@ -128,7 +120,7 @@ class LoadSaveMmtTest(unittest.TestCase):
|
|
|
128
120
|
m, p, x = myokit.load('example')
|
|
129
121
|
self.assertIsInstance(m, myokit.Model)
|
|
130
122
|
self.assertIsInstance(p, myokit.Protocol)
|
|
131
|
-
self.assertTrue(isinstance(x,
|
|
123
|
+
self.assertTrue(isinstance(x, str))
|
|
132
124
|
|
|
133
125
|
# Save all three and reload
|
|
134
126
|
with TemporaryDirectory() as d:
|
|
@@ -318,10 +310,10 @@ class LoadSaveMmtTest(unittest.TestCase):
|
|
|
318
310
|
ipath = os.path.join(DIR_DATA, 'lr-1991.mmt')
|
|
319
311
|
# Test example loading
|
|
320
312
|
x = myokit.load_script('example')
|
|
321
|
-
self.assertTrue(isinstance(x,
|
|
313
|
+
self.assertTrue(isinstance(x, str))
|
|
322
314
|
# Test file loading
|
|
323
315
|
x = myokit.load_script(ipath)
|
|
324
|
-
self.assertTrue(isinstance(x,
|
|
316
|
+
self.assertTrue(isinstance(x, str))
|
|
325
317
|
with TemporaryDirectory() as d:
|
|
326
318
|
opath = d.path('test.mmt')
|
|
327
319
|
myokit.save_script(opath, x)
|
|
@@ -333,7 +325,7 @@ class LoadSaveMmtTest(unittest.TestCase):
|
|
|
333
325
|
self.assertTrue('[[script]]' in text)
|
|
334
326
|
# Test reloading
|
|
335
327
|
xx = myokit.load_script(opath)
|
|
336
|
-
self.assertTrue(isinstance(xx,
|
|
328
|
+
self.assertTrue(isinstance(xx, str))
|
|
337
329
|
self.assertEqual(x, xx)
|
|
338
330
|
|
|
339
331
|
|
|
@@ -5,23 +5,15 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import os
|
|
12
9
|
import unittest
|
|
10
|
+
|
|
13
11
|
import numpy as np
|
|
14
12
|
|
|
15
13
|
import myokit
|
|
16
14
|
|
|
17
15
|
from myokit.tests import DIR_DATA
|
|
18
16
|
|
|
19
|
-
# Unit testing in Python 2 and 3
|
|
20
|
-
try:
|
|
21
|
-
unittest.TestCase.assertRaisesRegex
|
|
22
|
-
except AttributeError:
|
|
23
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
24
|
-
|
|
25
17
|
|
|
26
18
|
class JacobianCalculatorTest(unittest.TestCase):
|
|
27
19
|
"""
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import os
|
|
12
9
|
import unittest
|
|
13
10
|
|
|
@@ -15,12 +12,6 @@ import myokit
|
|
|
15
12
|
|
|
16
13
|
from myokit.tests import DIR_DATA
|
|
17
14
|
|
|
18
|
-
# Unit testing in Python 2 and 3
|
|
19
|
-
try:
|
|
20
|
-
unittest.TestCase.assertRaisesRegex
|
|
21
|
-
except AttributeError:
|
|
22
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
23
|
-
|
|
24
15
|
|
|
25
16
|
class JacobianTracerTest(unittest.TestCase):
|
|
26
17
|
"""
|
myokit/tests/test_lib_deps.py
CHANGED
|
@@ -5,21 +5,12 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import random
|
|
12
9
|
import unittest
|
|
13
10
|
|
|
14
11
|
import myokit
|
|
15
12
|
import myokit.lib.deps as deps
|
|
16
13
|
|
|
17
|
-
# Unit testing in Python 2 and 3
|
|
18
|
-
try:
|
|
19
|
-
unittest.TestCase.assertRaisesRegex
|
|
20
|
-
except AttributeError:
|
|
21
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
22
|
-
|
|
23
14
|
|
|
24
15
|
class LibDepsTest(unittest.TestCase):
|
|
25
16
|
|
myokit/tests/test_lib_guess.py
CHANGED
|
@@ -5,20 +5,11 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import unittest
|
|
12
9
|
|
|
13
10
|
import myokit
|
|
14
11
|
import myokit.lib.guess as guess
|
|
15
12
|
|
|
16
|
-
# Unit testing in Python 2 and 3
|
|
17
|
-
try:
|
|
18
|
-
unittest.TestCase.assertRaisesRegex
|
|
19
|
-
except AttributeError:
|
|
20
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
21
|
-
|
|
22
13
|
|
|
23
14
|
class LibGuessTest(unittest.TestCase):
|
|
24
15
|
"""
|
myokit/tests/test_lib_hh.py
CHANGED
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import os
|
|
12
9
|
import unittest
|
|
10
|
+
|
|
13
11
|
import numpy as np
|
|
14
12
|
|
|
15
13
|
import myokit
|
|
@@ -17,12 +15,6 @@ import myokit.lib.hh as hh
|
|
|
17
15
|
|
|
18
16
|
from myokit.tests import DIR_DATA
|
|
19
17
|
|
|
20
|
-
# Unit testing in Python 2 and 3
|
|
21
|
-
try:
|
|
22
|
-
unittest.TestCase.assertRaisesRegex
|
|
23
|
-
except AttributeError:
|
|
24
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
25
|
-
|
|
26
18
|
|
|
27
19
|
MODEL = """
|
|
28
20
|
[[model]]
|
myokit/tests/test_lib_markov.py
CHANGED
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import os
|
|
12
9
|
import unittest
|
|
10
|
+
|
|
13
11
|
import numpy as np
|
|
14
12
|
|
|
15
13
|
import myokit
|
|
@@ -17,12 +15,6 @@ import myokit.lib.markov as markov
|
|
|
17
15
|
|
|
18
16
|
from myokit.tests import DIR_DATA, WarningCollector
|
|
19
17
|
|
|
20
|
-
# Unit testing in Python 2 and 3
|
|
21
|
-
try:
|
|
22
|
-
unittest.TestCase.assertRaisesRegex
|
|
23
|
-
except AttributeError:
|
|
24
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
25
|
-
|
|
26
18
|
|
|
27
19
|
class LinearModelTest(unittest.TestCase):
|
|
28
20
|
"""
|
myokit/tests/test_lib_multi.py
CHANGED
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import os
|
|
12
9
|
import unittest
|
|
13
10
|
|
|
@@ -15,12 +12,6 @@ import myokit
|
|
|
15
12
|
|
|
16
13
|
from myokit.tests import DIR_DATA, WarningCollector
|
|
17
14
|
|
|
18
|
-
# Unit testing in Python 2 and 3
|
|
19
|
-
try:
|
|
20
|
-
unittest.TestCase.assertRaisesRegex
|
|
21
|
-
except AttributeError:
|
|
22
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
23
|
-
|
|
24
15
|
# Path to multi-model testing files
|
|
25
16
|
DIR_MULTI = os.path.join(DIR_DATA, 'multi')
|
|
26
17
|
|
myokit/tests/test_lib_plots.py
CHANGED
myokit/tests/test_meta.py
CHANGED
myokit/tests/test_model.py
CHANGED
|
@@ -8,9 +8,6 @@
|
|
|
8
8
|
# This file is part of Myokit.
|
|
9
9
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
10
10
|
#
|
|
11
|
-
from __future__ import absolute_import, division
|
|
12
|
-
from __future__ import print_function, unicode_literals
|
|
13
|
-
|
|
14
11
|
import pickle
|
|
15
12
|
import re
|
|
16
13
|
import unittest
|
|
@@ -20,13 +17,6 @@ import myokit
|
|
|
20
17
|
from myokit.tests import TemporaryDirectory, WarningCollector
|
|
21
18
|
|
|
22
19
|
|
|
23
|
-
# Unit testing in Python 2 and 3
|
|
24
|
-
try:
|
|
25
|
-
unittest.TestCase.assertRaisesRegex
|
|
26
|
-
except AttributeError:
|
|
27
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
28
|
-
|
|
29
|
-
|
|
30
20
|
class ModelTest(unittest.TestCase):
|
|
31
21
|
"""
|
|
32
22
|
Tests parts of :class:`myokit.Model`.
|
|
@@ -8,24 +8,9 @@
|
|
|
8
8
|
# This file is part of Myokit.
|
|
9
9
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
10
10
|
#
|
|
11
|
-
from __future__ import absolute_import, division
|
|
12
|
-
from __future__ import print_function, unicode_literals
|
|
13
|
-
|
|
14
11
|
import myokit
|
|
15
12
|
import unittest
|
|
16
13
|
|
|
17
|
-
# Strings in Python 2 and 3
|
|
18
|
-
try:
|
|
19
|
-
basestring
|
|
20
|
-
except NameError:
|
|
21
|
-
basestring = str
|
|
22
|
-
|
|
23
|
-
# Unit testing in Python 2 and 3
|
|
24
|
-
try:
|
|
25
|
-
unittest.TestCase.assertRaisesRegex
|
|
26
|
-
except AttributeError:
|
|
27
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
28
|
-
|
|
29
14
|
# Further model API tests are found in:
|
|
30
15
|
# - test_dependency_checking.py
|
|
31
16
|
|
|
@@ -300,10 +285,10 @@ class ModelBuildTest(unittest.TestCase):
|
|
|
300
285
|
|
|
301
286
|
# Test dependency mapping
|
|
302
287
|
def has(var, *dps):
|
|
303
|
-
lst = vrs[m.get(var).lhs() if isinstance(var,
|
|
288
|
+
lst = vrs[m.get(var).lhs() if isinstance(var, str) else var]
|
|
304
289
|
self.assertEqual(len(lst), len(dps))
|
|
305
290
|
for d in dps:
|
|
306
|
-
d = m.get(d).lhs() if isinstance(d,
|
|
291
|
+
d = m.get(d).lhs() if isinstance(d, str) else d
|
|
307
292
|
self.assertIn(d, lst)
|
|
308
293
|
|
|
309
294
|
vrs = m.map_shallow_dependencies(omit_states=False)
|
myokit/tests/test_opencl_info.py
CHANGED
|
@@ -5,21 +5,12 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import unittest
|
|
12
9
|
|
|
13
10
|
import myokit
|
|
14
11
|
|
|
15
12
|
from myokit.tests import TemporaryDirectory, OpenCL_FOUND
|
|
16
13
|
|
|
17
|
-
# Strings in Python2 and Python3
|
|
18
|
-
try:
|
|
19
|
-
basestring
|
|
20
|
-
except NameError:
|
|
21
|
-
basestring = str
|
|
22
|
-
|
|
23
14
|
|
|
24
15
|
@unittest.skipIf(not OpenCL_FOUND, 'OpenCL not found on this system.')
|
|
25
16
|
class OpenCLTest(unittest.TestCase):
|
|
@@ -35,12 +26,12 @@ class OpenCLTest(unittest.TestCase):
|
|
|
35
26
|
# Tests the method to query the current device
|
|
36
27
|
self.assertIsInstance(
|
|
37
28
|
myokit.OpenCL.current_info(), myokit.OpenCLPlatformInfo)
|
|
38
|
-
self.assertIsInstance(myokit.OpenCL.current_info(True),
|
|
29
|
+
self.assertIsInstance(myokit.OpenCL.current_info(True), str)
|
|
39
30
|
|
|
40
31
|
def test_info(self):
|
|
41
32
|
# Tests the method to query the current device
|
|
42
33
|
self.assertIsInstance(myokit.OpenCL.info(), myokit.OpenCLInfo)
|
|
43
|
-
self.assertIsInstance(myokit.OpenCL.info(True),
|
|
34
|
+
self.assertIsInstance(myokit.OpenCL.info(True), str)
|
|
44
35
|
|
|
45
36
|
def test_load_save_selection(self):
|
|
46
37
|
# Tests the load_selection method
|
|
@@ -83,9 +74,9 @@ class OpenCLTest(unittest.TestCase):
|
|
|
83
74
|
item = info[0]
|
|
84
75
|
self.assertEqual(len(item), 3)
|
|
85
76
|
platform, device, specs = item
|
|
86
|
-
self.assertIsInstance(platform,
|
|
87
|
-
self.assertIsInstance(device,
|
|
88
|
-
self.assertIsInstance(specs,
|
|
77
|
+
self.assertIsInstance(platform, str)
|
|
78
|
+
self.assertIsInstance(device, str)
|
|
79
|
+
self.assertIsInstance(specs, str)
|
|
89
80
|
|
|
90
81
|
def test_supported(self):
|
|
91
82
|
# Tested as condition to get in, so must be true
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import unittest
|
|
12
9
|
import numpy as np
|
|
13
10
|
|
|
@@ -16,12 +13,6 @@ import myokit
|
|
|
16
13
|
from myokit.tests.ansic_event_based_pacing import AnsicEventBasedPacing
|
|
17
14
|
from myokit.tests.ansic_fixed_form_pacing import AnsicFixedFormPacing
|
|
18
15
|
|
|
19
|
-
# Unit testing in Python 2 and 3
|
|
20
|
-
try:
|
|
21
|
-
unittest.TestCase.assertRaisesRegex
|
|
22
|
-
except AttributeError:
|
|
23
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
24
|
-
|
|
25
16
|
|
|
26
17
|
class EventBasedPacingAnsicTest(unittest.TestCase):
|
|
27
18
|
"""
|
|
@@ -5,19 +5,10 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import unittest
|
|
12
9
|
|
|
13
10
|
import myokit
|
|
14
11
|
|
|
15
|
-
# Unit testing in Python 2 and 3
|
|
16
|
-
try:
|
|
17
|
-
unittest.TestCase.assertRaisesRegex
|
|
18
|
-
except AttributeError:
|
|
19
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
20
|
-
|
|
21
12
|
|
|
22
13
|
class EventBasedPacingPythonTest(unittest.TestCase):
|
|
23
14
|
"""
|
myokit/tests/test_parsing.py
CHANGED
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
# This file is part of Myokit.
|
|
7
7
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
8
8
|
#
|
|
9
|
-
from __future__ import absolute_import, division
|
|
10
|
-
from __future__ import print_function, unicode_literals
|
|
11
|
-
|
|
12
9
|
import os
|
|
13
10
|
import unittest
|
|
14
11
|
|
|
@@ -17,18 +14,6 @@ import myokit.units
|
|
|
17
14
|
|
|
18
15
|
from myokit.tests import DIR_DATA, TemporaryDirectory
|
|
19
16
|
|
|
20
|
-
# Unit testing in Python 2 and 3
|
|
21
|
-
try:
|
|
22
|
-
unittest.TestCase.assertRaisesRegex
|
|
23
|
-
except AttributeError:
|
|
24
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
25
|
-
|
|
26
|
-
# Strings in Python 2 and 3
|
|
27
|
-
try:
|
|
28
|
-
basestring
|
|
29
|
-
except NameError: # pragma: no python 2 cover
|
|
30
|
-
basestring = str
|
|
31
|
-
|
|
32
17
|
|
|
33
18
|
class TokenizerTest(unittest.TestCase):
|
|
34
19
|
"""
|
|
@@ -908,29 +893,29 @@ class PhasedParseTest(unittest.TestCase):
|
|
|
908
893
|
'[[script]]',
|
|
909
894
|
)
|
|
910
895
|
script = parse_script(code)
|
|
911
|
-
self.assertIsInstance(script,
|
|
896
|
+
self.assertIsInstance(script, str)
|
|
912
897
|
script = parse_script(''.join(code))
|
|
913
|
-
self.assertIsInstance(script,
|
|
898
|
+
self.assertIsInstance(script, str)
|
|
914
899
|
|
|
915
900
|
code = (
|
|
916
901
|
'[[script]]\n',
|
|
917
902
|
)
|
|
918
903
|
script = parse_script(code)
|
|
919
|
-
self.assertIsInstance(script,
|
|
904
|
+
self.assertIsInstance(script, str)
|
|
920
905
|
|
|
921
906
|
code = (
|
|
922
907
|
'[[script]]\n',
|
|
923
908
|
'print("hi")',
|
|
924
909
|
)
|
|
925
910
|
script = parse_script(code)
|
|
926
|
-
self.assertIsInstance(script,
|
|
911
|
+
self.assertIsInstance(script, str)
|
|
927
912
|
|
|
928
913
|
code = (
|
|
929
914
|
'[[script]]\n',
|
|
930
915
|
'print("hi")\n',
|
|
931
916
|
)
|
|
932
917
|
script = parse_script(code)
|
|
933
|
-
self.assertIsInstance(script,
|
|
918
|
+
self.assertIsInstance(script, str)
|
|
934
919
|
|
|
935
920
|
# Not a script
|
|
936
921
|
code = (
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
7
7
|
#
|
|
8
|
-
from __future__ import absolute_import, division
|
|
9
|
-
from __future__ import print_function, unicode_literals
|
|
10
|
-
|
|
11
8
|
import unittest
|
|
12
9
|
import re
|
|
13
10
|
import time
|