flexmeasures.data.schemas.annotations

Classes

class flexmeasures.data.schemas.annotations.AnnotationSchema(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: Literal['exclude', 'include', 'raise'] | None = None)

Schema for annotation POST requests.

fields: dict[str, Field]

Dictionary mapping field_names -> Field objects

to_annotation(data: dict, *args, **kwargs) Annotation

Load annotation data into a user-sourced annotation object.

validate_time_range(data, **kwargs)

Validate that end is after start.