modusa 0.3.28__tar.gz → 0.3.29__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.28 → modusa-0.3.29}/PKG-INFO +1 -1
- {modusa-0.3.28 → modusa-0.3.29}/pyproject.toml +1 -1
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/tools/plotter.py +51 -35
- {modusa-0.3.28 → modusa-0.3.29}/LICENSE.md +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/README.md +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/.DS_Store +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/__init__.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/config.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/decorators.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/generate_docs_source.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/generate_template.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/list_authors.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/list_plugins.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/main.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/templates/generator.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/templates/io.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/templates/model.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/templates/plugin.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/templates/test.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/devtools/templates/tool.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/generators/__init__.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/generators/audio.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/generators/audio_waveforms.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/generators/base.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/generators/ftds.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/generators/s1d.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/generators/s2d.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/generators/s_ax.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/generators/t_ax.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/generators/tds.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/__init__.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/__pycache__/signal1D.cpython-312.pyc.4443461152 +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/audio.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/base.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/data.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/ftds.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/s1d.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/s2d.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/s_ax.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/t_ax.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/models/tds.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/plugins/__init__.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/plugins/base.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/tools/__init__.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/tools/ann_loader.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/tools/audio_converter.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/tools/audio_loader.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/tools/audio_player.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/tools/base.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/tools/math_ops.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/tools/youtube_downloader.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/utils/.DS_Store +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/utils/__init__.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/utils/config.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/utils/excp.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/utils/logger.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/utils/np_func_cat.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/src/modusa/utils/plot.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/__init__.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/data/song1.mp3 +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/data/song1.wav +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_generators/audio_waveform.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_generators/test_audio.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_generators/test_ftds.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_generators/test_s1d.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_generators/test_s2d.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_generators/test_s_ax.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_generators/test_signal.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_generators/test_signal_generator.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_generators/test_t_ax.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_generators/test_tds.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_io/audio_player.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_io/plotter.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_models/test_data.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_models/test_t_ax.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_plugins/youtube_audio_loader.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/frequency_domain_signal.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/spectrogram.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/test_axis.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/test_feature_time_domain_signal.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/test_frequency_time_domain_signal.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/test_signal1D.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/test_signal2D.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/test_time_domain_signal.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/test_u_ax.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/test_window_signal.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_signals/time_domain_signal.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_tools/test_audio_converter.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_tools/test_fourier_tranform.py +0 -0
- {modusa-0.3.28 → modusa-0.3.29}/tests/test_tools/test_math_ops.py +0 -0
| @@ -85,6 +85,7 @@ def plot1d(*args, ann=None, events=None, xlim=None, ylim=None, xlabel=None, ylab | |
| 85 85 | 
             
            		for arg in args:
         | 
| 86 86 | 
             
            			if len(arg) not in [1, 2]: # 1 if it just provides values, 2 if it provided axis as well
         | 
| 87 87 | 
             
            				raise ValueError(f"1D signal needs to have max 2 arrays (y, x) or simply (y, )")
         | 
| 88 | 
            +
            			
         | 
| 88 89 | 
             
            		if isinstance(legend, str): legend = (legend, )
         | 
| 89 90 |  | 
| 90 91 | 
             
            		if legend is not None:
         | 
| @@ -111,10 +112,11 @@ def plot1d(*args, ann=None, events=None, xlim=None, ylim=None, xlabel=None, ylab | |
| 111 112 | 
             
            		for i, signal in enumerate(args):
         | 
| 112 113 | 
             
            			if len(signal) == 1:
         | 
| 113 114 | 
             
            				y = signal[0]
         | 
| 115 | 
            +
            				x = np.arange(y.size)
         | 
| 114 116 | 
             
            				if legend is not None:
         | 
| 115 | 
            -
            					signal_ax.plot(y, label=legend[i])
         | 
| 117 | 
            +
            					signal_ax.plot(x, y, label=legend[i])
         | 
| 116 118 | 
             
            				else:
         | 
| 117 | 
            -
            					signal_ax.plot(y)
         | 
| 119 | 
            +
            					signal_ax.plot(x, y)
         | 
| 118 120 | 
             
            			elif len(signal) == 2:
         | 
| 119 121 | 
             
            				y, x = signal[0], signal[1]
         | 
| 120 122 | 
             
            				if legend is not None:
         | 
| @@ -124,14 +126,19 @@ def plot1d(*args, ann=None, events=None, xlim=None, ylim=None, xlabel=None, ylab | |
| 124 126 |  | 
| 125 127 | 
             
            		# Add annotations
         | 
| 126 128 | 
             
            		if ann is not None:
         | 
| 127 | 
            -
            			annotation_ax.set_ylim(0, 1)
         | 
| 129 | 
            +
            			annotation_ax.set_ylim(0, 1) # For consistent layout
         | 
| 130 | 
            +
            			# Determine visible x-range
         | 
| 131 | 
            +
            			x_view_min = xlim[0] if xlim is not None else np.min(x)
         | 
| 132 | 
            +
            			x_view_max = xlim[1] if xlim is not None else np.max(x)
         | 
| 133 | 
            +
            			
         | 
| 128 134 | 
             
            			for i, (start, end, tag) in enumerate(ann):
         | 
| 129 | 
            -
            				 | 
| 130 | 
            -
             | 
| 131 | 
            -
             | 
| 132 | 
            -
             | 
| 133 | 
            -
             | 
| 134 | 
            -
             | 
| 135 | 
            +
            				# We make sure that we only plot annotation that are within the x range of the current view
         | 
| 136 | 
            +
            				if start >= x_view_max or end <= x_view_min:
         | 
| 137 | 
            +
            					continue
         | 
| 138 | 
            +
            				
         | 
| 139 | 
            +
            				# Clip boundaries to xlim
         | 
| 140 | 
            +
            				start = max(start, x_view_min)
         | 
| 141 | 
            +
            				end = min(end, x_view_max)
         | 
| 135 142 |  | 
| 136 143 | 
             
            				color = colors[i % len(colors)]
         | 
| 137 144 | 
             
            				width = end - start
         | 
| @@ -315,14 +322,19 @@ def plot2d(*args, ann=None, events=None, xlim=None, ylim=None, origin="lower", M | |
| 315 322 |  | 
| 316 323 | 
             
            	# Add annotations
         | 
| 317 324 | 
             
            	if ann is not None:
         | 
| 318 | 
            -
            		annotation_ax.set_ylim(0, 1)
         | 
| 325 | 
            +
            		annotation_ax.set_ylim(0, 1) # For consistent layout
         | 
| 326 | 
            +
            		# Determine visible x-range
         | 
| 327 | 
            +
            		x_view_min = xlim[0] if xlim is not None else np.min(x)
         | 
| 328 | 
            +
            		x_view_max = xlim[1] if xlim is not None else np.max(x)
         | 
| 329 | 
            +
            		
         | 
| 319 330 | 
             
            		for i, (start, end, tag) in enumerate(ann):
         | 
| 320 | 
            -
            			 | 
| 321 | 
            -
             | 
| 322 | 
            -
             | 
| 323 | 
            -
             | 
| 324 | 
            -
             | 
| 325 | 
            -
             | 
| 331 | 
            +
            			# We make sure that we only plot annotation that are within the x range of the current view
         | 
| 332 | 
            +
            			if start >= x_view_max or end <= x_view_min:
         | 
| 333 | 
            +
            				continue
         | 
| 334 | 
            +
            			
         | 
| 335 | 
            +
            			# Clip boundaries to xlim
         | 
| 336 | 
            +
            			start = max(start, x_view_min)
         | 
| 337 | 
            +
            			end = min(end, x_view_max)
         | 
| 326 338 |  | 
| 327 339 | 
             
            			color = colors[i % len(colors)]
         | 
| 328 340 | 
             
            			width = end - start
         | 
| @@ -479,36 +491,40 @@ def plot_dist(*args, ann=None, xlim=None, ylim=None, ylabel=None, xlabel=None, t | |
| 479 491 | 
             
            				kde = gaussian_kde(data)
         | 
| 480 492 |  | 
| 481 493 | 
             
            				# Create points to evaluate KDE
         | 
| 482 | 
            -
            				 | 
| 483 | 
            -
            				 | 
| 494 | 
            +
            				x = np.linspace(min(data), max(data), npoints)
         | 
| 495 | 
            +
            				y = kde(x)
         | 
| 484 496 |  | 
| 485 497 | 
             
            				if legend is not None:
         | 
| 486 | 
            -
            						dist_ax.plot( | 
| 498 | 
            +
            						dist_ax.plot(x, y, color=colors[i], label=legend[i])
         | 
| 487 499 | 
             
            						if show_hist is True:
         | 
| 488 500 | 
             
            								dist_ax.hist(data, bins=bins, density=True, alpha=0.3, facecolor=colors[i], edgecolor='black', label=legend[i])
         | 
| 489 501 | 
             
            				else:
         | 
| 490 | 
            -
            						dist_ax.plot( | 
| 502 | 
            +
            						dist_ax.plot(x, y, color=colors[i])
         | 
| 491 503 | 
             
            						if show_hist is True:
         | 
| 492 504 | 
             
            								dist_ax.hist(data, bins=bins, density=True, alpha=0.3, facecolor=colors[i], edgecolor='black')
         | 
| 493 505 |  | 
| 494 506 | 
             
            		# Add annotations
         | 
| 495 507 | 
             
            		if ann is not None:
         | 
| 496 | 
            -
             | 
| 497 | 
            -
             | 
| 498 | 
            -
             | 
| 499 | 
            -
             | 
| 500 | 
            -
             | 
| 501 | 
            -
             | 
| 502 | 
            -
             | 
| 503 | 
            -
             | 
| 504 | 
            -
             | 
| 505 | 
            -
             | 
| 506 | 
            -
             | 
| 507 | 
            -
             | 
| 508 | 
            -
            						annotation_ax.add_patch(rect)
         | 
| 508 | 
            +
            			annotation_ax.set_ylim(0, 1) # For consistent layout
         | 
| 509 | 
            +
            			# Determine visible x-range
         | 
| 510 | 
            +
            			x_view_min = xlim[0] if xlim is not None else np.min(x)
         | 
| 511 | 
            +
            			x_view_max = xlim[1] if xlim is not None else np.max(x)
         | 
| 512 | 
            +
            			for i, (start, end, tag) in enumerate(ann):
         | 
| 513 | 
            +
            				# We make sure that we only plot annotation that are within the x range of the current view
         | 
| 514 | 
            +
            				if start >= x_view_max or end <= x_view_min:
         | 
| 515 | 
            +
            					continue
         | 
| 516 | 
            +
            				
         | 
| 517 | 
            +
            				# Clip boundaries to xlim
         | 
| 518 | 
            +
            				start = max(start, x_view_min)
         | 
| 519 | 
            +
            				end = min(end, x_view_max)
         | 
| 509 520 |  | 
| 510 | 
            -
             | 
| 511 | 
            -
             | 
| 521 | 
            +
            				color = colors[i % len(colors)]
         | 
| 522 | 
            +
            				width = end - start
         | 
| 523 | 
            +
            				rect = Rectangle((start, 0), width, 1, color=color, alpha=0.7)
         | 
| 524 | 
            +
            				annotation_ax.add_patch(rect)
         | 
| 525 | 
            +
            			
         | 
| 526 | 
            +
            				text_obj = annotation_ax.text((start + end) / 2, 0.5, tag, ha='center', va='center', fontsize=10, color='white', fontweight='bold', zorder=10, clip_on=True)
         | 
| 527 | 
            +
            				text_obj.set_clip_path(rect)
         | 
| 512 528 |  | 
| 513 529 | 
             
            		# Add legend
         | 
| 514 530 | 
             
            		if legend 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.28 → modusa-0.3.29}/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
         |