modusa 0.3.26__tar.gz → 0.3.28__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.26 → modusa-0.3.28}/PKG-INFO +1 -1
- {modusa-0.3.26 → modusa-0.3.28}/pyproject.toml +1 -1
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/tools/plotter.py +43 -12
- {modusa-0.3.26 → modusa-0.3.28}/LICENSE.md +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/README.md +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/.DS_Store +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/__init__.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/config.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/decorators.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/generate_docs_source.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/generate_template.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/list_authors.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/list_plugins.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/main.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/templates/generator.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/templates/io.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/templates/model.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/templates/plugin.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/templates/test.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/devtools/templates/tool.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/generators/__init__.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/generators/audio.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/generators/audio_waveforms.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/generators/base.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/generators/ftds.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/generators/s1d.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/generators/s2d.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/generators/s_ax.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/generators/t_ax.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/generators/tds.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/__init__.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/__pycache__/signal1D.cpython-312.pyc.4443461152 +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/audio.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/base.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/data.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/ftds.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/s1d.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/s2d.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/s_ax.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/t_ax.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/models/tds.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/plugins/__init__.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/plugins/base.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/tools/__init__.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/tools/ann_loader.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/tools/audio_converter.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/tools/audio_loader.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/tools/audio_player.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/tools/base.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/tools/math_ops.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/tools/youtube_downloader.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/utils/.DS_Store +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/utils/__init__.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/utils/config.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/utils/excp.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/utils/logger.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/utils/np_func_cat.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/src/modusa/utils/plot.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/__init__.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/data/song1.mp3 +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/data/song1.wav +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_generators/audio_waveform.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_generators/test_audio.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_generators/test_ftds.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_generators/test_s1d.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_generators/test_s2d.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_generators/test_s_ax.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_generators/test_signal.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_generators/test_signal_generator.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_generators/test_t_ax.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_generators/test_tds.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_io/audio_player.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_io/plotter.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_models/test_data.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_models/test_t_ax.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_plugins/youtube_audio_loader.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/frequency_domain_signal.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/spectrogram.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/test_axis.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/test_feature_time_domain_signal.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/test_frequency_time_domain_signal.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/test_signal1D.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/test_signal2D.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/test_time_domain_signal.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/test_u_ax.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/test_window_signal.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_signals/time_domain_signal.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_tools/test_audio_converter.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_tools/test_fourier_tranform.py +0 -0
- {modusa-0.3.26 → modusa-0.3.28}/tests/test_tools/test_math_ops.py +0 -0
| @@ -7,8 +7,27 @@ import matplotlib.gridspec as gridspec | |
| 7 7 | 
             
            from matplotlib.patches import Rectangle
         | 
| 8 8 | 
             
            from mpl_toolkits.axes_grid1.inset_locator import inset_axes
         | 
| 9 9 |  | 
| 10 | 
            +
            # Helper for 2D plot
         | 
| 11 | 
            +
            def _calculate_extent(x, y):
         | 
| 12 | 
            +
            	# Handle spacing safely
         | 
| 13 | 
            +
            	if len(x) > 1:
         | 
| 14 | 
            +
            		dx = x[1] - x[0]
         | 
| 15 | 
            +
            	else:
         | 
| 16 | 
            +
            		dx = 1  # Default spacing for single value
         | 
| 17 | 
            +
            	if len(y) > 1:
         | 
| 18 | 
            +
            		dy = y[1] - y[0]
         | 
| 19 | 
            +
            	else:
         | 
| 20 | 
            +
            		dy = 1  # Default spacing for single value
         | 
| 21 | 
            +
            		
         | 
| 22 | 
            +
            	return [
         | 
| 23 | 
            +
            		x[0] - dx / 2,
         | 
| 24 | 
            +
            		x[-1] + dx / 2,
         | 
| 25 | 
            +
            		y[0] - dy / 2,
         | 
| 26 | 
            +
            		y[-1] + dy / 2
         | 
| 27 | 
            +
            	]
         | 
| 28 | 
            +
             | 
| 10 29 | 
             
            #======== 1D ===========
         | 
| 11 | 
            -
            def plot1d(*args, ann=None, events=None, xlim=None, ylim=None, xlabel=None, ylabel=None, title=None, legend=None):
         | 
| 30 | 
            +
            def plot1d(*args, ann=None, events=None, xlim=None, ylim=None, xlabel=None, ylabel=None, title=None, legend=None, show_grid=False):
         | 
