openstef package

Subpackages

Submodules

openstef.app_settings module

class openstef.app_settings.AppSettings(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_implicit_flags=None, _secrets_dir=None, **values)

Bases: BaseSettings

Global app settings.

log_level: str
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_hide_none_type': False, 'cli_implicit_flags': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_settings_source': None, 'cli_use_class_docs_for_groups': False, 'env_file': '.env', 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': 'openstef_', 'extra': 'ignore', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_file': None, 'yaml_file_encoding': None}

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

model_fields: ClassVar[Dict[str, FieldInfo]] = {'log_level': FieldInfo(annotation=str, required=False, default='INFO', description='Log level used for logging statements.'), 'post_teams_messages': FieldInfo(annotation=bool, required=False, default=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

post_teams_messages: bool

openstef.enums module

class openstef.enums.ForecastType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

BASECASE = 'basecase'
DEMAND = 'demand'
SOLAR = 'solar'
WIND = 'wind'
class openstef.enums.ModelType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

ARIMA = 'arima'
FLATLINER = 'flatliner'
LGB = 'lgb'
LINEAR = 'linear'
LINEAR_QUANTILE = 'linear_quantile'
XGB = 'xgb'
XGB_MULTIOUTPUT_QUANTILE = 'xgb_multioutput_quantile'
XGB_QUANTILE = 'xgb_quantile'
class openstef.enums.PipelineType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

FORECAST = 'forecast'
HYPER_PARMATERS = 'hyper_parameters'
TRAIN = 'train'

openstef.exceptions module

Openstef custom exceptions.

exception openstef.exceptions.ComponentForecastTooShortHorizonError

Bases: Exception

Component forecasts should be available for at least 30 hours in advance.

exception openstef.exceptions.InputDataInsufficientError

Bases: InputDataInvalidError

Insufficient input data.

exception openstef.exceptions.InputDataInvalidError

Bases: Exception

Invalid input data.

exception openstef.exceptions.InputDataOngoingZeroFlatlinerError

Bases: InputDataInvalidError

All recent load measurements are zero.

exception openstef.exceptions.InputDataWrongColumnOrderError

Bases: InputDataInvalidError

Wrong column order input data.

exception openstef.exceptions.ModelWithoutStDev

Bases: Exception

A machine learning model should have a valid standard deviation.

exception openstef.exceptions.NoPredictedLoadError(pid, message='No predicted load found')

Bases: Exception

No predicted load for given datatime range.

exception openstef.exceptions.NoRealisedLoadError(pid, message='No realised load found')

Bases: Exception

No realised load for given datetime range.

exception openstef.exceptions.OldModelHigherScoreError

Bases: Exception

Old model has a higher score then new model.

exception openstef.exceptions.PredictionJobException(metrics=None)

Bases: Exception

One or more prediction jobs raised an exception.

exception openstef.exceptions.SkipSaveTrainingForecasts

Bases: Exception

If old model is better or too young, you don’t need to save the traing forcast.

openstef.settings module

Module contents