modusa 0.3.64__tar.gz → 0.3.65__tar.gz
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.
- {modusa-0.3.64 → modusa-0.3.65}/PKG-INFO +1 -1
- {modusa-0.3.64 → modusa-0.3.65}/pyproject.toml +1 -1
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/plotter.py +52 -10
- {modusa-0.3.64 → modusa-0.3.65}/LICENSE.md +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/README.md +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/.DS_Store +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/__init__.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/config.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/decorators.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/generate_docs_source.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/generate_template.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/list_authors.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/list_plugins.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/main.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/templates/generator.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/templates/io.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/templates/model.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/templates/plugin.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/templates/test.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/devtools/templates/tool.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/fonts/NotoSansDevanagari-Regular.ttf +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/generators/__init__.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/generators/audio.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/generators/audio_waveforms.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/generators/base.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/generators/ftds.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/generators/s1d.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/generators/s2d.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/generators/s_ax.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/generators/t_ax.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/generators/tds.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/__init__.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/__pycache__/signal1D.cpython-312.pyc.4443461152 +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/audio.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/base.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/data.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/ftds.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/s1d.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/s2d.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/s_ax.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/t_ax.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/tds.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/plugins/__init__.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/plugins/base.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/__init__.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/_plotter_old.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/ann_loader.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/audio_converter.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/audio_loader.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/audio_player.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/audio_recorder.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/base.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/math_ops.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/tools/youtube_downloader.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/utils/.DS_Store +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/utils/__init__.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/utils/config.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/utils/excp.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/utils/logger.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/utils/np_func_cat.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/src/modusa/utils/plot.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/__init__.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/data/song1.mp3 +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/data/song1.wav +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_generators/audio_waveform.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_generators/test_audio.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_generators/test_ftds.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_generators/test_s1d.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_generators/test_s2d.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_generators/test_s_ax.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_generators/test_signal.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_generators/test_signal_generator.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_generators/test_t_ax.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_generators/test_tds.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_io/audio_player.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_io/plotter.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_models/test_data.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_models/test_t_ax.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_plugins/youtube_audio_loader.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/frequency_domain_signal.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/spectrogram.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/test_axis.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/test_feature_time_domain_signal.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/test_frequency_time_domain_signal.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/test_signal1D.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/test_signal2D.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/test_time_domain_signal.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/test_u_ax.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/test_window_signal.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_signals/time_domain_signal.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_tools/test_audio_converter.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_tools/test_fourier_tranform.py +0 -0
- {modusa-0.3.64 → modusa-0.3.65}/tests/test_tools/test_math_ops.py +0 -0
|
@@ -43,14 +43,14 @@ class Fig:
|
|
|
43
43
|
of annotations, events.
|
|
44
44
|
"""
|
|
45
45
|
|
|
46
|
-
def __init__(self, arrangement="asm", xlim=None):
|
|
46
|
+
def __init__(self, arrangement="asm", xlim=None, width=16):
|
|
47
47
|
|
|
48
48
|
self._xlim = xlim
|
|
49
49
|
self._curr_row_idx = 1 # Starting from 1 because row 0 is reserved for reference subplot
|
|
50
50
|
self._curr_color_idx = 0 # So that we have different color across all the subplots to avoid legend confusion
|
|
51
51
|
|
|
52
52
|
# Subplot setup
|
|
53
|
-
self._fig, self._axs = self._generate_subplots(arrangement) # This will fill in the all the above variables
|
|
53
|
+
self._fig, self._axs = self._generate_subplots(arrangement, width) # This will fill in the all the above variables
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
def _get_curr_row(self):
|
|
@@ -96,12 +96,13 @@ class Fig:
|
|
|
96
96
|
return [x[0] - dx / 2, x[-1] + dx / 2, y[-1] + dy / 2, y[0] - dy / 2]
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
def _generate_subplots(self, arrangement):
|
|
99
|
+
def _generate_subplots(self, arrangement, width):
|
|
100
100
|
"""
|
|
101
101
|
Generate subplots based on the configuration.
|
|
102
102
|
"""
|
|
103
103
|
|
|
104
104
|
xlim = self._xlim
|
|
105
|
+
fig_width = width
|
|
105
106
|
|
|
106
107
|
n_aux_sp = arrangement.count("a")
|
|
107
108
|
n_signal_sp = arrangement.count("s")
|
|
@@ -126,7 +127,7 @@ class Fig:
|
|
|
126
127
|
fig_height = height["r"] + (n_aux_sp * height["a"]) + (n_signal_sp * height["s"]) + (n_matrix_sp * height["m"])
|
|
127
128
|
|
|
128
129
|
# Create figure and axs
|
|
129
|
-
fig, axs = plt.subplots(n_sp, 2, figsize=(
|
|
130
|
+
fig, axs = plt.subplots(n_sp, 2, figsize=(fig_width, fig_height), height_ratios=height_ratios, width_ratios=[1, cbar_width])
|
|
130
131
|
|
|
131
132
|
for i, char in enumerate(arrangement): # For each of the subplots, we modify the layout accordingly
|
|
132
133
|
if char == "r":
|
|
@@ -156,7 +157,7 @@ class Fig:
|
|
|
156
157
|
|
|
157
158
|
return fig, axs
|
|
158
159
|
|
|
159
|
-
def add_signal(self, y, x=None, c=None, ls=None, lw=None, m=None, ms=3, label=None, ylabel=None, ylim=None, ax=None):
|
|
160
|
+
def add_signal(self, y, x=None, c=None, ls=None, lw=None, m=None, ms=3, label=None, ylabel=None, ylim=None, yticks=None, yticklabels=None, xticks=None, xticklabels=None, ax=None):
|
|
160
161
|
"""
|
|
161
162
|
Add signal to the figure.
|
|
162
163
|
|
|
@@ -192,6 +193,14 @@ class Fig:
|
|
|
192
193
|
ylim: tuple
|
|
193
194
|
- y-lim for the plot.
|
|
194
195
|
- Default: None
|
|
196
|
+
yticks: Arraylike
|
|
197
|
+
- Positions at which to place y-axis ticks.
|
|
198
|
+
yticklabels : list of str, optional
|
|
199
|
+
- Labels corresponding to `yticks`. Must be the same length as `yticks`.
|
|
200
|
+
xticks: Arraylike
|
|
201
|
+
- Positions at which to place x-axis ticks.
|
|
202
|
+
xticklabels : list of str, optional
|
|
203
|
+
- Labels corresponding to `xticks`. Must be the same length as `xticks`.
|
|
195
204
|
ax: int
|
|
196
205
|
- Which specific axis to plot (1, 2, 3, ...)
|
|
197
206
|
- None
|
|
@@ -203,17 +212,32 @@ class Fig:
|
|
|
203
212
|
|
|
204
213
|
curr_row = self._get_curr_row() if ax is None else self._axs[ax]
|
|
205
214
|
|
|
206
|
-
if x is None:
|
|
215
|
+
if x is None:
|
|
216
|
+
x = np.arange(y.size)
|
|
207
217
|
|
|
208
|
-
if c is None:
|
|
218
|
+
if c is None:
|
|
219
|
+
c = self._get_new_color()
|
|
209
220
|
|
|
210
221
|
curr_row[0].plot(x, y, color=c, linestyle=ls, linewidth=lw, marker=m, markersize=ms, label=label)
|
|
211
222
|
|
|
212
|
-
if ylabel is not None:
|
|
223
|
+
if ylabel is not None:
|
|
224
|
+
curr_row[0].set_ylabel(ylabel)
|
|
213
225
|
|
|
214
|
-
if ylim is not None:
|
|
226
|
+
if ylim is not None:
|
|
227
|
+
curr_row[0].set_ylim(ylim)
|
|
215
228
|
|
|
216
|
-
|
|
229
|
+
if yticks is not None:
|
|
230
|
+
curr_row[0].set_yticks(yticks)
|
|
231
|
+
if yticklabels is not None:
|
|
232
|
+
curr_row[0].set_yticklabels(yticklabels)
|
|
233
|
+
|
|
234
|
+
if xticks is not None:
|
|
235
|
+
curr_row[0].set_xticks(xticks)
|
|
236
|
+
if xticklabels is not None:
|
|
237
|
+
curr_row[0].set_xticklabels(xticklabels)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def add_matrix(self, M, y=None, x=None, c="gray_r", o="upper", label=None, ylabel=None, ylim=None, yticks=None, yticklabels=None, xticks=None, xticklabels=None, cbar=True, ax=None):
|
|
217
241
|
"""
|
|
218
242
|
Add matrix to the figure.
|
|
219
243
|
|
|
@@ -242,6 +266,14 @@ class Fig:
|
|
|
242
266
|
ylim: tuple
|
|
243
267
|
- y-lim for the plot.
|
|
244
268
|
- Default: None
|
|
269
|
+
yticks: Arraylike
|
|
270
|
+
- Positions at which to place y-axis ticks.
|
|
271
|
+
yticklabels : list of str, optional
|
|
272
|
+
- Labels corresponding to `yticks`. Must be the same length as `yticks`.
|
|
273
|
+
xticks: Arraylike
|
|
274
|
+
- Positions at which to place x-axis ticks.
|
|
275
|
+
xticklabels : list of str, optional
|
|
276
|
+
- Labels corresponding to `xticks`. Must be the same length as `xticks`.
|
|
245
277
|
cbar: bool
|
|
246
278
|
- Show colorbar
|
|
247
279
|
- Default: True
|
|
@@ -274,6 +306,16 @@ class Fig:
|
|
|
274
306
|
cbar = plt.colorbar(im, cax=curr_row[1])
|
|
275
307
|
if label is not None:
|
|
276
308
|
cbar.set_label(label, labelpad=5)
|
|
309
|
+
|
|
310
|
+
if yticks is not None:
|
|
311
|
+
curr_row[0].set_yticks(yticks)
|
|
312
|
+
if yticklabels is not None:
|
|
313
|
+
curr_row[0].set_yticklabels(yticklabels)
|
|
314
|
+
|
|
315
|
+
if xticks is not None:
|
|
316
|
+
curr_row[0].set_xticks(xticks)
|
|
317
|
+
if xticklabels is not None:
|
|
318
|
+
curr_row[0].set_xticklabels(xticklabels)
|
|
277
319
|
|
|
278
320
|
|
|
279
321
|
def add_events(self, events, c=None, ls=None, lw=None, label=None, ax=None):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{modusa-0.3.64 → modusa-0.3.65}/src/modusa/models/__pycache__/signal1D.cpython-312.pyc.4443461152
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|