wristpy.io.writers.writers

Module containing the output classes for writing data to files.

Classes

Any(*args, **kwargs)

Special type indicating an unconstrained type.

OrchestratorResults(*, ...[, processing_params])

Dataclass containing results of orchestrator.run().

class wristpy.io.writers.writers.OrchestratorResults(*, physical_activity_metric: Sequence[Measurement], anglez: Measurement, physical_activity_levels: Sequence[Measurement], nonwear_status: Measurement, sleep_status: Measurement, sib_periods: Measurement, spt_periods: Measurement, processing_params: Dict[str, Any] | None = None)[source]

Bases: BaseModel

Dataclass containing results of orchestrator.run().

anglez: Measurement
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nonwear_status: Measurement
physical_activity_levels: Sequence[Measurement]
physical_activity_metric: Sequence[Measurement]
processing_params: Dict[str, Any] | None
save_config_as_json(output_path: Path) None[source]

Save processing parameters as a JSON configuration file.

Parameters:

output_path – Path where the data file was saved. The JSON file will use the same name but with .json extension.

save_results(output: Path) None[source]

Convert to polars and save the dataframe as a csv or parquet file.

Parameters:

output – The path and file name of the data to be saved. as either a csv or parquet files.

sib_periods: Measurement
sleep_status: Measurement
spt_periods: Measurement
classmethod validate_output(output: Path) None[source]

Validates that the output path exists and is a valid format.

Parameters:

output – the name of the file to be saved, and the directory it will be saved in. Must be a .csv or .parquet file.

Raises:

InvalidFileTypeError – If the output file path ends with any extension other than csv or parquet.