Module futureexpert.checkin

Contains the models with the configuration for CHECK-IN.

Classes

class BaseConfig (**data: Any)
Expand source code
class BaseConfig(BaseModel):
    """Basic Configuaration for all models."""
    model_config = ConfigDict(extra='forbid')

Basic Configuaration for all 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.

self is explicitly positional-only to allow self as a field name.

Ancestors

  • pydantic.main.BaseModel

Subclasses

Class variables

var model_config
class CheckInResult (**data: Any)
Expand source code
class CheckInResult(BaseModel):
    """Result of the CHECK-IN.

    Parameters
    ----------
    time_series: builtins.list
        Time series values.
    version_id: builtins.str
        Id of the time series version. Used to identifiy the time series
    """
    time_series: list[TimeSeries]
    version_id: str

Result of the CHECK-IN.

Parameters

time_series : builtins.list
Time series values.
version_id : builtins.str
Id of the time series version. Used to identifiy 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.

self is explicitly positional-only to allow self as a field name.

Ancestors

  • pydantic.main.BaseModel

Class variables

var model_config
var time_series : list[TimeSeries]
var version_id : str
class Column (**data: Any)
Expand source code
class Column(BaseConfig):
    """Base model for the different column models
    (`DateColumn`, `ValueColumn` and `GroupColumn`).

    Parameters
    ----------
    name: builtins.str
        The original name of the column.
    name_new: typing.Optional
        The new name of the column.
    """
    name: str
    name_new: Optional[str] = None

Base model for the different column models (DateColumn, ValueColumn and GroupColumn).

Parameters

name : builtins.str
The original name of the column.
name_new : typing.Optional
The new name of the column.

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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var model_config
var name : str
var name_new : str | None
class DataDefinition (**data: Any)
Expand source code
class DataDefinition(BaseConfig):
    """Model for the input parameter needed for the first CHECK-IN step.

    Parameters
    ----------
    remove_rows: typing.Optional
        Indexes of the rows to be removed before validation. Note: If the raw data was committed as pandas data frame
        the header is the first row (row index 0).
    remove_columns: typing.Optional
        Indexes of the columns to be removed before validation.
    date_columns: futureexpert.checkin.DateColumn
        Definition of the date column.
    value_columns: builtins.list
        Definitions of the value columns.
    group_columns: builtins.list
        Definitions of the group columns.
    """
    remove_rows: Optional[list[int]] = []
    remove_columns: Optional[list[int]] = []
    date_columns: DateColumn
    value_columns: list[ValueColumn]
    group_columns: list[GroupColumn] = []

Model for the input parameter needed for the first CHECK-IN step.

Parameters

remove_rows : typing.Optional
Indexes of the rows to be removed before validation. Note: If the raw data was committed as pandas data frame the header is the first row (row index 0).
remove_columns : typing.Optional
Indexes of the columns to be removed before validation.
date_columns : DateColumn
Definition of the date column.
value_columns : builtins.list
Definitions of the value columns.
group_columns : builtins.list
Definitions of the group columns.

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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var date_columnsDateColumn
var group_columns : list[GroupColumn]
var model_config
var remove_columns : list[int] | None
var remove_rows : list[int] | None
var value_columns : list[ValueColumn]
class DateColumn (**data: Any)
Expand source code
class DateColumn(Column):
    """Model for the date columns.

    Parameters
    ----------
    format: builtins.str
        The format of the date.
    """
    format: str

Model for the date columns.

Parameters

format : builtins.str
The format of the date.

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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var format : str
var model_config
class FileSpecification (**data: Any)
Expand source code
class FileSpecification(BaseConfig):
    """Specify the format of the CSV file.

    Parameters
    ----------
    delimiter: typing.Optional
        The delimiter used to separate values.
    decimal: typing.Optional
        The decimal character used in decimal numbers.
    thousands: typing.Optional
        The thousands separator used in numbers.
    """
    delimiter: Optional[str] = ','
    decimal: Optional[str] = '.'
    thousands: Optional[str] = None

Specify the format of the CSV file.

Parameters

delimiter : typing.Optional
The delimiter used to separate values.
decimal : typing.Optional
The decimal character used in decimal numbers.
thousands : typing.Optional
The thousands separator used in numbers.

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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var decimal : str | None
var delimiter : str | None
var model_config
var thousands : str | None
class FilterSettings (**data: Any)
Expand source code
class FilterSettings(BaseConfig):
    """Model for the filters.

    Parameters
    ----------
    type: typing.Literal
        The type of filter: `exclusion` or `inclusion`.
    variable: builtins.str
        The columns name to be used for filtering.
    items: builtins.list
        The list of values to be used for filtering.
    """
    type: Literal['exclusion', 'inclusion']
    variable: str
    items: list[str]

Model for the filters.

