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
myokit/tests/test_protocol.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 pickle
|
|
12
9
|
import unittest
|
|
13
10
|
|
|
@@ -15,12 +12,6 @@ import myokit
|
|
|
15
12
|
|
|
16
13
|
from myokit.tests import 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
|
|
|
25
16
|
class ProtocolTest(unittest.TestCase):
|
|
26
17
|
"""
|
|
@@ -26,21 +26,12 @@
|
|
|
26
26
|
# This file is part of Myokit.
|
|
27
27
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
28
28
|
#
|
|
29
|
-
from __future__ import absolute_import, division
|
|
30
|
-
from __future__ import print_function, unicode_literals
|
|
31
|
-
|
|
32
29
|
import unittest
|
|
33
30
|
|
|
34
31
|
import myokit
|
|
35
32
|
|
|
36
33
|
from myokit.tests.ansic_event_based_pacing import AnsicEventBasedPacing
|
|
37
34
|
|
|
38
|
-
# Unit testing in Python 2 and 3
|
|
39
|
-
try:
|
|
40
|
-
unittest.TestCase.assertRaisesRegex
|
|
41
|
-
except AttributeError:
|
|
42
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
43
|
-
|
|
44
35
|
|
|
45
36
|
class ProtocolFloatingPointTest(unittest.TestCase):
|
|
46
37
|
|
|
@@ -5,22 +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
|
import pickle
|
|
13
10
|
|
|
14
11
|
import myokit
|
|
15
12
|
|
|
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
|
-
|
|
24
14
|
class TimeSeriesProtocolTest(unittest.TestCase):
|
|
25
15
|
"""
|
|
26
16
|
Tests the TimeSeriesProtocol class.
|
myokit/tests/test_pype.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 unittest
|
|
12
9
|
|
|
13
10
|
import myokit
|
|
@@ -15,12 +12,6 @@ import myokit.pype
|
|
|
15
12
|
|
|
16
13
|
from myokit.tests import TemporaryDirectory
|
|
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 PypeTest(unittest.TestCase):
|
|
26
17
|
|
myokit/tests/test_quantity.py
CHANGED
|
@@ -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 QuantityTest(unittest.TestCase):
|
|
23
14
|
"""
|
|
@@ -5,20 +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
|
|
9
|
+
|
|
12
10
|
import numpy as np
|
|
13
11
|
|
|
14
12
|
import myokit
|
|
15
13
|
|
|
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
14
|
|
|
23
15
|
class RhsBenchmarkerTest(unittest.TestCase):
|
|
24
16
|
"""
|
myokit/tests/test_sbml_api.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 unittest
|
|
12
9
|
|
|
13
10
|
import myokit
|
|
@@ -18,18 +15,6 @@ from myokit.formats.sbml._api import _MyokitConverter as X
|
|
|
18
15
|
|
|
19
16
|
from myokit.tests import WarningCollector
|
|
20
17
|
|
|
21
|
-
# Unit testing in Python 2 and 3
|
|
22
|
-
try:
|
|
23
|
-
unittest.TestCase.assertRaisesRegex
|
|
24
|
-
except AttributeError: # pragma: no python 3 cover
|
|
25
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
26
|
-
|
|
27
|
-
# Strings in Python 2 and 3
|
|
28
|
-
try:
|
|
29
|
-
basestring
|
|
30
|
-
except NameError: # pragma: no python 2 cover
|
|
31
|
-
basestring = str
|
|
32
|
-
|
|
33
18
|
|
|
34
19
|
class TestCompartment(unittest.TestCase):
|
|
35
20
|
"""
|
myokit/tests/test_sbml_parser.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 unittest
|
|
12
9
|
|
|
13
10
|
import myokit
|
|
@@ -17,18 +14,6 @@ from myokit.formats.sbml import SBMLParser, SBMLParsingError
|
|
|
17
14
|
|
|
18
15
|
from myokit.tests import WarningCollector
|
|
19
16
|
|
|
20
|
-
# Unit testing in Python 2 and 3
|
|
21
|
-
try:
|
|
22
|
-
unittest.TestCase.assertRaisesRegex
|
|
23
|
-
except AttributeError: # pragma: no python 3 cover
|
|
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 TestSBMLParser(unittest.TestCase):
|
|
34
19
|
"""
|
|
@@ -5,24 +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, CancellingReporter
|
|
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
|
-
|
|
26
17
|
# Show simulation output
|
|
27
18
|
debug = False
|
|
28
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 pickle
|
|
13
10
|
import platform
|
|
@@ -26,12 +23,6 @@ from myokit.tests import (
|
|
|
26
23
|
WarningCollector,
|
|
27
24
|
)
|
|
28
25
|
|
|
29
|
-
# Unit testing in Python 2 and 3
|
|
30
|
-
try:
|
|
31
|
-
unittest.TestCase.assertRaisesRegex
|
|
32
|
-
except AttributeError:
|
|
33
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
34
|
-
|
|
35
26
|
|
|
36
27
|
class SimulationTest(unittest.TestCase):
|
|
37
28
|
"""
|
|
@@ -297,13 +288,14 @@ class SimulationTest(unittest.TestCase):
|
|
|
297
288
|
d = self.sim.run(n, log_interval=1)
|
|
298
289
|
self.assertEqual(list(d.time()), times)
|
|
299
290
|
self.assertEqual(list(d['engine.pace']), values)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
291
|
+
with WarningCollector() as w:
|
|
292
|
+
self.assertRaisesRegex(
|
|
293
|
+
ValueError, 'No times',
|
|
294
|
+
self.sim.set_fixed_form_protocol, values=values)
|
|
295
|
+
self.assertRaisesRegex(
|
|
296
|
+
ValueError, 'No values',
|
|
297
|
+
self.sim.set_fixed_form_protocol, times=times)
|
|
298
|
+
self.sim.set_fixed_form_protocol(None)
|
|
307
299
|
self.sim.reset()
|
|
308
300
|
d = self.sim.run(n, log_interval=1)
|
|
309
301
|
self.assertEqual(list(d['engine.pace']), [0] * n)
|
|
@@ -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
|
|
@@ -21,13 +19,6 @@ from myokit.tests import (
|
|
|
21
19
|
WarningCollector,
|
|
22
20
|
)
|
|
23
21
|
|
|
24
|
-
# Unit testing in Python 2 and 3
|
|
25
|
-
try:
|
|
26
|
-
unittest.TestCase.assertRaisesRegex
|
|
27
|
-
except AttributeError:
|
|
28
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
29
|
-
|
|
30
|
-
|
|
31
22
|
# Show simulation output
|
|
32
23
|
debug = False
|
|
33
24
|
|
|
@@ -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
|
|
|
@@ -17,12 +14,6 @@ import myokit
|
|
|
17
14
|
|
|
18
15
|
from myokit.tests import DIR_DATA
|
|
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
17
|
# Extra output
|
|
27
18
|
debug = False
|
|
28
19
|
|
|
@@ -8,11 +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 os
|
|
15
12
|
import unittest
|
|
13
|
+
|
|
16
14
|
import numpy as np
|
|
17
15
|
|
|
18
16
|
import myokit
|
|
@@ -25,13 +23,6 @@ from myokit.tests import (
|
|
|
25
23
|
WarningCollector,
|
|
26
24
|
)
|
|
27
25
|
|
|
28
|
-
# Unit testing in Python 2 and 3
|
|
29
|
-
try:
|
|
30
|
-
unittest.TestCase.assertRaisesRegex
|
|
31
|
-
except AttributeError:
|
|
32
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
33
|
-
|
|
34
|
-
|
|
35
26
|
# Show simulation output
|
|
36
27
|
debug = False
|
|
37
28
|
|
|
@@ -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
|
|
@@ -5,24 +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 OpenCL_DOUBLE_PRECISION, 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
|
-
|
|
26
17
|
# Show simulation output
|
|
27
18
|
debug = False
|
|
28
19
|
|
|
@@ -5,24 +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 OpenCL_DOUBLE_PRECISION, 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
|
-
|
|
26
17
|
# Show simulation output
|
|
27
18
|
debug = False
|
|
28
19
|
|
myokit/tests/test_system_info.py
CHANGED
|
@@ -5,21 +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
|
|
|
15
12
|
|
|
16
|
-
# Strings in Python2 and Python3
|
|
17
|
-
try:
|
|
18
|
-
basestring
|
|
19
|
-
except NameError: # pragma: no cover
|
|
20
|
-
basestring = str
|
|
21
|
-
|
|
22
|
-
|
|
23
13
|
class SystemInfoTest(unittest.TestCase):
|
|
24
14
|
"""
|
|
25
15
|
Tests the system info method.
|
|
@@ -29,7 +19,7 @@ class SystemInfoTest(unittest.TestCase):
|
|
|
29
19
|
import matplotlib
|
|
30
20
|
matplotlib.use('template')
|
|
31
21
|
|
|
32
|
-
self.assertIsInstance(myokit.system(),
|
|
22
|
+
self.assertIsInstance(myokit.system(), str)
|
|
33
23
|
with myokit.tools.capture():
|
|
34
24
|
myokit.system(live_printing=True)
|
|
35
25
|
|
myokit/tests/test_tools.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 re
|
|
13
10
|
import sys
|
|
@@ -15,12 +12,6 @@ import threading
|
|
|
15
12
|
import time
|
|
16
13
|
import unittest
|
|
17
14
|
|
|
18
|
-
# Strings in Python2 and Python3
|
|
19
|
-
try:
|
|
20
|
-
basestring
|
|
21
|
-
except NameError: # pragma: no cover
|
|
22
|
-
basestring = str
|
|
23
|
-
|
|
24
15
|
import myokit
|
|
25
16
|
|
|
26
17
|
from myokit.tests import TemporaryDirectory
|
myokit/tests/test_unit.py
CHANGED
|
@@ -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 MyokitUnitTest(unittest.TestCase):
|
|
23
14
|
|
|
@@ -5,19 +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 unittest
|
|
12
9
|
import myokit
|
|
13
10
|
|
|
14
|
-
# Unit testing in Python 2 and 3
|
|
15
|
-
try:
|
|
16
|
-
unittest.TestCase.assertRaisesRegex
|
|
17
|
-
except AttributeError:
|
|
18
|
-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
19
|
-
|
|
20
|
-
|
|
21
11
|
# Further testing in test_model.py
|
|
22
12
|
|
|
23
13
|
|
myokit/tests/test_variable.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 unittest
|
|
12
9
|
|
|
13
10
|
import numpy as np
|
|
@@ -17,13 +14,6 @@ import myokit
|
|
|
17
14
|
from myokit.tests import WarningCollector
|
|
18
15
|
|
|
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
|
-
|
|
27
17
|
class VariableTest(unittest.TestCase):
|
|
28
18
|
"""
|
|
29
19
|
Tests parts of :class:`myokit.Variable`.
|
myokit/tools.py
CHANGED
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
# This file is part of Myokit.
|
|
7
7
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
8
8
|
#
|
|
9
|
-
|
|
10
|
-
from __future__ import print_function, unicode_literals
|
|
11
|
-
|
|
9
|
+
import io
|
|
12
10
|
import os
|
|
13
11
|
import re
|
|
14
12
|
import shutil
|
|
@@ -18,18 +16,12 @@ import tempfile
|
|
|
18
16
|
import threading
|
|
19
17
|
import timeit
|
|
20
18
|
|
|
21
|
-
# StringIO in Python 2 and 3
|
|
22
|
-
try:
|
|
23
|
-
from cStringIO import StringIO
|
|
24
|
-
except ImportError: # pragma: no python 2 cover
|
|
25
|
-
from io import StringIO
|
|
26
|
-
|
|
27
19
|
|
|
28
20
|
# Natural sort regex
|
|
29
21
|
_natural_sort_regex = re.compile('([0-9]+)')
|
|
30
22
|
|
|
31
23
|
|
|
32
|
-
class Benchmarker
|
|
24
|
+
class Benchmarker:
|
|
33
25
|
"""
|
|
34
26
|
Allows benchmarking using the with statement.
|
|
35
27
|
|
|
@@ -97,7 +89,7 @@ class Benchmarker(object):
|
|
|
97
89
|
return timeit.default_timer() - self._start
|
|
98
90
|
|
|
99
91
|
|
|
100
|
-
class capture
|
|
92
|
+
class capture:
|
|
101
93
|
"""
|
|
102
94
|
Context manager that temporarily redirects the current standard output and
|
|
103
95
|
error streams, and captures anything that's written to them.
|
|
@@ -224,8 +216,8 @@ class capture(object):
|
|
|
224
216
|
# Redirect
|
|
225
217
|
if not self._fd:
|
|
226
218
|
# Create temporary output and error streams
|
|
227
|
-
self._tmp_out = StringIO()
|
|
228
|
-
self._tmp_err = StringIO()
|
|
219
|
+
self._tmp_out = io.StringIO()
|
|
220
|
+
self._tmp_err = io.StringIO()
|
|
229
221
|
|
|
230
222
|
# Redirect, attempting to flush first
|
|
231
223
|
try:
|
|
@@ -391,10 +383,6 @@ class capture(object):
|
|
|
391
383
|
return ''
|
|
392
384
|
text = self._txt_err
|
|
393
385
|
|
|
394
|
-
# In Python 2, the text needs to be decoded from ascii
|
|
395
|
-
if sys.hexversion < 0x03000000: # pragma: no python 3 cover
|
|
396
|
-
text = text.decode('ascii', 'ignore')
|
|
397
|
-
|
|
398
386
|
return text
|
|
399
387
|
|
|
400
388
|
def out(self):
|
|
@@ -406,10 +394,6 @@ class capture(object):
|
|
|
406
394
|
return ''
|
|
407
395
|
text = self._txt_out
|
|
408
396
|
|
|
409
|
-
# In Python 2, the text needs to be decoded from ascii
|
|
410
|
-
if sys.hexversion < 0x03000000: # pragma: no python 3 cover
|
|
411
|
-
text = text.decode('ascii', 'ignore')
|
|
412
|
-
|
|
413
397
|
return text
|
|
414
398
|
|
|
415
399
|
def text(self):
|
myokit/units.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: myokit
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.35.0
|
|
4
4
|
Summary: A simple interface to cardiac cellular electrophysiology
|
|
5
5
|
Home-page: http://myokit.org
|
|
6
6
|
Author: Michael Clerx
|
|
@@ -13,7 +13,6 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
|
13
13
|
Classifier: Intended Audience :: Science/Research
|
|
14
14
|
Classifier: License :: OSI Approved :: BSD License
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
16
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
17
16
|
Classifier: Programming Language :: Python :: 3
|
|
18
17
|
Classifier: Topic :: Scientific/Engineering
|
|
19
18
|
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
@@ -21,29 +20,30 @@ Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
|
21
20
|
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
22
21
|
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
23
22
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
23
|
+
Requires-Python: >=3.7
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
25
|
License-File: LICENSE.txt
|
|
26
26
|
Requires-Dist: configparser
|
|
27
27
|
Requires-Dist: lxml
|
|
28
|
-
Requires-Dist: matplotlib (>=
|
|
28
|
+
Requires-Dist: matplotlib (>=2.2)
|
|
29
29
|
Requires-Dist: numpy
|
|
30
30
|
Requires-Dist: setuptools
|
|
31
31
|
Provides-Extra: dev
|
|
32
32
|
Requires-Dist: coverage ; extra == 'dev'
|
|
33
33
|
Requires-Dist: flake8 (>=3) ; extra == 'dev'
|
|
34
34
|
Provides-Extra: docs
|
|
35
|
-
Requires-Dist: sphinx (
|
|
35
|
+
Requires-Dist: sphinx (>=1.7.4) ; extra == 'docs'
|
|
36
36
|
Provides-Extra: gui
|
|
37
|
-
Requires-Dist:
|
|
37
|
+
Requires-Dist: pyqt6 ; extra == 'gui'
|
|
38
38
|
Requires-Dist: sip ; extra == 'gui'
|
|
39
39
|
Provides-Extra: optional
|
|
40
40
|
Requires-Dist: scipy ; extra == 'optional'
|
|
41
41
|
Requires-Dist: sympy ; extra == 'optional'
|
|
42
42
|
Provides-Extra: pyqt
|
|
43
|
-
Requires-Dist:
|
|
43
|
+
Requires-Dist: pyqt6 ; extra == 'pyqt'
|
|
44
44
|
Requires-Dist: sip ; extra == 'pyqt'
|
|
45
45
|
Provides-Extra: pyside
|
|
46
|
-
Requires-Dist:
|
|
46
|
+
Requires-Dist: pyside6 ; extra == 'pyside'
|
|
47
47
|
|
|
48
48
|
[](https://github.com/myokit/myokit/actions/workflows/unit-tests-ubuntu.yml)
|
|
49
49
|
[](https://github.com/myokit/myokit/actions/workflows/unit-tests-macos.yml)
|