-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexaplot.pyi
266 lines (252 loc) · 8.98 KB
/
exaplot.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
from numbers import Real
from os import PathLike
from pathlib import Path
from typing import Callable, Generic, Sequence, TypeVar, overload
RunParamType = TypeVar('RunParamType', str, int, float)
class RunParam(Generic[RunParamType]):
@overload
def __init__(self, default: RunParamType, /, display: str = None) -> None:
"""Run parameter with a default value and an optional display
representation.
:param default: default value
:type default: RunParamType
:param display: display string, defaults to None
:type display: str, optional
"""
@overload
def __init__(self, type: type[RunParamType], /, display: str = None) -> None:
"""Run parameter with no default value and an optional display
representation.
:param type: value's type
:type type: type[RunParamType]
:param display: display string, defaults to None
:type display: str, optional
"""
@overload
def init(plots: int = 1, /, **params: str | int | float | RunParam[str] | RunParam[int] | RunParam[float]) -> None:
"""Set the number of plots and the parameters for the `run` function.
:param plots: number of plots, defaults to 1
:type plots: int, optional
"""
@overload
def init(plots: list[tuple[int, int, int, int]], /, **params: str | int | float | RunParam[str] | RunParam[int] | RunParam[float]) -> None:
"""Set the plot arrangement and the parameters for the `run` function.
:param plots: plot arrangement
:type plots: list[tuple[int, int, int, int]]
"""
def datafile(
*,
enable: bool = True,
path: PathLike | Callable[[], PathLike] = Path("data.hdf5"),
prompt: bool = False,
) -> None:
"""Configure data file settings.
:param enable: enable or disable writing to a data file, defaults to True
:type enable: bool, optional
:param path: data file path, defaults to Path("data.hdf5")
:type path: PathLike | Callable[[], PathLike], optional
:param prompt: prompt before running, defaults to False
:type prompt: bool, optional
"""
def stop() -> bool:
"""Check if a stop signal has been received.
:rtype: bool
"""
def breakpoint() -> None:
"""Alternative method of stopping. This function will raise a
special `BaseException`-derived exception if a stop signal has been
received. If raised during a run, the application will not prompt
the user with an error (same behavior as if the run completed).
Most scripts should be fine using this, but some scripts may warrant
extra caution when using code/libraries that don't clean up properly
in the event of an exception.
"""
def msg(message: str, /, append: bool = False) -> None:
"""Set the message in the script message box.
:param message: message string
:type message: str
:param append: append to the current message, defaults to False
:type append: bool, optional
"""
class PlotProperties:
class MinSize:
@property
def w(self) -> int: ...
@w.setter
def w(self, value: int) -> None: ...
@property
def h(self) -> int: ...
@h.setter
def h(self, value: int) -> None: ...
class Range:
@property
def min(self) -> Real: ...
@min.setter
def min(self, value: Real) -> None: ...
@property
def max(self) -> Real: ...
@max.setter
def max(self, value: Real) -> None: ...
class Line:
@property
def type(self) -> str: ...
@type.setter
def type(self, value: str) -> None: ...
@property
def color(self) -> str: ...
@color.setter
def color(self, value: str) -> None: ...
@property
def style(self) -> str: ...
@style.setter
def style(self, value: str) -> None: ...
class Points:
@property
def shape(self) -> str: ...
@shape.setter
def shape(self, value: str) -> None: ...
@property
def color(self) -> str: ...
@color.setter
def color(self, value: str) -> None: ...
@property
def size(self) -> float: ...
@size.setter
def size(self, value: float) -> None: ...
class DataSize:
@property
def x(self) -> int: ...
@x.setter
def x(self, value: int) -> None: ...
@property
def y(self) -> int: ...
@y.setter
def y(self, value: int) -> None: ...
class Color:
@property
def min(self) -> str: ...
@min.setter
def min(self, value: str) -> None: ...
@property
def max(self) -> str: ...
@max.setter
def max(self, value: str) -> None: ...
class _Tab:
def show(self) -> None: ...
@property
def x_range(self) -> PlotProperties.Range: ...
@x_range.setter
def x_range(self, value: tuple[int, int]) -> None: ...
@property
def y_range(self) -> PlotProperties.Range: ...
@y_range.setter
def y_range(self, value: tuple[int, int]) -> None: ...
class TwoDimen(_Tab):
@property
def line(self) -> PlotProperties.Line: ...
@line.setter
def line(self, value: tuple[str, str, str]) -> None: ...
@property
def points(self) -> PlotProperties.Points: ...
@points.setter
def points(self, value: tuple[str, str, float]) -> None: ...
@property
def autorescale_axes(self) -> bool: ...
@autorescale_axes.setter
def autorescale_axes(self, value: bool) -> None:...
class ColorMap(_Tab):
@property
def z_range(self) -> PlotProperties.Range: ...
@z_range.setter
def z_range(self, value: tuple[int, int]) -> None: ...
@property
def data_size(self) -> PlotProperties.DataSize: ...
@data_size.setter
def data_size(self, value: tuple[int, int]) -> None: ...
@property
def color(self) -> PlotProperties.Color: ...
@color.setter
def color(self, value: tuple[str, str]) -> None: ...
@property
def autorescale_axes(self) -> bool: ...
@autorescale_axes.setter
def autorescale_axes(self, value: bool) -> None:...
@property
def autorescale_data(self) -> bool: ...
@autorescale_data.setter
def autorescale_data(self, value: bool) -> None:...
class Plot:
@overload
def __call__(self) -> None:
"""Clears the plot."""
@overload
def __call__(self, x: Real, y: Real, *, write: bool = True) -> None:
"""Plots a data point to the 2D plot.
:param x: x-value
:type x: Real
:param y: y-value
:type y: Real
:param write: write data to disk, defaults to True
:type write: bool, optional
"""
@overload
def __call__(self, x: Sequence[Real], y: Sequence[Real], *, write: bool = True) -> None:
"""Plots multiple data points to the 2D plot.
:param x: x-values
:type x: Sequence[Real]
:param y: y-values
:type y: Sequence[Real]
:param write: write data to disk, defaults to True
:type write: bool, optional
"""
@overload
def __call__(self, col: int, row: int, value: Real, *, write: bool = True) -> None:
"""Plots a value to a specifed cell in the color map.
:param col: target column (from left to right)
:type col: int
:param row: target row (from down to up)
:type row: int
:param value: cell value
:type value: Real
:param write: write data to disk, defaults to True
:type write: bool, optional
"""
@overload
def __call__(self, row: int, values: Sequence[Real], *, write: bool = True) -> None:
"""Plots a row of cell values to the color map.
:param row: target row (from down to up)
:type row: int
:param values: row values
:type values: Sequence[Real]
:param write: write data to disk, defaults to True
:type write: bool, optional
"""
@overload
def __call__(self, frame: Sequence[Sequence[Real]], *, write: bool = True) -> None:
"""Plots a frame of cell values to the color map.
:param frame: sequence of rows
:type frame: Sequence[Sequence[Real]]
:param write: write data to disk, defaults to True
:type write: bool, optional
"""
@property
def title(self) -> str: ...
@title.setter
def title(self, value: str) -> None: ...
@property
def x_axis(self) -> str: ...
@x_axis.setter
def x_axis(self, value: str) -> None: ...
@property
def y_axis(self) -> str: ...
@y_axis.setter
def y_axis(self, value: str) -> None: ...
@property
def min_size(self) -> PlotProperties.MinSize: ...
@min_size.setter
def min_size(self, value: tuple[int, int]) -> None: ...
@property
def two_dimen(self) -> PlotProperties.TwoDimen: ...
@property
def color_map(self) -> PlotProperties.ColorMap: ...
plot: list[Plot]