Parameters

type : typing.Literal
The type of filter: exclusion or inclusion.
variable : builtins.str
The columns name to be used for filtering.
items : builtins.list
The list of values to be used for filtering.

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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var items : list[str]
var model_config
var type : Literal['exclusion', 'inclusion']
var variable : str
class GroupColumn (**data: Any)
Expand source code
class GroupColumn(Column):
    """Model for the group columns.

    Parameters
    ----------
    dtype_str: typing.Optional
        The data type of the column.
    """
    dtype_str: Optional[Literal['Character']] = None

Model for the group columns.

Parameters

dtype_str : typing.Optional
The data type of the column.

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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var dtype_str : Literal['Character'] | None
var model_config
class NewValue (**data: Any)
Expand source code
class NewValue(BaseConfig):
    """Model for the value data.

    Parameters
    ----------
    first_variable: builtins.str
        The first variable name.
    operator: typing.Literal
        The operator that will be used to do the math operation
        between the first and second variable.
    second_variable: builtins.str
        The second variable name.
    new_variable: builtins.str
        The new variable name.
    unit: typing.Optional
        The unit.
    """
    first_variable: str
    operator: Literal['x', '+', '-']
    second_variable: str
    new_variable: str
    unit: Optional[str] = None

Model for the value data.

Parameters

first_variable : builtins.str
The first variable name.
operator : typing.Literal
The operator that will be used to do the math operation between the first and second variable.
second_variable : builtins.str
The second variable name.
new_variable : builtins.str
The new variable name.
unit : typing.Optional
The unit.

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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var first_variable : str
var model_config
var new_variable : str
var operator : Literal['x', '+', '-']
var second_variable : str
var unit : str | None
class TsCreationConfig (**data: Any)
Expand source code
class TsCreationConfig(BaseConfig):
    """Model for the time series creation configuration.

    Parameters
    ----------
    time_granularity: typing.Literal
        Target granularity of the time series.
    start_date: typing.Optional
        Dates before this date are excluded.
    end_date: typing.Optional
        Dates after this date are excluded.
    grouping_level: builtins.list
        Names of group columns that should be used as the grouping level.
    filter: builtins.list
        Settings for including or excluding values during time series creation.
    new_variables: builtins.list
        New value column that is a combination of two other value columns.
    value_columns_to_save: builtins.list
        Value columns that should be saved.
    missing_value_handler: typing.Literal
        Strategy how to handle missing values during time series creation.
    """
    time_granularity: Literal['yearly', 'quarterly', 'monthly', 'weekly', 'daily', 'hourly', 'halfhourly']
    start_date: Optional[str] = None
    end_date: Optional[str] = None
    grouping_level: list[str] = []
    filter: list[FilterSettings] = []
    new_variables: list[NewValue] = []
    value_columns_to_save: list[str]
    missing_value_handler: Literal['keepNaN', 'setToZero'] = 'keepNaN'

Model for the time series creation configuration.

Parameters

time_granularity : typing.Literal
Target granularity of the time series.
start_date : typing.Optional
Dates before this date are excluded.
end_date : typing.Optional
Dates after this date are excluded.
grouping_level : builtins.list
Names of group columns that should be used as the grouping level.
filter : builtins.list
Settings for including or excluding values during time series creation.
new_variables : builtins.list
New value column that is a combination of two other value columns.
value_columns_to_save : builtins.list
Value columns that should be saved.
missing_value_handler : typing.Literal
Strategy how to handle missing values during time series creation.

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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var end_date : str | None
var filter : list[FilterSettings]
var grouping_level : list[str]
var missing_value_handler : Literal['keepNaN', 'setToZero']
var model_config
var new_variables : list[NewValue]
var start_date : str | None
var time_granularity : Literal['yearly', 'quarterly', 'monthly', 'weekly', 'daily', 'hourly', 'halfhourly']
var value_columns_to_save : list[str]
class ValueColumn (**data: Any)
Expand source code
class ValueColumn(Column):
    """Model for the value columns.

    Parameters
    ----------
    min: typing.Optional
        The set minimum value of the column.
    max: typing.Optional
        The set maximum value of the column.
    dtype_str: typing.Optional
        The data type of the column.
    unit: typing.Optional
        The unit of the column.
    """
    min: Optional[int] = None
    max: Optional[int] = None
    dtype_str: Optional[Literal['Numeric', 'Integer']] = None
    unit: Optional[str] = None

Model for the value columns.

Parameters

min : typing.Optional
The set minimum value of the column.
max : typing.Optional
The set maximum value of the column.
dtype_str : typing.Optional
The data type of the column.
unit : typing.Optional
The unit of the column.

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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var dtype_str : Literal['Numeric', 'Integer'] | None
var max : int | None
var min : int | None
var model_config
var unit : str | None