[FEAT] Refactor STFT preprocessing and training pipeline into importable modules #48
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
The current notebook containing STFT processing, train-test-split, and labeling functionality has grown complex and difficult to read. The code for data splitting and labeling is embedded within notebook cells, making it hard to maintain and reuse across different experiments. This approach limits code reusability and makes the notebook less readable for thesis documentation purposes.
Proposed Solution
Refactor the data splitting and labeling code from the notebook into properly structured Python modules that can be imported. This will:
Create dedicated Python modules in the src/ directory for:
Clean up the notebook to focus on experiment flow, visualization, and results rather than implementation details.
Implement proper documentation, typing, and error handling in the new modules.
Alternatives Considered
Component
Python Source Code
Priority
High (significantly improves workflow)
Implementation Ideas
Expected Benefits
Additional Context
This refactoring aligns with software engineering best practices and will make the thesis code more professional and maintainable. The modules should include appropriate error handling, type hints, and docstrings to ensure they're robust and well-documented.
Once implemented, the notebook workflow would change from:
To