src/ecg_visualization/: source package withdatasets/for PhysioNet loaders,scripts/for plotting CLI entry points, andutils/for helpers.physionet.org/files/: expected local mirror of raw ECG records as pulled bydataset.sh; keep directory names untouched so dataset classes resolve paths.result/: auto-created PDF outputs grouped by dataset id (e.g.,result/cudb/123.pdf); clean up stale runs if regenerating.- Supporting files:
pyproject.toml(uv/hatch config),uv.lock(resolved dependencies), anddataset.shfor bulk downloads.
- Install:
uv synccreates a Python 3.12 environment
- Follow PEP 8 with 4-space indentation, descriptive snake_case function and variable names, and PascalCase for dataclasses (e.g.,
ECG_Dataset). - Prefer explicit typing (
numpy.typing.NDArray, return annotations) and small, pure helpers inutils/. - Write main script in
src/ecg_visualization/scripts/study.pyand Write visualization script insrc/ecg_visualization/scripts/visualize.py- Use visualization logic instance
StudyVisualizerinvisualize.py - In
study.py, store any information to be used inStudyVisualizerto RDB by optuna orFileSystemArtifactStore - In
StudyVisualizer, load any information to be used in visualization from RDB by optuna orFileSystemArtifactStore
- Use visualization logic instance
- Use
unittestfor tests and place them undertests/. - Keep
tests/__init__.pyso discovery works consistently. - Preferred discovery command:
uv run python -m unittest discover -s tests - Don't run any tests. This project is just an individual's trial.
- Follow the existing Conventional Commit style (
feat:,fix:,chore:) as seen in recent history.