Skip to content

Bumped up version to 0.3.0 Reducing cognitive complexity#9

Open
TestmanX wants to merge 3 commits into
PGomes92:masterfrom
TestmanX:master
Open

Bumped up version to 0.3.0 Reducing cognitive complexity#9
TestmanX wants to merge 3 commits into
PGomes92:masterfrom
TestmanX:master

Conversation

@TestmanX

Copy link
Copy Markdown

Summary of Changes:

Transfer Functions signal resolution fix, check for 6bit or 10bit, raise error otherwise

plot() method refactoring
Extracted _normalize_sensors() - handles sensor input normalization
Extracted _plot_multiple_signals() - handles multi-signal plotting
Extracted _plot_single_signal() - handles single signal plotting
Extracted _plot_signal() - core plotting logic for single axis
Reduced cognitive complexity from ~170 lines with deep nesting to focused helper methods (20-40 lines each)

init() method refactoring
Extracted _init_member_variables() - initializes all member variables
Created load_file() - separates file loading from initialization
Removes coupling between init and plotting side effects
Enables cleaner testing and reusability

Combined signal() and raw() methods.

Created _get_signal_data() helper method (lines 294-340):

Unified implementation for both signal() and raw()
Takes use_raw parameter to select between raw/converted signals
Reduced code duplication by ~60%
Simplified validation logic
Refactored public methods:

signal() - now just calls _get_signal_data(sensors, use_raw=False)
raw() - now just calls _get_signal_data(sensors, use_raw=True)

Clearer variable names (num_sensors, col_idx, res_idx, etc.)
Better separation of concerns

TestmanX added 3 commits April 3, 2026 13:02
Fix for transfer function's relative import.
Fix for Bitalino_rev comparison.
Switched to f strings formatting
Summary of Changes:

Transfer Functions signal resolution fix, check for 6bit or 10bit, raise error otherwise

plot() method refactoring
Extracted _normalize_sensors() - handles sensor input normalization
Extracted _plot_multiple_signals() - handles multi-signal plotting
Extracted _plot_single_signal() - handles single signal plotting
Extracted _plot_signal() - core plotting logic for single axis
Reduced cognitive complexity from ~170 lines with deep nesting to focused helper methods (20-40 lines each)

__init__() method refactoring
Extracted _init_member_variables() - initializes all member variables
Created load_file() - separates file loading from initialization
Removes coupling between init and plotting side effects
Enables cleaner testing and reusability

Combined signal() and raw() methods.

Created _get_signal_data() helper method (lines 294-340):

Unified implementation for both signal() and raw()
Takes use_raw parameter to select between raw/converted signals
Reduced code duplication by ~60%
Simplified validation logic
Refactored public methods:

signal() - now just calls _get_signal_data(sensors, use_raw=False)
raw() - now just calls _get_signal_data(sensors, use_raw=True)

Clearer variable names (num_sensors, col_idx, res_idx, etc.)
Better separation of concerns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant