myokit 1.35.0__py3-none-any.whl → 1.35.2__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 +11 -14
- myokit/__main__.py +0 -3
- myokit/_config.py +1 -3
- myokit/_datablock.py +914 -12
- myokit/_model_api.py +1 -3
- myokit/_myokit_version.py +1 -1
- myokit/_protocol.py +14 -28
- myokit/_sim/cable.c +1 -1
- myokit/_sim/cable.py +3 -2
- myokit/_sim/cmodel.h +1 -0
- myokit/_sim/cvodessim.c +79 -42
- myokit/_sim/cvodessim.py +20 -8
- myokit/_sim/fiber_tissue.c +1 -1
- myokit/_sim/fiber_tissue.py +3 -2
- myokit/_sim/openclsim.c +1 -1
- myokit/_sim/openclsim.py +8 -11
- myokit/_sim/pacing.h +121 -106
- myokit/_unit.py +1 -1
- myokit/formats/__init__.py +178 -0
- myokit/formats/axon/_abf.py +911 -841
- myokit/formats/axon/_atf.py +62 -59
- myokit/formats/axon/_importer.py +2 -2
- myokit/formats/heka/__init__.py +38 -0
- myokit/formats/heka/_importer.py +39 -0
- myokit/formats/heka/_patchmaster.py +2512 -0
- myokit/formats/wcp/_wcp.py +318 -133
- myokit/gui/datablock_viewer.py +144 -77
- myokit/gui/datalog_viewer.py +212 -231
- myokit/tests/ansic_event_based_pacing.py +3 -3
- myokit/tests/{ansic_fixed_form_pacing.py → ansic_time_series_pacing.py} +6 -6
- myokit/tests/data/formats/abf-v2.abf +0 -0
- myokit/tests/test_datablock.py +84 -0
- myokit/tests/test_datalog.py +2 -1
- myokit/tests/test_formats_axon.py +589 -136
- myokit/tests/test_formats_wcp.py +191 -22
- myokit/tests/test_pacing_system_c.py +51 -23
- myokit/tests/test_pacing_system_py.py +18 -0
- myokit/tests/test_simulation_1d.py +62 -22
- myokit/tests/test_simulation_cvodes.py +52 -3
- myokit/tests/test_simulation_fiber_tissue.py +35 -4
- myokit/tests/test_simulation_opencl.py +28 -4
- {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/LICENSE.txt +1 -1
- {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/METADATA +1 -1
- {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/RECORD +47 -44
- {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/WHEEL +0 -0
- {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/entry_points.txt +0 -0
- {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
#
|
|
3
|
-
# Class for testing the
|
|
3
|
+
# Class for testing the time-series pacing system.
|
|
4
4
|
#
|
|
5
5
|
# This file is part of Myokit.
|
|
6
6
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
@@ -12,12 +12,12 @@ import myokit
|
|
|
12
12
|
from myokit.tests import DIR_TEST
|
|
13
13
|
|
|
14
14
|
# Location of C template
|
|
15
|
-
SOURCE_FILE = '
|
|
15
|
+
SOURCE_FILE = 'ansic_time_series_pacing.c'
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
class
|
|
18
|
+
class AnsicTimeSeriesPacing(myokit.CModule):
|
|
19
19
|
"""
|
|
20
|
-
Class for testing the
|
|
20
|
+
Class for testing the time-series pacing system.
|
|
21
21
|
"""
|
|
22
22
|
_index = 0
|
|
23
23
|
|
|
@@ -25,9 +25,9 @@ class AnsicFixedFormPacing(myokit.CModule):
|
|
|
25
25
|
super().__init__()
|
|
26
26
|
|
|
27
27
|
# Unique id
|
|
28
|
-
|
|
28
|
+
AnsicTimeSeriesPacing._index += 1
|
|
29
29
|
module_name = \
|
|
30
|
-
'myokit_ansic_fpacing_' + str(
|
|
30
|
+
'myokit_ansic_fpacing_' + str(AnsicTimeSeriesPacing._index)
|
|
31
31
|
|
|
32
32
|
# Arguments
|
|
33
33
|
fname = os.path.join(DIR_TEST, SOURCE_FILE)
|
|
Binary file
|
myokit/tests/test_datablock.py
CHANGED
|
@@ -700,6 +700,90 @@ class DataBlock2dTest(unittest.TestCase):
|
|
|
700
700
|
self.assertTrue(np.all(c[1] == t1))
|
|
701
701
|
self.assertTrue(np.all(c[2] == t2))
|
|
702
702
|
|
|
703
|
+
# Gray colormap
|
|
704
|
+
t0 = np.array([ # Deepest array is a pixel
|
|
705
|
+
[[0] * 3, [51] * 3],
|
|
706
|
+
[[102] * 3, [153] * 3],
|
|
707
|
+
[[204] * 3, [255] * 3],
|
|
708
|
+
])
|
|
709
|
+
t1 = np.array([
|
|
710
|
+
[[255] * 3, [204] * 3],
|
|
711
|
+
[[153] * 3, [102] * 3],
|
|
712
|
+
[[51] * 3, [0] * 3],
|
|
713
|
+
])
|
|
714
|
+
t2 = np.array([
|
|
715
|
+
[[0] * 3, [0] * 3],
|
|
716
|
+
[[0] * 3, [0] * 3],
|
|
717
|
+
[[0] * 3, [0] * 3],
|
|
718
|
+
])
|
|
719
|
+
c = b.colors('x', colormap='gray')
|
|
720
|
+
self.assertTrue(np.all(c[0] == t0))
|
|
721
|
+
self.assertTrue(np.all(c[1] == t1))
|
|
722
|
+
self.assertTrue(np.all(c[2] == t2))
|
|
723
|
+
|
|
724
|
+
# Cividis colormap
|
|
725
|
+
t0 = np.array([ # Deepest array is a pixel
|
|
726
|
+
[[0, 32, 76], [49, 68, 107]],
|
|
727
|
+
[[102, 104, 112], [150, 143, 119]],
|
|
728
|
+
[[203, 186, 104], [255, 233, 69]],
|
|
729
|
+
])
|
|
730
|
+
t1 = np.array([
|
|
731
|
+
[[255, 233, 69], [203, 186, 104]],
|
|
732
|
+
[[150, 143, 119], [102, 104, 112]],
|
|
733
|
+
[[49, 68, 107], [0, 32, 76]],
|
|
734
|
+
])
|
|
735
|
+
t2 = np.array([
|
|
736
|
+
[[0, 32, 76], [0, 32, 76]],
|
|
737
|
+
[[0, 32, 76], [0, 32, 76]],
|
|
738
|
+
[[0, 32, 76], [0, 32, 76]],
|
|
739
|
+
])
|
|
740
|
+
c = b.colors('x', colormap='cividis')
|
|
741
|
+
self.assertTrue(np.all(c[0] == t0))
|
|
742
|
+
self.assertTrue(np.all(c[1] == t1))
|
|
743
|
+
self.assertTrue(np.all(c[2] == t2))
|
|
744
|
+
|
|
745
|
+
# Inferno colormap
|
|
746
|
+
t0 = np.array([ # Deepest array is a pixel
|
|
747
|
+
[[0, 0, 4], [66, 10, 104]],
|
|
748
|
+
[[148, 38, 104], [223, 82, 57]],
|
|
749
|
+
[[253, 167, 12], [253, 255, 165]],
|
|
750
|
+
])
|
|
751
|
+
t1 = np.array([
|
|
752
|
+
[[253, 255, 165], [253, 167, 12]],
|
|
753
|
+
[[223, 82, 57], [148, 38, 104]],
|
|
754
|
+
[[66, 10, 104], [0, 0, 4]],
|
|
755
|
+
])
|
|
756
|
+
t2 = np.array([
|
|
757
|
+
[[0, 0, 4], [0, 0, 4]],
|
|
758
|
+
[[0, 0, 4], [0, 0, 4]],
|
|
759
|
+
[[0, 0, 4], [0, 0, 4]],
|
|
760
|
+
])
|
|
761
|
+
c = b.colors('x', colormap='inferno')
|
|
762
|
+
self.assertTrue(np.all(c[0] == t0))
|
|
763
|
+
self.assertTrue(np.all(c[1] == t1))
|
|
764
|
+
self.assertTrue(np.all(c[2] == t2))
|
|
765
|
+
|
|
766
|
+
# Viridis colormap
|
|
767
|
+
t0 = np.array([ # Deepest array is a pixel
|
|
768
|
+
[[68, 1, 84], [65, 68, 136]],
|
|
769
|
+
[[42, 121, 143], [35, 170, 132]],
|
|
770
|
+
[[125, 211, 80], [254, 232, 37]],
|
|
771
|
+
])
|
|
772
|
+
t1 = np.array([
|
|
773
|
+
[[254, 232, 37], [125, 211, 80]],
|
|
774
|
+
[[35, 170, 132], [42, 121, 143]],
|
|
775
|
+
[[65, 68, 136], [68, 1, 84]],
|
|
776
|
+
])
|
|
777
|
+
t2 = np.array([
|
|
778
|
+
[[68, 1, 84], [68, 1, 84]],
|
|
779
|
+
[[68, 1, 84], [68, 1, 84]],
|
|
780
|
+
[[68, 1, 84], [68, 1, 84]],
|
|
781
|
+
])
|
|
782
|
+
c = b.colors('x', colormap='viridis')
|
|
783
|
+
self.assertTrue(np.all(c[0] == t0))
|
|
784
|
+
self.assertTrue(np.all(c[1] == t1))
|
|
785
|
+
self.assertTrue(np.all(c[2] == t2))
|
|
786
|
+
|
|
703
787
|
def test_colors_multiplier(self):
|
|
704
788
|
# Test using the multiplier argument in colors
|
|
705
789
|
|
myokit/tests/test_datalog.py
CHANGED
|
@@ -2189,7 +2189,8 @@ class DataLogTest(unittest.TestCase):
|
|
|
2189
2189
|
self.assertTrue(np.abs(np.exp(y) - e['values'][i]) < 0.02)
|
|
2190
2190
|
|
|
2191
2191
|
# test setting tmin and tmax
|
|
2192
|
-
|
|
2192
|
+
with WarningCollector() as w:
|
|
2193
|
+
e = d.regularize(dt=0.5, tmin=0.4, tmax=2.6)
|
|
2193
2194
|
self.assertEqual(len(e['time']), 5)
|
|
2194
2195
|
x = np.array([0.4, 0.9, 1.4, 1.9, 2.4])
|
|
2195
2196
|
self.assertTrue(np.all(e['time'] == x))
|