Module futureexpert.shared_models
Shared models used across multiple modules.
Classes
-
Expand source code
class BaseConfig(BaseModel): """Base configuration that is used for most models.""" model_config = ConfigDict(allow_inf_nan=False, extra='forbid', arbitrary_types_allowed=True)Base configuration that is used for most models.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Ancestors
- pydantic.main.BaseModel
Subclasses
- AssociatorConfig
- AssociatorResult
- ClusteringConfiguration
- ClusteringResult
- DataSelection
- Group
- GroupAssignment
- TrendDetectionConfiguration
- TrendLabel
- TrendResult
- ForecastingConfig
- MethodSelectionConfig
- PreprocessingConfig
- ReportConfig
- WorkingDayAdaptionsConfig
- MakeForecastConsistentConfiguration
- MakeForecastConsistentDataSelection
- ReconciliationConfig
- MatcherConfig
Class variables
-
Expand source code
class Covariate(BaseModel): """Covariate. Parameters ---------- ts: futureexpert.shared_models.TimeSeries Time series object of the covariate. Not lagged. lag: builtins.int Lag by which the covariate was used. """ ts: TimeSeries lag: intCovariate.
Parameters
ts:TimeSeries- Time series object of the covariate. Not lagged.
lag:builtins.int- Lag by which the covariate was used.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Ancestors
- pydantic.main.BaseModel
Class variables
-
Expand source code
class CovariateRef(BaseModel): """Covariate reference. Parameters ---------- name: builtins.str Name of the Covariate lag: builtins.int Lag by which the covariate was used. """ name: str lag: intCovariate reference.
Parameters
name:builtins.str- Name of the Covariate
lag:builtins.int- Lag by which the covariate was used.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Ancestors
- pydantic.main.BaseModel
Class variables
-
Expand source code
class PositiveInt(int): def __new__(cls, value: int) -> PositiveInt: if value < 1: raise ValueError('The value must be a positive integer.') return super().__new__(cls, value)int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating-point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
>>> int('0b100', base=0) 4Ancestors
- builtins.int
-
Expand source code
class TimeSeries(BaseModel): """Time series data. Parameters ---------- name: builtins.str Name of the time series. group: builtins.str Group of the time series. granularity: builtins.str Granularity of the time series. values: typing.Sequence[futureexpert.shared_models.TimeSeriesValue] The actual values of the time series. unit: typing.Optional[builtins.str] The unit of the time . unit_factors: typing.Optional[builtins.dict[builtins.str, builtins.float]] Factors to convert the time series in another unit. grouping: typing.Optional[builtins.dict[builtins.str, typing.Union[builtins.str, builtins.int]]] Hierarchy levels ot the time series. """ name: Annotated[str, Field(min_length=1)] group: str granularity: Annotated[str, Field(min_length=1)] values: Annotated[Sequence[TimeSeriesValue], Field(min_length=1)] unit: Optional[str] = None unit_factors: Optional[dict[str, float]] = None grouping: Optional[dict[str, Union[str, int]]] = NoneTime series data.
Parameters
name:builtins.str- Name of the time series.
group:builtins.str- Group of the time series.
granularity:builtins.str- Granularity of the time series.
values:typing.Sequence[TimeSeriesValue]- The actual values of the time series.
unit:typing.Optional[builtins.str]- The unit of the time .
unit_factors:typing.Optional[builtins.dict[builtins.str, builtins.float]]- Factors to convert the time series in another unit.
grouping:typing.Optional[builtins.dict[builtins.str, typing.Union[builtins.str, builtins.int]]]- Hierarchy levels ot the time series.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Ancestors
- pydantic.main.BaseModel
Class variables
-
Expand source code
class TimeSeriesValue(BaseModel): """Value of a time series. Parameters ---------- time_stamp_utc: datetime.datetime The time stamp of the value. value: builtins.float The value. """ time_stamp_utc: datetime value: Annotated[float, Field(allow_inf_nan=False)]Value of a time series.
Parameters
time_stamp_utc:datetime.datetime- The time stamp of the value.
value:builtins.float- The value.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Ancestors
- pydantic.main.BaseModel
Class variables