oceanpack.app.models.filesource¶
File source model and source type enumeration for managing OceanPack log file ingestion.
Classes¶
Orchestrates reading, cleaning, and processing of OceanPack log files. |
Functions¶
|
Collect files from a given path. |
Module Contents¶
- class oceanpack.app.models.filesource.FileSourceModel(source_type: FileSourceType = None)[source]¶
Orchestrates reading, cleaning, and processing of OceanPack log files.
Resolves the appropriate file handler for the configured source type, reads all log files into a pandas DataFrame, and exposes the result as an xarray Dataset. The source type can be set explicitly or inferred automatically from the file header.
Initialize the model, optionally setting the source type and resolving the file handler.
- Parameters:
source_type (FileSourceType)
- clean_data()[source]¶
Drops rows with a missing index value and removes duplicate timestamps, keeping the first occurrence.
- load_data(path: str)[source]¶
Collect all log files at the given path and read them into a single DataFrame.
- Parameters:
path (str)
- process_data()[source]¶
Casts all columns to numeric, drops any that cannot be converted, sorts by index, and builds the xarray Dataset.
- df = None¶
- ds = None¶
- history = ''¶
- oceanpack.app.models.filesource.collect_files(path: str, suffix='log') list[pathlib.Path][source]¶
Collect files from a given path.