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/gui/datalog_viewer.py
CHANGED
|
@@ -4,23 +4,16 @@
|
|
|
4
4
|
# This file is part of Myokit.
|
|
5
5
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
6
6
|
#
|
|
7
|
-
|
|
8
|
-
from __future__ import print_function, unicode_literals
|
|
9
|
-
|
|
10
|
-
# Standard library imports
|
|
7
|
+
import configparser
|
|
11
8
|
import gc
|
|
12
9
|
import os
|
|
13
10
|
import sys
|
|
14
11
|
import traceback
|
|
15
12
|
|
|
16
|
-
# Qt imports
|
|
17
13
|
from myokit.gui import QtWidgets, QtGui, QtCore, Qt
|
|
18
14
|
|
|
19
|
-
# Myokit
|
|
20
15
|
import myokit
|
|
21
16
|
import myokit.gui
|
|
22
|
-
|
|
23
|
-
# Myokit components
|
|
24
17
|
import myokit.formats.axon
|
|
25
18
|
import myokit.formats.wcp
|
|
26
19
|
|
|
@@ -39,12 +32,6 @@ try:
|
|
|
39
32
|
except ImportError:
|
|
40
33
|
has_scipy = False
|
|
41
34
|
|
|
42
|
-
# ConfigParser in Python 2 and 3
|
|
43
|
-
try:
|
|
44
|
-
import ConfigParser as configparser
|
|
45
|
-
except ImportError:
|
|
46
|
-
import configparser
|
|
47
|
-
|
|
48
35
|
|
|
49
36
|
# Application title
|
|
50
37
|
TITLE = 'Myokit DataLog Viewer (PROTOTYPE)'
|
|
@@ -115,7 +102,7 @@ class DataLogViewer(myokit.gui.MyokitApplication):
|
|
|
115
102
|
Graphical interface for viewing DataLog data.
|
|
116
103
|
"""
|
|
117
104
|
def __init__(self, *filenames):
|
|
118
|
-
super(
|
|
105
|
+
super().__init__()
|
|
119
106
|
|
|
120
107
|
# Set Title, icon
|
|
121
108
|
self.setWindowTitle(TITLE + ' ' + myokit.__version__)
|
|
@@ -123,7 +110,7 @@ class DataLogViewer(myokit.gui.MyokitApplication):
|
|
|
123
110
|
# Set size, center
|
|
124
111
|
self.resize(800, 600)
|
|
125
112
|
qr = self.frameGeometry()
|
|
126
|
-
cp =
|
|
113
|
+
cp = QtGui.QGuiApplication.primaryScreen().availableGeometry().center()
|
|
127
114
|
qr.moveCenter(cp)
|
|
128
115
|
self.move(qr.topLeft())
|
|
129
116
|
|
|
@@ -276,7 +263,7 @@ class DataLogViewer(myokit.gui.MyokitApplication):
|
|
|
276
263
|
# File menu
|
|
277
264
|
self._menu_file = self._menu.addMenu('&File')
|
|
278
265
|
# File > Open
|
|
279
|
-
self._tool_open =
|
|
266
|
+
self._tool_open = QtGui.QAction('&Open', self)
|
|
280
267
|
self._tool_open.setShortcut('Ctrl+O')
|
|
281
268
|
self._tool_open.setStatusTip('Open a file')
|
|
282
269
|
self._tool_open.setIcon(QtGui.QIcon.fromTheme('document-open'))
|
|
@@ -285,7 +272,7 @@ class DataLogViewer(myokit.gui.MyokitApplication):
|
|
|
285
272
|
# File > ----
|
|
286
273
|
self._menu_file.addSeparator()
|
|
287
274
|
# File > Quit
|
|
288
|
-
self._tool_exit =
|
|
275
|
+
self._tool_exit = QtGui.QAction('&Quit', self)
|
|
289
276
|
self._tool_exit.setShortcut('Ctrl+Q')
|
|
290
277
|
self._tool_exit.setStatusTip('Exit application.')
|
|
291
278
|
self._tool_exit.setIcon(QtGui.QIcon.fromTheme('application-exit'))
|
|
@@ -294,7 +281,7 @@ class DataLogViewer(myokit.gui.MyokitApplication):
|
|
|
294
281
|
# View menu
|
|
295
282
|
self._menu_view = self._menu.addMenu('&View')
|
|
296
283
|
# View > Next file
|
|
297
|
-
self._tool_next_file =
|
|
284
|
+
self._tool_next_file = QtGui.QAction('Next file', self)
|
|
298
285
|
self._tool_next_file.setShortcut('Ctrl+PgDown')
|
|
299
286
|
self._tool_next_file.setStatusTip('Select the next open file')
|
|
300
287
|
self._tool_next_file.triggered.connect(self.action_next_file)
|
|
@@ -302,21 +289,21 @@ class DataLogViewer(myokit.gui.MyokitApplication):
|
|
|
302
289
|
self._menu_view.addAction(self._tool_next_file)
|
|
303
290
|
# View > Previous file
|
|
304
291
|
self._menu_view.addAction(self._tool_next_file)
|
|
305
|
-
self._tool_prev_file =
|
|
292
|
+
self._tool_prev_file = QtGui.QAction('Previous file', self)
|
|
306
293
|
self._tool_prev_file.setShortcut('Ctrl+PgUp')
|
|
307
294
|
self._tool_prev_file.setStatusTip('Select the previous open file')
|
|
308
295
|
self._tool_prev_file.triggered.connect(self.action_prev_file)
|
|
309
296
|
self._tool_prev_file.setEnabled(False)
|
|
310
297
|
self._menu_view.addAction(self._tool_prev_file)
|
|
311
298
|
# View > Next variable
|
|
312
|
-
self._tool_next_var =
|
|
299
|
+
self._tool_next_var = QtGui.QAction('Next variable', self)
|
|
313
300
|
self._tool_next_var.setShortcut('PgDown')
|
|
314
301
|
self._tool_next_var.setStatusTip('Show the next variable')
|
|
315
302
|
self._tool_next_var.triggered.connect(self.action_next_var)
|
|
316
303
|
self._tool_next_var.setEnabled(False)
|
|
317
304
|
self._menu_view.addAction(self._tool_next_var)
|
|
318
305
|
# View > Previous var
|
|
319
|
-
self._tool_prev_var =
|
|
306
|
+
self._tool_prev_var = QtGui.QAction('Previous variable', self)
|
|
320
307
|
self._tool_prev_var.setShortcut('PgUp')
|
|
321
308
|
self._tool_prev_var.setStatusTip('Show the previous variable')
|
|
322
309
|
self._tool_prev_var.triggered.connect(self.action_prev_var)
|
|
@@ -325,12 +312,12 @@ class DataLogViewer(myokit.gui.MyokitApplication):
|
|
|
325
312
|
# Help menu
|
|
326
313
|
self._menu_help = self._menu.addMenu('&Help')
|
|
327
314
|
# Help > About
|
|
328
|
-
self._tool_about =
|
|
315
|
+
self._tool_about = QtGui.QAction('&About', self)
|
|
329
316
|
self._tool_about.setStatusTip('View information about this program.')
|
|
330
317
|
self._tool_about.triggered.connect(self.action_about)
|
|
331
318
|
self._menu_help.addAction(self._tool_about)
|
|
332
319
|
# Help > License
|
|
333
|
-
self._tool_license =
|
|
320
|
+
self._tool_license = QtGui.QAction('&License', self)
|
|
334
321
|
self._tool_license.setStatusTip('View this program\'s license info.')
|
|
335
322
|
self._tool_license.triggered.connect(self.action_license)
|
|
336
323
|
self._menu_help.addAction(self._tool_license)
|
|
@@ -342,7 +329,8 @@ class DataLogViewer(myokit.gui.MyokitApplication):
|
|
|
342
329
|
self._toolbar = self.addToolBar('tools')
|
|
343
330
|
self._toolbar.setFloatable(False)
|
|
344
331
|
self._toolbar.setMovable(False)
|
|
345
|
-
self._toolbar.setToolButtonStyle(
|
|
332
|
+
self._toolbar.setToolButtonStyle(
|
|
333
|
+
Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
|
|
346
334
|
self._toolbar.addAction(self._tool_open)
|
|
347
335
|
#self._toolbar.addSeparator()
|
|
348
336
|
|
|
@@ -508,7 +496,7 @@ class DataLogViewer(myokit.gui.MyokitApplication):
|
|
|
508
496
|
"""
|
|
509
497
|
Shows this viewer.
|
|
510
498
|
"""
|
|
511
|
-
super(
|
|
499
|
+
super().show()
|
|
512
500
|
QtWidgets.QApplication.processEvents()
|
|
513
501
|
|
|
514
502
|
def fileTabChangeEvent(self, index):
|
|
@@ -555,9 +543,9 @@ class AbfTab(TabWidget):
|
|
|
555
543
|
A widget displaying an ABF file.
|
|
556
544
|
"""
|
|
557
545
|
def __init__(self, parent, abf):
|
|
558
|
-
super(
|
|
546
|
+
super().__init__(parent)
|
|
559
547
|
self.setTabsClosable(False)
|
|
560
|
-
self.setTabPosition(self.East)
|
|
548
|
+
self.setTabPosition(self.TabPosition.East)
|
|
561
549
|
self._abf = abf
|
|
562
550
|
self._figures = []
|
|
563
551
|
self._axes = []
|
|
@@ -649,7 +637,7 @@ class AbfTab(TabWidget):
|
|
|
649
637
|
axes.cla()
|
|
650
638
|
del self._figures, self._axes
|
|
651
639
|
gc.collect()
|
|
652
|
-
super(
|
|
640
|
+
super().deleteLater()
|
|
653
641
|
|
|
654
642
|
|
|
655
643
|
class AtfTab(TabWidget):
|
|
@@ -657,11 +645,11 @@ class AtfTab(TabWidget):
|
|
|
657
645
|
A widget displaying an AGF file.
|
|
658
646
|
"""
|
|
659
647
|
def __init__(self, parent, atf):
|
|
660
|
-
super(
|
|
648
|
+
super().__init__(parent)
|
|
661
649
|
self._atf = atf
|
|
662
650
|
|
|
663
651
|
self.setTabsClosable(False)
|
|
664
|
-
self.setTabPosition(self.East)
|
|
652
|
+
self.setTabPosition(self.TabPosition.East)
|
|
665
653
|
|
|
666
654
|
self._figures = []
|
|
667
655
|
self._axes = []
|
|
@@ -720,7 +708,7 @@ class AtfTab(TabWidget):
|
|
|
720
708
|
axes.cla()
|
|
721
709
|
del self._figures, self._axes
|
|
722
710
|
gc.collect()
|
|
723
|
-
super(
|
|
711
|
+
super().deleteLater()
|
|
724
712
|
|
|
725
713
|
|
|
726
714
|
class CsvTab(TabWidget):
|
|
@@ -730,9 +718,9 @@ class CsvTab(TabWidget):
|
|
|
730
718
|
The given log must have a time variable set.
|
|
731
719
|
"""
|
|
732
720
|
def __init__(self, parent, log, filename):
|
|
733
|
-
super(
|
|
721
|
+
super().__init__(parent)
|
|
734
722
|
self.setTabsClosable(False)
|
|
735
|
-
self.setTabPosition(self.East)
|
|
723
|
+
self.setTabPosition(self.TabPosition.East)
|
|
736
724
|
self._log = log.npview()
|
|
737
725
|
self._filename = filename
|
|
738
726
|
self._figures = []
|
|
@@ -819,7 +807,7 @@ class CsvTab(TabWidget):
|
|
|
819
807
|
axes.cla()
|
|
820
808
|
del self._figures, self._axes
|
|
821
809
|
gc.collect()
|
|
822
|
-
super(
|
|
810
|
+
super().deleteLater()
|
|
823
811
|
|
|
824
812
|
|
|
825
813
|
class MatTab(TabWidget):
|
|
@@ -827,9 +815,9 @@ class MatTab(TabWidget):
|
|
|
827
815
|
A widget displaying a MAT file.
|
|
828
816
|
"""
|
|
829
817
|
def __init__(self, parent, mat, filename):
|
|
830
|
-
super(
|
|
818
|
+
super().__init__(parent)
|
|
831
819
|
self.setTabsClosable(False)
|
|
832
|
-
self.setTabPosition(self.East)
|
|
820
|
+
self.setTabPosition(self.TabPosition.East)
|
|
833
821
|
self._figures = []
|
|
834
822
|
self._filename = filename
|
|
835
823
|
self._axes = []
|
|
@@ -907,7 +895,7 @@ class MatTab(TabWidget):
|
|
|
907
895
|
axes.cla()
|
|
908
896
|
del self._figures, self._axes
|
|
909
897
|
gc.collect()
|
|
910
|
-
super(
|
|
898
|
+
super().deleteLater()
|
|
911
899
|
|
|
912
900
|
|
|
913
901
|
class TxtTab(TabWidget):
|
|
@@ -915,9 +903,9 @@ class TxtTab(TabWidget):
|
|
|
915
903
|
A widget displaying a TXT file (with lots of heuristics!).
|
|
916
904
|
"""
|
|
917
905
|
def __init__(self, parent, data, filename):
|
|
918
|
-
super(
|
|
906
|
+
super().__init__(parent)
|
|
919
907
|
self.setTabsClosable(False)
|
|
920
|
-
self.setTabPosition(self.East)
|
|
908
|
+
self.setTabPosition(self.TabPosition.East)
|
|
921
909
|
self._figures = []
|
|
922
910
|
self._filename = filename
|
|
923
911
|
self._axes = []
|
|
@@ -989,7 +977,7 @@ class TxtTab(TabWidget):
|
|
|
989
977
|
axes.cla()
|
|
990
978
|
del self._figures, self._axes
|
|
991
979
|
gc.collect()
|
|
992
|
-
super(
|
|
980
|
+
super().deleteLater()
|
|
993
981
|
|
|
994
982
|
|
|
995
983
|
class WcpTab(TabWidget):
|
|
@@ -997,9 +985,9 @@ class WcpTab(TabWidget):
|
|
|
997
985
|
A widget displaying a WCP file.
|
|
998
986
|
"""
|
|
999
987
|
def __init__(self, parent, wcp):
|
|
1000
|
-
super(
|
|
988
|
+
super().__init__(parent)
|
|
1001
989
|
self.setTabsClosable(False)
|
|
1002
|
-
self.setTabPosition(self.East)
|
|
990
|
+
self.setTabPosition(self.TabPosition.East)
|
|
1003
991
|
self._wcp = wcp
|
|
1004
992
|
self._figures = []
|
|
1005
993
|
self._axes = []
|
|
@@ -1044,5 +1032,5 @@ class WcpTab(TabWidget):
|
|
|
1044
1032
|
axes.cla()
|
|
1045
1033
|
del self._figures, self._axes
|
|
1046
1034
|
gc.collect()
|
|
1047
|
-
super(
|
|
1035
|
+
super().deleteLater()
|
|
1048
1036
|
|
myokit/gui/explorer.py
CHANGED
|
@@ -4,25 +4,16 @@
|
|
|
4
4
|
# This file is part of Myokit.
|
|
5
5
|
# See http://myokit.org for copyright, sharing, and licensing details.
|
|
6
6
|
#
|
|
7
|
-
from __future__ import absolute_import, division
|
|
8
|
-
from __future__ import print_function, unicode_literals
|
|
9
|
-
|
|
10
|
-
# Standard library imports
|
|
11
|
-
|
|
12
|
-
# Myokit
|
|
13
7
|
import myokit
|
|
8
|
+
import myokit.gui
|
|
14
9
|
|
|
15
|
-
# Qt imports
|
|
16
10
|
from myokit.gui import QtCore, QtGui, QtWidgets
|
|
17
|
-
|
|
18
|
-
# GUI components
|
|
19
|
-
import myokit.gui
|
|
11
|
+
from myokit.gui import matplotlib_backend as backend
|
|
20
12
|
from . import progress
|
|
21
13
|
|
|
22
14
|
# Matplotlib (must be imported _after_ gui has had chance to set backend)
|
|
23
15
|
import matplotlib
|
|
24
16
|
import matplotlib.figure
|
|
25
|
-
from myokit.gui import matplotlib_backend as backend
|
|
26
17
|
|
|
27
18
|
|
|
28
19
|
# Constants
|
|
@@ -44,7 +35,7 @@ class Explorer(QtWidgets.QDialog):
|
|
|
44
35
|
*Extends:* ``QtWidgets.QDialog``
|
|
45
36
|
"""
|
|
46
37
|
def __init__(self, parent, sim_method, output_stream, duration=1000):
|
|
47
|
-
super(
|
|
38
|
+
super().__init__(parent)
|
|
48
39
|
self.setWindowTitle('Myokit Explorer')
|
|
49
40
|
self._sim_method = sim_method
|
|
50
41
|
self._stream = output_stream
|
|
@@ -84,7 +75,8 @@ class Explorer(QtWidgets.QDialog):
|
|
|
84
75
|
self._close_button = QtWidgets.QPushButton('Close')
|
|
85
76
|
self._close_button.clicked.connect(self.action_close)
|
|
86
77
|
# Create button layout
|
|
87
|
-
button_layout = QtWidgets.QBoxLayout(
|
|
78
|
+
button_layout = QtWidgets.QBoxLayout(
|
|
79
|
+
QtWidgets.QBoxLayout.Direction.LeftToRight)
|
|
88
80
|
button_layout.addWidget(label1)
|
|
89
81
|
button_layout.addWidget(self._pre_field)
|
|
90
82
|
button_layout.addWidget(label2)
|
|
@@ -93,14 +85,16 @@ class Explorer(QtWidgets.QDialog):
|
|
|
93
85
|
button_layout.addWidget(self._run_button)
|
|
94
86
|
# Create graph options layout
|
|
95
87
|
graph_option_layout = QtWidgets.QBoxLayout(
|
|
96
|
-
QtWidgets.QBoxLayout.LeftToRight)
|
|
88
|
+
QtWidgets.QBoxLayout.Direction.LeftToRight)
|
|
97
89
|
graph_option_layout.addWidget(self._select_x)
|
|
98
90
|
graph_option_layout.addWidget(self._select_y)
|
|
99
91
|
# Create bottom layout
|
|
100
|
-
bottom_layout = QtWidgets.QBoxLayout(
|
|
92
|
+
bottom_layout = QtWidgets.QBoxLayout(
|
|
93
|
+
QtWidgets.QBoxLayout.Direction.LeftToRight)
|
|
101
94
|
bottom_layout.addWidget(self._close_button)
|
|
102
95
|
# Create central layout
|
|
103
|
-
layout = QtWidgets.QBoxLayout(
|
|
96
|
+
layout = QtWidgets.QBoxLayout(
|
|
97
|
+
QtWidgets.QBoxLayout.Direction.TopToBottom)
|
|
104
98
|
layout.addLayout(button_layout)
|
|
105
99
|
layout.addLayout(graph_option_layout)
|
|
106
100
|
layout.addWidget(self._canvas)
|
|
@@ -155,11 +149,11 @@ class Explorer(QtWidgets.QDialog):
|
|
|
155
149
|
"""
|
|
156
150
|
pbar = progress.ProgressBar(self, 'Creating simulation')
|
|
157
151
|
QtWidgets.QApplication.processEvents(
|
|
158
|
-
QtCore.QEventLoop.ExcludeUserInputEvents)
|
|
152
|
+
QtCore.QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents)
|
|
159
153
|
try:
|
|
160
154
|
pbar.show()
|
|
161
155
|
QtWidgets.QApplication.processEvents(
|
|
162
|
-
QtCore.QEventLoop.ExcludeUserInputEvents)
|
|
156
|
+
QtCore.QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents)
|
|
163
157
|
# Create and run simulation
|
|
164
158
|
out = self._sim_method()
|
|
165
159
|
if type(out) == str:
|
|
@@ -168,7 +162,7 @@ class Explorer(QtWidgets.QDialog):
|
|
|
168
162
|
else:
|
|
169
163
|
m, p, s = out
|
|
170
164
|
QtWidgets.QApplication.processEvents(
|
|
171
|
-
QtCore.QEventLoop.ExcludeUserInputEvents)
|
|
165
|
+
QtCore.QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents)
|
|
172
166
|
pre = float(self._pre_field.text())
|
|
173
167
|
run = float(self._run_field.text())
|
|
174
168
|
if pre:
|
|
@@ -176,7 +170,7 @@ class Explorer(QtWidgets.QDialog):
|
|
|
176
170
|
d = s.run(run, progress=pbar.reporter()).npview()
|
|
177
171
|
self._stream.write('Final state: \n' + m.format_state(s.state()))
|
|
178
172
|
QtWidgets.QApplication.processEvents(
|
|
179
|
-
QtCore.QEventLoop.ExcludeUserInputEvents)
|
|
173
|
+
QtCore.QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents)
|
|
180
174
|
except myokit.SimulationCancelledError:
|
|
181
175
|
return
|
|
182
176
|
except myokit.MyokitError as e:
|
|
@@ -189,7 +183,7 @@ class Explorer(QtWidgets.QDialog):
|
|
|
189
183
|
pbar.close()
|
|
190
184
|
pbar.deleteLater()
|
|
191
185
|
QtWidgets.QApplication.processEvents(
|
|
192
|
-
QtCore.QEventLoop.ExcludeUserInputEvents)
|
|
186
|
+
QtCore.QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents)
|
|
193
187
|
# Reset combo-box keys?
|
|
194
188
|
reset_keys = True
|
|
195
189
|
if self._keys:
|