| 12 31 | 
             
            		"""
         | 
| 13 32 | 
             
            		Plots a 1D signal using matplotlib.
         | 
| 14 33 |  | 
| @@ -53,6 +72,9 @@ def plot1d(*args, ann=None, events=None, xlim=None, ylim=None, xlabel=None, ylab | |
| 53 72 | 
             
            		legend : list[str] | None
         | 
| 54 73 | 
             
            			- List of legend labels corresponding to each signal if plotting multiple lines.
         | 
| 55 74 | 
             
            			- Default: None
         | 
| 75 | 
            +
            		show_grid: bool
         | 
| 76 | 
            +
            			- If you want to show the grid.
         | 
| 77 | 
            +
            			- Default: False
         | 
| 56 78 |  | 
| 57 79 | 
             
            		Returns
         | 
| 58 80 | 
             
            		-------
         | 
| @@ -146,6 +168,10 @@ def plot1d(*args, ann=None, events=None, xlim=None, ylim=None, xlabel=None, ylab | |
| 146 168 | 
             
            			signal_ax.set_xlabel(xlabel)
         | 
| 147 169 | 
             
            		if ylabel is not None:
         | 
| 148 170 | 
             
            			signal_ax.set_ylabel(ylabel)
         | 
| 171 | 
            +
            			
         | 
| 172 | 
            +
            		# Add grid to the plot
         | 
| 173 | 
            +
            		if show_grid is True:
         | 
| 174 | 
            +
            			signal_ax.grid(True, linestyle=':', linewidth=0.7, color='gray', alpha=0.7)
         | 
| 149 175 |  | 
| 150 176 | 
             
            		# Remove the boundaries and ticks from an axis
         | 
| 151 177 | 
             
            		if ann is not None:
         | 
| @@ -159,7 +185,7 @@ def plot1d(*args, ann=None, events=None, xlim=None, ylim=None, xlabel=None, ylab | |
| 159 185 | 
             
            		return fig
         | 
| 160 186 |  | 
| 161 187 | 
             
            #======== 2D ===========
         | 
| 162 | 
            -
            def plot2d(*args, ann=None, events=None, xlim=None, ylim=None, origin="lower", Mlabel=None, xlabel=None, ylabel=None, title=None, legend=None, lm=False):
         | 
| 188 | 
            +
            def plot2d(*args, ann=None, events=None, xlim=None, ylim=None, origin="lower", Mlabel=None, xlabel=None, ylabel=None, title=None, legend=None, lm=False, show_grid=False):
         | 
| 163 189 | 
             
            	"""
         | 
| 164 190 | 
             
            	Plots a 2D matrix (e.g., spectrogram or heatmap) with optional annotations and events.
         | 
