modusa 0.3.87__py3-none-any.whl → 0.3.89__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.
modusa/__init__.py CHANGED
@@ -8,4 +8,4 @@ from modusa.tools import play, convert, record, save
8
8
  from modusa.tools import download
9
9
  from modusa.tools import load, load_ann
10
10
 
11
- __version__ = "0.3.87"
11
+ __version__ = "0.3.89"
modusa/tools/plotter.py CHANGED
@@ -63,9 +63,13 @@ class Fig:
63
63
  abc: bool
64
64
  - Adds a, b, c, ... to the subplots for easier referencing.
65
65
  - Default: False
66
+ fig_num: str | None
67
+ - Adds a figure number to the top left of the figure.
68
+ - Eg. "1.1"
69
+ - Default: None
66
70
  """
67
71
 
68
- def __init__(self, arrangement="asm", xlim=None, width=16, dark_mode=True, abc=False):
72
+ def __init__(self, arrangement="asm", xlim=None, width=16, dark_mode=True, abc=False, fig_num=None):
69
73
 
70
74
  if dark_mode:
71
75
  plt.style.use("dark_background")
@@ -84,6 +88,7 @@ class Fig:
84
88
  self._curr_row_idx = 1 # Starting from 1 because row 0 is reserved for reference subplot
85
89
  self._curr_color_idx = 0 # So that we have different color across all the subplots to avoid legend confusion
86
90
  self._abc = abc # This tells whether to add a, b, c, ... to the subplots for better referencing
91
+ self._fig_num = fig_num # Add a figure number to the entire figure
87
92
 
88
93
  # Subplot setup
89
94
  self._fig, self._axs = self._generate_subplots(arrangement, width) # This will fill in the all the above variables
@@ -188,8 +193,8 @@ class Fig:
188
193
 
189
194
  axs[i, 0].sharex(axs[0, 0])
190
195
 
196
+ # Add subplot labels (a, b, c, d, ...) for better referencing.
191
197
  if self._abc is True:
192
- # Add subplot labels (a, b, c, d, ...) for better referencing.
193
198
  label_counter = 0
194
199
  for i, char in enumerate(arrangement):
195
200
  if char != "r": # Skip the reference subplot
@@ -197,6 +202,10 @@ class Fig:
197
202
  axs[i, 0].text(-0.06, 0.5, f'({label})', transform=axs[i, 0].transAxes, fontsize=12, fontweight='bold', va='center', ha='right')
198
203
  label_counter += 1
199
204
 
205
+ # Add figure number at top-left
206
+ if self._fig_num is not None:
207
+ fig.text(0.12, 0.9, f'fig - {self._fig_num}', fontsize=10, fontweight='bold', va='top', ha='left', color='black', bbox=dict(boxstyle='round,pad=0.3', facecolor='lightgray', edgecolor='gray', linewidth=1.0))
208
+
200
209
  axs[-1, 0].tick_params(bottom=True, labelbottom=True)
201
210
 
202
211
  # xlim should be applied on reference subplot, rest all subplots will automatically adjust
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modusa
3
- Version: 0.3.87
3
+ Version: 0.3.89
4
4
  Summary: A modular signal analysis python library.
5
5
  Author-Email: Ankit Anand <ankit0.anand0@gmail.com>
6
6
  License: MIT
@@ -1,9 +1,9 @@
1
- modusa-0.3.87.dist-info/METADATA,sha256=-fbp2F5KFpAeF53fmfbwitHuRc6REvD81WfPjkcViqQ,1436
2
- modusa-0.3.87.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
- modusa-0.3.87.dist-info/entry_points.txt,sha256=fmKpleVXj6CdaBVL14WoEy6xx7JQCs85jvzwTi3lePM,73
4
- modusa-0.3.87.dist-info/licenses/LICENSE.md,sha256=JTaXAjx5awk76VArKCx5dUW8vmLEWsL_ZlR7-umaHbA,1078
1
+ modusa-0.3.89.dist-info/METADATA,sha256=NNLGEDGz8TQg9DObYLhLjrcxbwVPbpTxUn-FIvOhhnc,1436
2
+ modusa-0.3.89.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
+ modusa-0.3.89.dist-info/entry_points.txt,sha256=fmKpleVXj6CdaBVL14WoEy6xx7JQCs85jvzwTi3lePM,73
4
+ modusa-0.3.89.dist-info/licenses/LICENSE.md,sha256=JTaXAjx5awk76VArKCx5dUW8vmLEWsL_ZlR7-umaHbA,1078
5
5
  modusa/.DS_Store,sha256=_gm6qJREwfMi8dE7n5S89_RG46u5t3xHyD-smNhtNoM,6148
6
- modusa/__init__.py,sha256=sXYdxVu_AIIcqIPozWeyHtXvb7NH760RLGLoSyTMu7U,307
6
+ modusa/__init__.py,sha256=MuQmDwfXDeV3r9H04bX1EnCfQZBRdaUiHtc1hzJYHbg,307
7
7
  modusa/config.py,sha256=bTqK4t00FZqERVITrxW_q284aDDJAa9aMSfFknfR-oU,280
8
8
  modusa/decorators.py,sha256=8zeNX_wE37O6Vp0ysR4-WCZaEL8mq8dyCF_I5DHOzks,5905
9
9
  modusa/devtools/generate_docs_source.py,sha256=UDflHsk-Yh9-3YJTVBzKL32y8hcxiRgAlFEBTMiDqwM,3301
@@ -51,7 +51,7 @@ modusa/tools/audio_recorder.py,sha256=K_LGqsPdjTdf3figEZTSQLmgMzYWgz18HTO8C1j5fE
51
51
  modusa/tools/audio_saver.py,sha256=ldzfr_AydsHTnKbxmBLJblN-hLzTmOlppOm306xI4Ug,510
52
52
  modusa/tools/base.py,sha256=C0ESJ0mIfjjRlAkRbSetNtMoOfS6IrHBjexRp3l_Mh4,1293
53
53
  modusa/tools/math_ops.py,sha256=ZZ7U4DgqT7cOeE7_Lzi_Qq-48WYfwR9_osbZwTmE9eg,8690
54
- modusa/tools/plotter.py,sha256=dY3-VdulGufoblaLkN1YIk5WVmyZHUVGAlFtoV6qLhc,24415
54
+ modusa/tools/plotter.py,sha256=ZSBmz-FHE3sJPawbaWGIahg3Odo9Hk79F9C3_H1rbIo,24885
55
55
  modusa/tools/youtube_downloader.py,sha256=hB_X8-7nOHXOlxg6vv3wyhBLoAsWyomrULP6_uCQL7s,1698
56
56
  modusa/utils/.DS_Store,sha256=nLXMwF7QJNuglLI_Gk74F7vl5Dyus2Wd74Mgowijmdo,6148
57
57
  modusa/utils/__init__.py,sha256=1oLL20yLB1GL9IbFiZD8OReDqiCpFr-yetIR6x1cNkI,23
@@ -60,4 +60,4 @@ modusa/utils/excp.py,sha256=L9vhaGjKpv9viJYdmC9n5ndmk2GVbUBuFyZyhAQZmWY,906
60
60
  modusa/utils/logger.py,sha256=K0rsnObeNKCxlNeSnVnJeRhgfmob6riB2uyU7h3dDmA,571
61
61
  modusa/utils/np_func_cat.py,sha256=TyIFgRc6bARRMDnZxlVURO5Z0I-GWhxRONYyIv-Vwxs,1007
62
62
  modusa/utils/plot.py,sha256=s_vNdxvKfwxEngvJPgrF1PcmxZNnNaaXPViHWjyjJ-c,5335
63
- modusa-0.3.87.dist-info/RECORD,,
63
+ modusa-0.3.89.dist-info/RECORD,,