Skip to content

feat: Protocol for DataLoader Added#82

Open
AndreyIsakov01 wants to merge 1 commit intoprototypefrom
aisakov/dataset-loader
Open

feat: Protocol for DataLoader Added#82
AndreyIsakov01 wants to merge 1 commit intoprototypefrom
aisakov/dataset-loader

Conversation

@AndreyIsakov01
Copy link
Copy Markdown
Collaborator

feat: Add DatasetLoader protocol and RealDatasetLoader implementation

Summary

  • Introduce a DatasetLoader protocol that defines the load(path, timeseries_preprocessor) interface for loading datasets from disk.
  • Add RealDatasetLoader as a concrete implementation that discovers timeseries*.csv files, builds segment info from the SEGMENT_COLUMN, and constructs PandasLabeledDataProvider instances with proper annotations.
  • Simplify Dataset by removing timeseries_preprocessor storage and the stub load_from_dir method -- loading responsibility is now delegated to DatasetLoader.

Changes

  • pysatl_cpd/core/data_providers/dataset.py

    • Added DatasetLoader protocol with a load method signature.
    • Added RealDatasetLoader with three methods: prepare_segment_info (derives segment boundaries from SEGMENT_COLUMN), prepare_annotation (creates Annotation from file path), and load (orchestrates CSV discovery, preprocessing, and provider construction).
    • Simplified Dataset.__init__ -- removed timeseries_preprocessor parameter, removed load_from_dir stub, removed _identity helper.
    • Renamed SEGMENT_COLUMN value from "segments" to "segment" for consistency with SEGMENT_ID_COLUMN.
    • Replaced name-mangled __ attributes with conventional _ private attributes throughout PandasLabeledDataProvider and Dataset.
  • pysatl_cpd/core/data_providers/__init__.py

    • Exported RealDatasetLoader from the module.

@AndreyIsakov01 AndreyIsakov01 requested a review from Desiment April 16, 2026 21:43
@AndreyIsakov01 AndreyIsakov01 self-assigned this Apr 16, 2026
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