openstef 3.4.56__py3-none-any.whl → 4.0.0a3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. openstef-4.0.0a3.dist-info/METADATA +177 -0
  2. openstef-4.0.0a3.dist-info/RECORD +4 -0
  3. {openstef-3.4.56.dist-info → openstef-4.0.0a3.dist-info}/WHEEL +1 -2
  4. openstef/__init__.py +0 -14
  5. openstef/__main__.py +0 -3
  6. openstef/app_settings.py +0 -19
  7. openstef/data/NL_terrestrial_radiation.csv +0 -25585
  8. openstef/data/NL_terrestrial_radiation.csv.license +0 -3
  9. openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z +0 -0
  10. openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z.license +0 -3
  11. openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_model_card.md +0 -18
  12. openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_model_card.md.license +0 -3
  13. openstef/data/dutch_holidays.csv +0 -1759
  14. openstef/data/dutch_holidays.csv.license +0 -3
  15. openstef/data/pv_single_coefs.csv +0 -601
  16. openstef/data/pv_single_coefs.csv.license +0 -3
  17. openstef/data_classes/__init__.py +0 -3
  18. openstef/data_classes/data_prep.py +0 -99
  19. openstef/data_classes/model_specifications.py +0 -30
  20. openstef/data_classes/prediction_job.py +0 -135
  21. openstef/data_classes/split_function.py +0 -97
  22. openstef/enums.py +0 -140
  23. openstef/exceptions.py +0 -74
  24. openstef/feature_engineering/__init__.py +0 -3
  25. openstef/feature_engineering/apply_features.py +0 -138
  26. openstef/feature_engineering/bidding_zone_to_country_mapping.py +0 -106
  27. openstef/feature_engineering/cyclic_features.py +0 -161
  28. openstef/feature_engineering/data_preparation.py +0 -152
  29. openstef/feature_engineering/feature_adder.py +0 -206
  30. openstef/feature_engineering/feature_applicator.py +0 -202
  31. openstef/feature_engineering/general.py +0 -141
  32. openstef/feature_engineering/holiday_features.py +0 -231
  33. openstef/feature_engineering/lag_features.py +0 -165
  34. openstef/feature_engineering/missing_values_transformer.py +0 -141
  35. openstef/feature_engineering/rolling_features.py +0 -58
  36. openstef/feature_engineering/weather_features.py +0 -492
  37. openstef/metrics/__init__.py +0 -3
  38. openstef/metrics/figure.py +0 -303
  39. openstef/metrics/metrics.py +0 -486
  40. openstef/metrics/reporter.py +0 -222
  41. openstef/model/__init__.py +0 -3
  42. openstef/model/basecase.py +0 -82
  43. openstef/model/confidence_interval_applicator.py +0 -242
  44. openstef/model/fallback.py +0 -77
  45. openstef/model/metamodels/__init__.py +0 -3
  46. openstef/model/metamodels/feature_clipper.py +0 -90
  47. openstef/model/metamodels/grouped_regressor.py +0 -222
  48. openstef/model/metamodels/missing_values_handler.py +0 -138
  49. openstef/model/model_creator.py +0 -214
  50. openstef/model/objective.py +0 -426
  51. openstef/model/objective_creator.py +0 -65
  52. openstef/model/regressors/__init__.py +0 -3
  53. openstef/model/regressors/arima.py +0 -197
  54. openstef/model/regressors/custom_regressor.py +0 -64
  55. openstef/model/regressors/dazls.py +0 -116
  56. openstef/model/regressors/flatliner.py +0 -95
  57. openstef/model/regressors/gblinear_quantile.py +0 -334
  58. openstef/model/regressors/lgbm.py +0 -29
  59. openstef/model/regressors/linear.py +0 -90
  60. openstef/model/regressors/linear_quantile.py +0 -305
  61. openstef/model/regressors/regressor.py +0 -114
  62. openstef/model/regressors/xgb.py +0 -52
  63. openstef/model/regressors/xgb_multioutput_quantile.py +0 -261
  64. openstef/model/regressors/xgb_quantile.py +0 -228
  65. openstef/model/serializer.py +0 -431
  66. openstef/model/standard_deviation_generator.py +0 -81
  67. openstef/model_selection/__init__.py +0 -3
  68. openstef/model_selection/model_selection.py +0 -311
  69. openstef/monitoring/__init__.py +0 -3
  70. openstef/monitoring/performance_meter.py +0 -92
  71. openstef/monitoring/teams.py +0 -203
  72. openstef/pipeline/__init__.py +0 -3
  73. openstef/pipeline/create_basecase_forecast.py +0 -133
  74. openstef/pipeline/create_component_forecast.py +0 -168
  75. openstef/pipeline/create_forecast.py +0 -171
  76. openstef/pipeline/optimize_hyperparameters.py +0 -317
  77. openstef/pipeline/train_create_forecast_backtest.py +0 -163
  78. openstef/pipeline/train_model.py +0 -561
  79. openstef/pipeline/utils.py +0 -52
  80. openstef/postprocessing/__init__.py +0 -3
  81. openstef/postprocessing/postprocessing.py +0 -275
  82. openstef/preprocessing/__init__.py +0 -3
  83. openstef/preprocessing/preprocessing.py +0 -42
  84. openstef/settings.py +0 -15
  85. openstef/tasks/__init__.py +0 -3
  86. openstef/tasks/calculate_kpi.py +0 -324
  87. openstef/tasks/create_basecase_forecast.py +0 -118
  88. openstef/tasks/create_components_forecast.py +0 -162
  89. openstef/tasks/create_forecast.py +0 -145
  90. openstef/tasks/create_solar_forecast.py +0 -420
  91. openstef/tasks/create_wind_forecast.py +0 -80
  92. openstef/tasks/optimize_hyperparameters.py +0 -135
  93. openstef/tasks/split_forecast.py +0 -273
  94. openstef/tasks/train_model.py +0 -224
  95. openstef/tasks/utils/__init__.py +0 -3
  96. openstef/tasks/utils/dependencies.py +0 -107
  97. openstef/tasks/utils/predictionjobloop.py +0 -243
  98. openstef/tasks/utils/taskcontext.py +0 -160
  99. openstef/validation/__init__.py +0 -3
  100. openstef/validation/validation.py +0 -322
  101. openstef-3.4.56.dist-info/METADATA +0 -154
  102. openstef-3.4.56.dist-info/RECORD +0 -102
  103. openstef-3.4.56.dist-info/top_level.txt +0 -1
  104. /openstef-3.4.56.dist-info/LICENSE → /openstef-4.0.0a3.dist-info/licenses/LICENSE.md +0 -0
