modusa 0.3.57__tar.gz → 0.3.58__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.57 → modusa-0.3.58}/PKG-INFO +1 -1
- {modusa-0.3.57 → modusa-0.3.58}/pyproject.toml +1 -1
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/plotter.py +32 -7
- {modusa-0.3.57 → modusa-0.3.58}/LICENSE.md +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/README.md +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/.DS_Store +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/__init__.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/config.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/decorators.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/generate_docs_source.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/generate_template.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/list_authors.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/list_plugins.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/main.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/templates/generator.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/templates/io.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/templates/model.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/templates/plugin.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/templates/test.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/devtools/templates/tool.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/fonts/NotoSansDevanagari-Regular.ttf +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/generators/__init__.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/generators/audio.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/generators/audio_waveforms.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/generators/base.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/generators/ftds.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/generators/s1d.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/generators/s2d.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/generators/s_ax.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/generators/t_ax.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/generators/tds.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/__init__.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/__pycache__/signal1D.cpython-312.pyc.4443461152 +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/audio.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/base.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/data.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/ftds.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/s1d.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/s2d.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/s_ax.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/t_ax.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/models/tds.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/plugins/__init__.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/plugins/base.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/__init__.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/_plotter_old.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/ann_loader.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/audio_converter.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/audio_loader.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/audio_player.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/audio_recorder.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/base.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/math_ops.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/tools/youtube_downloader.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/utils/.DS_Store +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/utils/__init__.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/utils/config.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/utils/excp.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/utils/logger.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/utils/np_func_cat.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/src/modusa/utils/plot.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/__init__.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/data/song1.mp3 +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/data/song1.wav +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_generators/audio_waveform.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_generators/test_audio.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_generators/test_ftds.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_generators/test_s1d.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_generators/test_s2d.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_generators/test_s_ax.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_generators/test_signal.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_generators/test_signal_generator.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_generators/test_t_ax.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_generators/test_tds.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_io/audio_player.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_io/plotter.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_models/test_data.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_models/test_t_ax.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_plugins/youtube_audio_loader.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/frequency_domain_signal.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/spectrogram.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/test_axis.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/test_feature_time_domain_signal.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/test_frequency_time_domain_signal.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/test_signal1D.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/test_signal2D.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/test_time_domain_signal.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/test_u_ax.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/test_window_signal.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_signals/time_domain_signal.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_tools/test_audio_converter.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_tools/test_fourier_tranform.py +0 -0
- {modusa-0.3.57 → modusa-0.3.58}/tests/test_tools/test_math_ops.py +0 -0
|
@@ -12,8 +12,8 @@ import matplotlib.font_manager as fm
|
|
|
12
12
|
import matplotlib.pyplot as plt
|
|
13
13
|
import matplotlib.gridspec as gridspec
|
|
14
14
|
from matplotlib.patches import Rectangle
|
|
15
|
-
|
|
16
15
|
import numpy as np
|
|
16
|
+
import fnmatch
|
|
17
17
|
|
|
18
18
|
#===== Loading Devanagari font ========
|
|
19
19
|
def _load_devanagari_font():
|
|
@@ -325,7 +325,7 @@ class Fig:
|
|
|
325
325
|
else:
|
|
326
326
|
curr_row[0].axvline(x=event, color=c, linestyle=ls, linewidth=lw)
|
|
327
327
|
|
|
328
|
-
def add_annotation(self, ann, label=None, ax=None):
|
|
328
|
+
def add_annotation(self, ann, label=None, patterns=None, ax=None):
|
|
329
329
|
"""
|
|
330
330
|
Add annotation to the figure.
|
|
331
331
|
|
|
@@ -338,6 +338,10 @@ class Fig:
|
|
|
338
338
|
- Label for the annotation type.
|
|
339
339
|
- This will appear to the right of the aux plot.
|
|
340
340
|
- Default: None
|
|
341
|
+
patterns: list[str]
|
|
342
|
+
- Patterns to group annotations
|
|
343
|
+
- E.g., "*R" or "<tag>*" or ["A*", "*B"]
|
|
344
|
+
- All elements in a group will have same color.
|
|
341
345
|
ax: int
|
|
342
346
|
- Which specific axis to plot (1, 2, 3, ...)
|
|
343
347
|
- None
|
|
@@ -349,7 +353,24 @@ class Fig:
|
|
|
349
353
|
|
|
350
354
|
xlim = self._xlim
|
|
351
355
|
|
|
352
|
-
|
|
356
|
+
if isinstance(patterns, str): patterns = [patterns]
|
|
357
|
+
|
|
358
|
+
if patterns is not None:
|
|
359
|
+
for i, (start, end, tag) in enumerate(ann):
|
|
360
|
+
for j, pattern in enumerate(patterns):
|
|
361
|
+
if fnmatch.fnmatch(tag, pattern):
|
|
362
|
+
ann[i] = (start, end, tag, j)
|
|
363
|
+
break
|
|
364
|
+
else:
|
|
365
|
+
ann[i] = (start, end, tag, None)
|
|
366
|
+
else:
|
|
367
|
+
for i, (start, end, tag) in enumerate(ann):
|
|
368
|
+
ann[i] = (start, end, tag, None)
|
|
369
|
+
|
|
370
|
+
colors = plt.rcParams['axes.prop_cycle'].by_key()['color']
|
|
371
|
+
print(ann)
|
|
372
|
+
|
|
373
|
+
for i, (start, end, tag, group) in enumerate(ann):
|
|
353
374
|
# We make sure that we only plot annotation that are within the x range of the current view
|
|
354
375
|
if xlim is not None:
|
|
355
376
|
if start >= xlim[1] or end <= xlim[0]:
|
|
@@ -359,8 +380,10 @@ class Fig:
|
|
|
359
380
|
start = max(start, xlim[0])
|
|
360
381
|
end = min(end, xlim[1])
|
|
361
382
|
|
|
362
|
-
|
|
363
|
-
|
|
383
|
+
if group is not None:
|
|
384
|
+
box_color = colors[group]
|
|
385
|
+
else:
|
|
386
|
+
box_color = "lightgray"
|
|
364
387
|
|
|
365
388
|
width = end - start
|
|
366
389
|
rect = Rectangle((start, 0), width, 1, facecolor=box_color, edgecolor="black", alpha=0.7)
|
|
@@ -374,8 +397,10 @@ class Fig:
|
|
|
374
397
|
|
|
375
398
|
text_obj.set_clip_path(rect)
|
|
376
399
|
else:
|
|
377
|
-
|
|
378
|
-
|
|
400
|
+
if group is not None:
|
|
401
|
+
box_color = colors[group]
|
|
402
|
+
else:
|
|
403
|
+
box_color = "lightgray"
|
|
379
404
|
|
|
380
405
|
width = end - start
|
|
381
406
|
rect = Rectangle((start, 0), width, 1, facecolor=box_color, edgecolor="black", alpha=0.7)
|
|
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.57 → modusa-0.3.58}/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
|