| 165 191 |  | 
| @@ -213,6 +239,9 @@ def plot2d(*args, ann=None, events=None, xlim=None, ylim=None, origin="lower", M | |
| 213 239 | 
             
            		- Adds a circular marker for the line.
         | 
| 214 240 | 
             
            		- Default: False
         | 
| 215 241 | 
             
            		- Useful to show the data points.
         | 
| 242 | 
            +
            	show_grid: bool
         | 
| 243 | 
            +
            		- If you want to show the grid.
         | 
| 244 | 
            +
            		- Default: False
         | 
| 216 245 |  | 
| 217 246 | 
             
            	Returns
         | 
| 218 247 | 
             
            	-------
         | 
| @@ -276,16 +305,12 @@ def plot2d(*args, ann=None, events=None, xlim=None, ylim=None, origin="lower", M | |
| 276 305 | 
             
            			if len(signal) == 1: # It means that the axes were not passed
         | 
| 277 306 | 
             
            				y = np.arange(M.shape[0])
         | 
| 278 307 | 
             
            				x = np.arange(M.shape[1])
         | 
| 279 | 
            -
            				 | 
| 280 | 
            -
            				dy = y[1] - y[0]
         | 
| 281 | 
            -
            				extent=[x[0] - dx/2, x[-1] + dx/2, y[0] - dy/2, y[-1] + dy/2]
         | 
| 308 | 
            +
            				extent = _calculate_extent(x, y)
         | 
| 282 309 | 
             
            				im = signal_ax.imshow(M, aspect="auto", origin=origin, cmap="gray_r", extent=extent)
         | 
| 283 310 |  | 
| 284 311 | 
             
            			elif len(signal) == 3: # It means that the axes were passed
         | 
| 285 312 | 
             
            				M, y, x = signal[0], signal[1], signal[2]
         | 
| 286 | 
            -
            				 | 
| 287 | 
            -
            				dy = y[1] - y[0]
         | 
| 288 | 
            -
            				extent=[x[0] - dx/2, x[-1] + dx/2, y[0] - dy/2, y[-1] + dy/2]
         | 
| 313 | 
            +
            				extent = _calculate_extent(x, y)
         | 
| 289 314 | 
             
            				im = signal_ax.imshow(M, aspect="auto", origin=origin, cmap="gray_r", extent=extent)
         | 
| 290 315 |  | 
| 291 316 | 
             
            	# Add annotations
         | 
| @@ -352,7 +377,10 @@ def plot2d(*args, ann=None, events=None, xlim=None, ylim=None, origin="lower", M | |
| 352 377 | 
             
            		signal_ax.set_xlabel(xlabel)
         | 
| 353 378 | 
             
            	if ylabel is not None:
         | 
| 354 379 | 
             
            		signal_ax.set_ylabel(ylabel)
         | 
| 355 | 
            -
             | 
| 380 | 
            +
            		
         | 
| 381 | 
            +
            	# Add grid to the plot
         | 
| 382 | 
            +
            	if show_grid is True:
         | 
| 383 | 
            +
            		signal_ax.grid(True, linestyle=':', linewidth=0.7, color='gray', alpha=0.7)
         | 
| 356 384 |  | 
| 357 385 | 
             
            	# Making annotation axis spines thicker
         | 
| 358 386 | 
             
            	if ann is not None:
         | 
| @@ -365,7 +393,7 @@ def plot2d(*args, ann=None, events=None, xlim=None, ylim=None, origin="lower", M | |
| 365 393 | 
             
            	return fig
         | 
| 366 394 |  | 
| 367 395 | 
             
            #======== Plot distribution ===========
         | 
| 368 | 
            -
            def plot_dist(*args, ann=None, xlim=None, ylim=None, ylabel=None, xlabel=None, title=None, legend=None, show_hist=True, npoints=200):
         | 
| 396 | 
            +
            def plot_dist(*args, ann=None, xlim=None, ylim=None, ylabel=None, xlabel=None, title=None, legend=None, show_hist=True, npoints=200, bins=30):
         | 
| 369 397 | 
             
            		"""
         | 
| 370 398 | 
             
            		Plot distribution.
         | 
| 371 399 |  | 
| @@ -411,6 +439,9 @@ def plot_dist(*args, ann=None, xlim=None, ylim=None, ylabel=None, xlabel=None, t | |
| 411 439 | 
             
            		npoints: int
         | 
| 412 440 | 
             
            			- Number of points for which gaussian needs to be computed between min and max.
         | 
| 413 441 | 
             
            			- Higher value means more points are evaluated with the fitted gaussian, thereby higher resolution.
         | 
| 442 | 
            +
            		bins: int
         | 
| 443 | 
            +
            			- The number of bins for histogram.
         | 
| 444 | 
            +
            			- This is used only to plot the histogram.
         | 
| 414 445 |  | 
| 415 446 | 
             
            		Returns
         | 
| 416 447 | 
             
            		-------
         | 
| @@ -454,11 +485,11 @@ def plot_dist(*args, ann=None, xlim=None, ylim=None, ylabel=None, xlabel=None, t | |
| 454 485 | 
             
            				if legend is not None:
         | 
| 455 486 | 
             
            						dist_ax.plot(x_vals, y_vals, color=colors[i], label=legend[i])
         | 
| 456 487 | 
             
            						if show_hist is True:
         | 
| 457 | 
            -
            								dist_ax.hist(data, bins= | 
| 488 | 
            +
            								dist_ax.hist(data, bins=bins, density=True, alpha=0.3, facecolor=colors[i], edgecolor='black', label=legend[i])
         | 
| 458 489 | 
             
            				else:
         | 
| 459 490 | 
             
            						dist_ax.plot(x_vals, y_vals, color=colors[i])
         | 
| 460 491 | 
             
            						if show_hist is True:
         | 
| 461 | 
            -
            								dist_ax.hist(data, bins= | 
| 492 | 
            +
            								dist_ax.hist(data, bins=bins, density=True, alpha=0.3, facecolor=colors[i], edgecolor='black')
         | 
| 462 493 |  | 
| 463 494 | 
             
            		# Add annotations
         | 
| 464 495 | 
             
            		if ann is not 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
         | 
    
        {modusa-0.3.26 → modusa-0.3.28}/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
         |