@@ -1,99 +0,0 @@
1
- # SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
2
- #
3
- # SPDX-License-Identifier: MPL-2.0
4
- """Specifies the split function dataclass."""
5
- import inspect
6
- import json
7
- from importlib import import_module
8
- from typing import Any, Sequence, TypeVar, Union
9
-
10
- from pydantic.v1 import BaseModel
11
-
12
- DataPrepClass = TypeVar("DataPrepClass")
13
-
14
-
15
- class DataPrepDataClass(BaseModel):
16
- """Class that allows to specify a custom class to prepare the data (feature engineering , etc ...)."""
17
-
18
- klass: Union[str, type[DataPrepClass]]
19
- arguments: Union[
20
- str, dict[str, Any]
21
- ] # JSON string holding the function parameters or dict
22
-
23
- def __getitem__(self, key: str):
24
- """Allows us to use subscription to get the items from the object."""
25
- return getattr(self, key)
26
-
27
- def __setitem__(self, key: str, value: any):
28
- """Allows us to use subscription to set the items in the object."""
29
- if hasattr(self, key):
30
- self.__dict__[key] = value
31
- else:
32
- raise AttributeError(f"{key} not an attribute of prediction job.")
33
-
34
- def _load_klass(
35
- self, required_arguments: Sequence[str] = None
36
- ) -> type[DataPrepClass]:
37
- """Load data prep class from path.
38
-
39
- Args:
40
- klass_path (str): The path to the data prep class
41
-
42
- Returns:
43
- klass (type[AbstractDataPreparation]): The loaded data prep class
44
-
45
- """
46
- if isinstance(self.klass, str):
47
- path_elements = self.klass.split(".")
48
- module_path = ".".join(path_elements[:-1])
49
- module = import_module(module_path)
50
- klass_name = path_elements[-1]
51
- klass = getattr(module, klass_name)
52
- else:
53
- klass = self.klass
54
-
55
- # Check that the klass accepts mandatory arguments
56
- if not inspect.isclass(klass):
57
- raise ValueError("The loaded object is not a class: {klass!r}")
58
-
59
- if required_arguments is not None:
60
- klass_params = set(inspect.signature(klass).parameters)
61
-
62
- if len(set(required_arguments) - klass_params) > 0:
63
- raise ValueError(
64
- "The loaded data prep class does not have the required arguments"
65
- )
66
-
67
- return klass
68
-
69
- def _load_arguments(self) -> dict[str, Any]:
70
- """Load the arguments.
71
-
72
- Convert the arguments from JSON if they are given as strings or simply return them otherwise.
73
-
74
- Returns:
75
- arguments (dict[str, Any]): The additional arguments to be passed to the class
76
-
77
- """
78
- if isinstance(self.arguments, str):
79
- return json.loads(self.arguments)
80
- else:
81
- return self.arguments
82
-
83
- def load(
84
- self, required_arguments: Sequence[str] = None
85
- ) -> tuple[type[DataPrepClass], dict[str, Any]]:
86
- """Load the function and its arguments.
87
-
88
- If the function and the arguments are given as strings in the instane attributes, load them as Python objects
89
- otherwise just return them from the instance attributes.
90
-
91
- Args:
92
- required_arguments (list[str]): list of arguments the loaded class must have
93
-
94
- Returns:
95
- - class (type[AbstractDataPreparation])
96
- - arguments (dict[str, Any])
97
-
98
- """
99
- return self._load_klass(required_arguments), self._load_arguments()
@@ -1,30 +0,0 @@
1
- # SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
- #
3
- # SPDX-License-Identifier: MPL-2.0
4
- """Specifies the dataclass for model specifications."""
5
- from typing import Optional, Union
6
-
7
- from pydantic.v1 import BaseModel
8
-
9
-
10
- class ModelSpecificationDataClass(BaseModel):
11
- """Holds all information regarding the training procces of a specific model."""
12
-
13
- id: Union[int, str]
14
- hyper_params: Optional[dict] = {}
15
- """Hyperparameters that should be used during training."""
16
- feature_names: Optional[list] = None
17
- """Features that should be used during training."""
18
- feature_modules: Optional[list] = []
19
- """Feature modules that should be used during training."""
20
-
21
- def __getitem__(self, item: str) -> any:
22
- """Allows us to use subscription to get the items from the object."""
23
- return getattr(self, item)
24
-
25
- def __setitem__(self, key: str, value: any) -> None:
26
- """Allows us to use subscription to set the items in the object."""
27
- if hasattr(self, key):
28
- self.__dict__[key] = value
29
- else:
30
- raise AttributeError(f"{key} not an attribute of model specifications.")
@@ -1,135 +0,0 @@
1
- # SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
2
- #
3
- # SPDX-License-Identifier: MPL-2.0
4
- """Specifies the prediction job dataclass."""
5
- from typing import Optional, Union
6
-
7
- from pydantic.v1 import BaseModel
8
-
9
- from openstef.data_classes.data_prep import DataPrepDataClass
10
- from openstef.data_classes.model_specifications import ModelSpecificationDataClass
11
- from openstef.data_classes.split_function import SplitFuncDataClass
12
- from openstef.enums import PipelineType, BiddingZone, AggregateFunction
13
-
14
-
15
- class PredictionJobDataClass(BaseModel):
16
- """Holds all information about the specific forecast that has to be made."""
17
-
18
- id: Union[int, str]
19
- """The predictions job id (often abreviated as pid)."""
20
- model: str
21
- """The model type that should be used.
22
-
23
- Options are:
24
- - ``"xgb"``
25
- - ``"xgb_quantile"``
26
- - ``"lgb"``
27
- - ``"linear"``
28
- - ``"linear_quantile"``
29
- - ``"gblinear_quantile"``
30
- - ``"xgb_multioutput_quantile"``
31
- - ``"flatliner"``
32
-
33
- If unsure what to pick, choose ``"xgb"``.
34
-
35
- """
36
- model_kwargs: Optional[dict]
37
- """The model parameters that should be used."""
38
- forecast_type: str
39
- """The type of forecasts that should be made.
40
-
41
- Options are:
42
- - ``"demand"``
43
- - ``"wind"``
44
- - ``"basecase"``
45
-
46
- If unsure what to pick, choose ``"demand"``.
47
-
48
- """
49
- horizon_minutes: Optional[int] = 2880
50
- """The horizon of the desired forecast in minutes used in tasks. Defaults to 2880 minutes (i.e. 2 days)."""
51
- resolution_minutes: int
52
- """The resolution of the desired forecast in minutes."""
53
- lat: Optional[float] = 52.132633
54
- """Latitude of the forecasted location in degrees. Used for fetching weather data in tasks, calculating derrived features and component splitting."""
55
- lon: Optional[float] = 5.291266
56
- """Longitude of the forecasted location in degrees. Used for fetching weather data in tasks, calculating derrived features and component splitting."""
57
- name: str
58
- """Bidding zone is used to determine the electricity price. It is also used to determine the holidays that should be used. Currently only ENTSO-E bidding zones are supported."""
59
- electricity_bidding_zone: Optional[BiddingZone] = BiddingZone.NL
60
- """Name of the forecast, e.g. the location name."""
61
- train_components: Optional[bool]
62
- """Whether splitting the forecasts in wind, solar, rest is desired."""
63
- description: Optional[str]
64
- """Optional description of the prediction job for human reference."""
65
- quantiles: Optional[list[float]]
66
- """Quantiles that have to be forecasted."""
67
- train_split_func: Optional[SplitFuncDataClass]
68
- """Optional custom splitting function for operational procces."""
69
- backtest_split_func: Optional[SplitFuncDataClass]
70
- """Optional custom splitting function for backtesting."""
71
- train_horizons_minutes: Optional[list[int]]
72
- """List of horizons that should be taken into account during training."""
73
- default_modelspecs: Optional[ModelSpecificationDataClass]
74
- """Default model specifications"""
75
- save_train_forecasts: bool = False
76
- """Indicate wether the forecasts produced during the training process should be saved."""
77
- completeness_threshold: float = 0.5
78
- """Minimum fraction of data that should be available for making a regular forecast."""
79
- minimal_table_length: int = 100
80
- """Minimum length (in rows) of the forecast input for making a regular forecast."""
81
- flatliner_threshold_minutes: int = 1440
82
- """Number of minutes that the load has to be constant to detect a flatliner. """
83
- data_balancing_ratio: Optional[float] = None
84
- """If data balancing is enabled, the data will be balanced with data from 1 year
85
- ago in the future."""
86
- rolling_aggregate_features: Optional[list[AggregateFunction]] = None
87
- """If not None, rolling aggregate(s) of load will be used as features in the model."""
88
- depends_on: Optional[list[Union[int, str]]]
89
- """Link to another prediction job on which this prediction job might depend."""
90
- sid: Optional[str]
91
- """Only required for create_solar_forecast task"""
92
- turbine_type: Optional[str]
93
- """Only required for create_wind_forecast task"""
94
- n_turbines: Optional[float]
95
- """Only required for create_wind_forecast task"""
96
- hub_height: Optional[float]
97
- """Only required for create_wind_forecast task"""
98
- pipelines_to_run: list[PipelineType] = [
99
- PipelineType.TRAIN,
100
- PipelineType.HYPER_PARMATERS,
101
- PipelineType.FORECAST,
102
- ]
103
- """The pipelines to run for this pj"""
104
- alternative_forecast_model_pid: Optional[Union[int, str]]
105
- """The pid that references another prediction job from which the model should be used for making forecasts."""
106
- data_prep_class: Optional[DataPrepDataClass]
107
- """The import string for the custom data prep class"""
108
-
109
- class Config:
110
- """Pydantic model configuration.
111
-
112
- This following configuration is needed to prevent ids in "depends_on" to be converted from int to str when we
113
- use integer ids.
114
-
115
- """
116
-
117
- smart_union = True
118
-
119
- def __getitem__(self, item: str) -> any:
120
- """Allows us to use subscription to get the items from the object."""
121
- return getattr(self, item)
122
-
123
- def __setitem__(self, key: str, value: any) -> None:
124
- """Allows us to use subscription to set the items in the object."""
125
- if hasattr(self, key):
126
- self.__dict__[key] = value
127
- else:
128
- raise AttributeError(f"{key} not an attribute of prediction job.")
129
-
130
- def get(self, key: str, default: any = None) -> any:
131
- """Allows to use the get functions similar to a python dict."""
132
- if hasattr(self, key):
133
- return getattr(self, key)
134
- else:
135
- return default
@@ -1,97 +0,0 @@
1
- # SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
2
- #
3
- # SPDX-License-Identifier: MPL-2.0
4
- """Specifies the split function dataclass."""
5
- import inspect
6
- import json
7
- from importlib import import_module
8
- from typing import Any, Callable, Sequence, Union
9
-
10
- from pydantic.v1 import BaseModel
11
-
12
-
13
- class SplitFuncDataClass(BaseModel):
14
- """Class that allows to specify a custom function to generate a train, test and validation set."""
15
-
16
- function: Union[str, Callable]
17
- arguments: Union[
18
- str, dict[str, Any]
19
- ] # JSON string holding the function parameters or dict
20
-
21
- def __getitem__(self, key: str):
22
- """Allows us to use subscription to get the items from the object."""
23
- return getattr(self, key)
24
-
25
- def __setitem__(self, key: str, value: any):
26
- """Allows us to use subscription to set the items in the object."""
27
- if hasattr(self, key):
28
- self.__dict__[key] = value
29
- else:
30
- raise AttributeError(f"{key} not an attribute of prediction job.")
31
-
32
- def _load_split_function(
33
- self, required_arguments: Sequence[str] = None
34
- ) -> Callable:
35
- """Load split function from path.
36
-
37
- Args:
38
- func_path (str): The path to the split function
39
-
40
- Returns:
41
- split_func (Callable): The loaded split function
42
-
43
- """
44
- if isinstance(self.function, str):
45
- path_elements = self.function.split(".")
46
- module_path = ".".join(path_elements[:-1])
47
- module = import_module(module_path)
48
- func_name = path_elements[-1]
49
- split_func = getattr(module, func_name)
50
- else:
51
- split_func = self.function
52
-
53
- # Check that the function accepts mandatory arguments
54
- if not callable(split_func):
55
- raise ValueError("The loaded object is not callable: {func_path!r}")
56
-
57
- if required_arguments is not None:
58
- func_params = set(inspect.signature(split_func).parameters)
59
-
60
- if len(set(required_arguments) - func_params) > 0:
61
- raise ValueError(
62
- "The loaded split function does not have the required arguments"
63
- )
64
-
65
- return split_func
66
-
67
- def _load_arguments(self) -> dict[str, Any]:
68
- """Load the arguments.
69
-
70
- Convert the arguments from JSON if they are given as strings or simply return them otherwise.
71
-
72
- Returns:
73
- arguments (dict[str, Any]): The additional arguments to be passed to he function
74
-
75
- """
76
- if isinstance(self.arguments, str):
77
- return json.loads(self.arguments)
78
- else:
79
- return self.arguments
80
-
81
- def load(
82
- self, required_arguments: Sequence[str] = None
83
- ) -> tuple[Callable, dict[str, Any]]:
84
- """Load the function and its arguments.
85
-
86
- If the function and the arguments are given as strings in the instane attributes, load them as Python objects
87
- otherwise just return them from the instance attributes.
88
-
89
- Args:
90
- required_arguments (list[str]): list of arguments the loaded function must have
91
-
92
- Returns:
93
- - function (Callable)
94
- - arguments (dict[str, Any])
95
-
96
- """
97
- return self._load_split_function(required_arguments), self._load_arguments()
openstef/enums.py DELETED
@@ -1,140 +0,0 @@
1
- # SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
2
- #
3
- # SPDX-License-Identifier: MPL-2.0
4
- from enum import Enum
5
-
6
-
7
- class BiddingZone(Enum):
8
- DE_50HZ = "DE_50HZ"
9
- AL = "AL"
10
- DE_AMPRION = "DE_AMPRION"
11
- AT = "AT"
12
- BY = "BY"
13
- BE = "BE"
14
- BA = "BA"
15
- BG = "BG"
16
- CZ_DE_SK = "CZ_DE_SK"
17
- HR = "HR"
18
- CWE = "CWE"
19
- CY = "CY"
20
- CZ = "CZ"
21
- DE_AT_LU = "DE_AT_LU"
22
- DE_LU = "DE_LU"
23
- DK = "DK"
24
- DK_1 = "DK_1"
25
- DK_1_NO_1 = "DK_1_NO_1"
26
- DK_2 = "DK_2"
27
- DK_CA = "DK_CA"
28
- EE = "EE"
29
- FI = "FI"
30
- MK = "MK"
31
- FR = "FR"
32
- DE = "DE"
33
- GR = "GR"
34
- HU = "HU"
35
- IS = "IS"
36
- IE_SEM = "IE_SEM"
37
- IE = "IE"
38
- IT = "IT"
39
- IT_SACO_AC = "IT_SACO_AC"
40
- IT_CALA = "IT_CALA"
41
- IT_SACO_DC = "IT_SACO_DC"
42
- IT_BRNN = "IT_BRNN"
43
- IT_CNOR = "IT_CNOR"
44
- IT_CSUD = "IT_CSUD"
45
- IT_FOGN = "IT_FOGN"
46
- IT_GR = "IT_GR"
47
- IT_MACRO_NORTH = "IT_MACRO_NORTH"
48
- IT_MACRO_SOUTH = "IT_MACRO_SOUTH"
49
- IT_MALTA = "IT_MALTA"
50
- IT_NORD = "IT_NORD"
51
- IT_NORD_AT = "IT_NORD_AT"
52
- IT_NORD_CH = "IT_NORD_CH"
53
- IT_NORD_FR = "IT_NORD_FR"
54
- IT_NORD_SI = "IT_NORD_SI"
55
- IT_PRGP = "IT_PRGP"
56
- IT_ROSN = "IT_ROSN"
57
- IT_SARD = "IT_SARD"
58
- IT_SICI = "IT_SICI"
59
- IT_SUD = "IT_SUD"
60
- RU_KGD = "RU_KGD"
61
- LV = "LV"
62
- LT = "LT"
63
- LU = "LU"
64
- LU_BZN = "LU_BZN"
65
- MT = "MT"
66
- ME = "ME"
67
- GB = "GB"
68
- GE = "GE"
69
- GB_IFA = "GB_IFA"
70
- GB_IFA2 = "GB_IFA2"
71
- GB_ELECLINK = "GB_ELECLINK"
72
- UK = "UK"
73
- NL = "NL"
74
- NO_1 = "NO_1"
75
- NO_1A = "NO_1A"
76
- NO_2 = "NO_2"
77
- NO_2_NSL = "NO_2_NSL"
78
- NO_2A = "NO_2A"
79
- NO_3 = "NO_3"
80
- NO_4 = "NO_4"
81
- NO_5 = "NO_5"
82
- NO = "NO"
83
- PL_CZ = "PL_CZ"
84
- PL = "PL"
85
- PT = "PT"
86
- MD = "MD"
87
- RO = "RO"
88
- RU = "RU"
89
- SE_1 = "SE_1"
90
- SE_2 = "SE_2"
91
- SE_3 = "SE_3"
92
- SE_4 = "SE_4"
93
- RS = "RS"
94
- SK = "SK"
95
- SI = "SI"
96
- GB_NIR = "GB_NIR"
97
- ES = "ES"
98
- SE = "SE"
99
- CH = "CH"
100
- DE_TENNET = "DE_TENNET"
101
- DE_TRANSNET = "DE_TRANSNET"
102
- TR = "TR"
103
- UA = "UA"
104
- UA_DOBTPP = "UA_DOBTPP"
105
- UA_BEI = "UA_BEI"
106
- UA_IPS = "UA_IPS"
107
- XK = "XK"
108
- DE_AMP_LU = "DE_AMP_LU"
109
-
110
-
111
- class AggregateFunction(Enum):
112
- MEAN = "mean"
113
- MEDIAN = "median"
114
- MAX = "max"
115
- MIN = "min"
116
-
117
-
118
- class ModelType(Enum):
119
- XGB = "xgb"
120
- XGB_QUANTILE = "xgb_quantile"
121
- XGB_MULTIOUTPUT_QUANTILE = "xgb_multioutput_quantile"
122
- LGB = "lgb"
123
- LINEAR = "linear"
124
- LINEAR_QUANTILE = "linear_quantile"
125
- GBLINEAR_QUANTILE = "gblinear_quantile"
126
- ARIMA = "arima"
127
- FLATLINER = "flatliner"
128
-
129
-
130
- class ForecastType(Enum):
131
- DEMAND = "demand"
132
- WIND = "wind"
133
- SOLAR = "solar"
134
- BASECASE = "basecase"
135
-
136
-
137
- class PipelineType(Enum):
138
- FORECAST = "forecast"
139
- TRAIN = "train"
140
- HYPER_PARMATERS = "hyper_parameters"
openstef/exceptions.py DELETED
@@ -1,74 +0,0 @@
1
- # SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
2
- #
3
- # SPDX-License-Identifier: MPL-2.0
4
-
5
- """Openstef custom exceptions."""
6
-
7
-
8
- # Define custom exceptions
9
- class NoPredictedLoadError(Exception):
10
- """No predicted load for given datatime range."""
11
-
12
- def __init__(
13
- self,
14
- pid: int,
15
- message: str = "No predicted load found",
16
- ):
17
- self.pid = pid
18
- self.message = message
19
- super().__init__(self.message)
20
-
21
-
22
- class NoRealisedLoadError(Exception):
23
- """No realised load for given datetime range."""
24
-
25
- def __init__(
26
- self,
27
- pid: int,
28
- message: str = "No realised load found",
29
- ):
30
- self.pid = pid
31
- self.message = message
32
- super().__init__(self.message)
33
-
34
-
35
- class InputDataInvalidError(Exception):
36
- """Invalid input data."""
37
-
38
-
39
- class InputDataInsufficientError(InputDataInvalidError):
40
- """Insufficient input data."""
41
-
42
-
43
- class InputDataWrongColumnOrderError(InputDataInvalidError):
44
- """Wrong column order input data."""
45
-
46
-
47
- class InputDataOngoingZeroFlatlinerError(InputDataInvalidError):
48
- """All recent load measurements are zero."""
49
-
50
-
51
- class OldModelHigherScoreError(Exception):
52
- """Old model has a higher score then new model."""
53
-
54
-
55
- class ModelWithoutStDev(Exception):
56
- """A machine learning model should have a valid standard deviation."""
57
-
58
-
59
- class ComponentForecastTooShortHorizonError(Exception):
60
- """Component forecasts should be available for at least 30 hours in advance."""
61
-
62
-
63
- class PredictionJobException(Exception):
64
- """One or more prediction jobs raised an exception."""
65
-
66
- def __init__(self, metrics=None):
67
- super().__init__("One or more prediction jobs raised an exception.")
68
- if metrics is None:
69
- metrics = {}
70
- self.metrics = metrics
71
-
72
-
73
- class SkipSaveTrainingForecasts(Exception):
74
- """If old model is better or too young, you don't need to save the traing forcast."""
@@ -1,3 +0,0 @@
1
- # SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
2
- #
3
- # SPDX-License-Identifier: MPL-2.0