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.
Files changed (47) hide show
  1. myokit/__init__.py +11 -14
  2. myokit/__main__.py +0 -3
  3. myokit/_config.py +1 -3
  4. myokit/_datablock.py +914 -12
  5. myokit/_model_api.py +1 -3
  6. myokit/_myokit_version.py +1 -1
  7. myokit/_protocol.py +14 -28
  8. myokit/_sim/cable.c +1 -1
  9. myokit/_sim/cable.py +3 -2
  10. myokit/_sim/cmodel.h +1 -0
  11. myokit/_sim/cvodessim.c +79 -42
  12. myokit/_sim/cvodessim.py +20 -8
  13. myokit/_sim/fiber_tissue.c +1 -1
  14. myokit/_sim/fiber_tissue.py +3 -2
  15. myokit/_sim/openclsim.c +1 -1
  16. myokit/_sim/openclsim.py +8 -11
  17. myokit/_sim/pacing.h +121 -106
  18. myokit/_unit.py +1 -1
  19. myokit/formats/__init__.py +178 -0
  20. myokit/formats/axon/_abf.py +911 -841
  21. myokit/formats/axon/_atf.py +62 -59
  22. myokit/formats/axon/_importer.py +2 -2
  23. myokit/formats/heka/__init__.py +38 -0
  24. myokit/formats/heka/_importer.py +39 -0
  25. myokit/formats/heka/_patchmaster.py +2512 -0
  26. myokit/formats/wcp/_wcp.py +318 -133
  27. myokit/gui/datablock_viewer.py +144 -77
  28. myokit/gui/datalog_viewer.py +212 -231
  29. myokit/tests/ansic_event_based_pacing.py +3 -3
  30. myokit/tests/{ansic_fixed_form_pacing.py → ansic_time_series_pacing.py} +6 -6
  31. myokit/tests/data/formats/abf-v2.abf +0 -0
  32. myokit/tests/test_datablock.py +84 -0
  33. myokit/tests/test_datalog.py +2 -1
  34. myokit/tests/test_formats_axon.py +589 -136
  35. myokit/tests/test_formats_wcp.py +191 -22
  36. myokit/tests/test_pacing_system_c.py +51 -23
  37. myokit/tests/test_pacing_system_py.py +18 -0
  38. myokit/tests/test_simulation_1d.py +62 -22
  39. myokit/tests/test_simulation_cvodes.py +52 -3
  40. myokit/tests/test_simulation_fiber_tissue.py +35 -4
  41. myokit/tests/test_simulation_opencl.py +28 -4
  42. {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/LICENSE.txt +1 -1
  43. {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/METADATA +1 -1
  44. {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/RECORD +47 -44
  45. {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/WHEEL +0 -0
  46. {myokit-1.35.0.dist-info → myokit-1.35.2.dist-info}/entry_points.txt +0 -0
  47. {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 fixed-form pacing system.
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 = 'ansic_fixed_form_pacing.c'
15
+ SOURCE_FILE = 'ansic_time_series_pacing.c'
16
16
 
17
17
 
18
- class AnsicFixedFormPacing(myokit.CModule):
18
+ class AnsicTimeSeriesPacing(myokit.CModule):
19
19
  """
20
- Class for testing the fixed-form pacing system.
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
- AnsicFixedFormPacing._index += 1
28
+ AnsicTimeSeriesPacing._index += 1
29
29
  module_name = \
30
- 'myokit_ansic_fpacing_' + str(AnsicFixedFormPacing._index)
30
+ 'myokit_ansic_fpacing_' + str(AnsicTimeSeriesPacing._index)
31
31
 
32
32
  # Arguments
33
33
  fname = os.path.join(DIR_TEST, SOURCE_FILE)
Binary file
@@ -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
 
@@ -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
- e = d.regularize(dt=0.5, tmin=0.4, tmax=2.6)
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))