flexmeasures.data.schemas.reporting.pandas_reporter

Classes

class flexmeasures.data.schemas.reporting.pandas_reporter.PandasReporterConfigSchema(*, 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)

This schema lists fields that can be used to describe sensors in the optimised portfolio

Example:

{
“required_input”[

{“name” : “df1”, “unit” : “MWh”}

], “required_output” : [

{“name” : “df2”, “unit” : “kWh”}

], “transformations” : [

{

“df_input” : “df1”, “df_output” : “df2”, “method” : “copy”

}, {

“df_input” : “df2”, “df_output” : “df2”, “method” : “sum”

}, {

“method” : “sum”, “kwargs” : {“axis” : 0}

}

],

}

fields: dict[str, Field]

Dictionary mapping field_names -> Field objects

validate_chaining(data, **kwargs)

This validator ensures that we are always given an input and that the final_df_output is computed.

class flexmeasures.data.schemas.reporting.pandas_reporter.PandasReporterParametersSchema(*, 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)
fields: dict[str, Field]

Dictionary mapping field_names -> Field objects

validate_time_parameters(data, **kwargs)

This method validates that all input sensors have start and end parameters available.

class flexmeasures.data.schemas.reporting.pandas_reporter.Transformation(*, 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)
fields: dict[str, Field]

Dictionary mapping field_names -> Field objects

validate_method_call(data, **kwargs)

Validates the method name and its arguments against a set of base classes.

This validation ensures that the provided method exists in one of the specified base classes (BeliefsSeries, BeliefsDataFrame, Resampler, Grouper) and that the provided arguments (args and kwargs) are valid for the method’s signature.

Args:
data (dict): A dictionary containing the method name (method) and optionally

the method arguments (args as a list and kwargs as a dictionary).

**kwargs: Additional keyword arguments passed by the validation framework.

Raises:
ValidationError: If the method is not callable in any of the base classes or

if the provided arguments do not match the method signature.

validate_method_or_property(data, **kwargs)

Exactly one of ‘method’ or ‘property’ must be provided. Additionally, ‘args’/’kwargs’ are only allowed when ‘method’ is provided.