openstef 3.2.28__tar.gz → 3.4.30__tar.gz
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.
- {openstef-3.2.28 → openstef-3.4.30}/PKG-INFO +65 -36
- {openstef-3.2.28 → openstef-3.4.30}/README.md +44 -31
- {openstef-3.2.28 → openstef-3.4.30}/openstef/__init__.py +1 -1
- openstef-3.4.30/openstef/__main__.py +3 -0
- openstef-3.4.30/openstef/app_settings.py +19 -0
- openstef-3.2.28/openstef/data/dazls_stored.sav.license → openstef-3.4.30/openstef/data/dutch_holidays_2020-2022.csv.license +1 -1
- openstef-3.4.30/openstef/data/pv_single_coefs.csv.license +3 -0
- {openstef-3.2.28/openstef/model → openstef-3.4.30/openstef/data_classes}/__init__.py +1 -1
- openstef-3.4.30/openstef/data_classes/data_prep.py +99 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/data_classes/model_specifications.py +2 -2
- {openstef-3.2.28 → openstef-3.4.30}/openstef/data_classes/prediction_job.py +41 -25
- {openstef-3.2.28 → openstef-3.4.30}/openstef/data_classes/split_function.py +9 -9
- {openstef-3.2.28 → openstef-3.4.30}/openstef/enums.py +9 -6
- {openstef-3.2.28 → openstef-3.4.30}/openstef/exceptions.py +12 -2
- {openstef-3.2.28/openstef/data_classes → openstef-3.4.30/openstef/feature_engineering}/__init__.py +1 -1
- {openstef-3.2.28 → openstef-3.4.30}/openstef/feature_engineering/apply_features.py +3 -10
- openstef-3.4.30/openstef/feature_engineering/data_preparation.py +152 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/feature_engineering/feature_adder.py +10 -13
- {openstef-3.2.28 → openstef-3.4.30}/openstef/feature_engineering/feature_applicator.py +6 -10
- {openstef-3.2.28 → openstef-3.4.30}/openstef/feature_engineering/general.py +17 -4
- {openstef-3.2.28 → openstef-3.4.30}/openstef/feature_engineering/holiday_features.py +19 -10
- {openstef-3.2.28 → openstef-3.4.30}/openstef/feature_engineering/lag_features.py +11 -13
- openstef-3.4.30/openstef/feature_engineering/missing_values_transformer.py +99 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/feature_engineering/weather_features.py +13 -6
- {openstef-3.2.28/openstef/feature_engineering → openstef-3.4.30/openstef/metrics}/__init__.py +1 -1
- {openstef-3.2.28 → openstef-3.4.30}/openstef/metrics/figure.py +77 -16
- {openstef-3.2.28 → openstef-3.4.30}/openstef/metrics/metrics.py +62 -4
- {openstef-3.2.28 → openstef-3.4.30}/openstef/metrics/reporter.py +41 -4
- {openstef-3.2.28/openstef/metrics → openstef-3.4.30/openstef/model}/__init__.py +1 -1
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/basecase.py +1 -1
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/confidence_interval_applicator.py +42 -14
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/fallback.py +1 -1
- openstef-3.4.30/openstef/model/metamodels/__init__.py +3 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/metamodels/grouped_regressor.py +7 -7
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/metamodels/missing_values_handler.py +2 -1
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/model_creator.py +44 -27
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/objective.py +59 -39
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/objective_creator.py +7 -4
- openstef-3.4.30/openstef/model/regressors/__init__.py +3 -0
- openstef-3.4.30/openstef/model/regressors/arima.py +197 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/regressors/custom_regressor.py +7 -18
- openstef-3.4.30/openstef/model/regressors/dazls.py +116 -0
- openstef-3.4.30/openstef/model/regressors/flatliner.py +100 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/regressors/lgbm.py +1 -1
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/regressors/linear.py +1 -1
- openstef-3.4.30/openstef/model/regressors/linear_quantile.py +247 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/regressors/regressor.py +3 -4
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/regressors/xgb.py +1 -1
- openstef-3.4.30/openstef/model/regressors/xgb_multioutput_quantile.py +261 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/regressors/xgb_quantile.py +15 -7
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/serializer.py +61 -35
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model/standard_deviation_generator.py +4 -6
- openstef-3.4.30/openstef/model_selection/__init__.py +3 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/model_selection/model_selection.py +22 -14
- openstef-3.4.30/openstef/monitoring/__init__.py +3 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/monitoring/performance_meter.py +2 -3
- {openstef-3.2.28 → openstef-3.4.30}/openstef/monitoring/teams.py +12 -1
- openstef-3.4.30/openstef/pipeline/__init__.py +3 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/pipeline/create_basecase_forecast.py +29 -13
- {openstef-3.2.28 → openstef-3.4.30}/openstef/pipeline/create_component_forecast.py +32 -11
- {openstef-3.2.28 → openstef-3.4.30}/openstef/pipeline/create_forecast.py +62 -18
- {openstef-3.2.28 → openstef-3.4.30}/openstef/pipeline/optimize_hyperparameters.py +76 -35
- {openstef-3.2.28 → openstef-3.4.30}/openstef/pipeline/train_create_forecast_backtest.py +27 -14
- {openstef-3.2.28 → openstef-3.4.30}/openstef/pipeline/train_model.py +152 -67
- {openstef-3.2.28 → openstef-3.4.30}/openstef/pipeline/utils.py +5 -3
- openstef-3.4.30/openstef/postprocessing/__init__.py +3 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/postprocessing/postprocessing.py +39 -23
- openstef-3.4.30/openstef/preprocessing/__init__.py +3 -0
- openstef-3.4.30/openstef/preprocessing/preprocessing.py +42 -0
- openstef-3.4.30/openstef/settings.py +15 -0
- openstef-3.4.30/openstef/tasks/__init__.py +3 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/tasks/calculate_kpi.py +28 -27
- {openstef-3.2.28 → openstef-3.4.30}/openstef/tasks/create_basecase_forecast.py +35 -7
- {openstef-3.2.28 → openstef-3.4.30}/openstef/tasks/create_components_forecast.py +47 -13
- openstef-3.4.30/openstef/tasks/create_forecast.py +140 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/tasks/create_solar_forecast.py +2 -2
- {openstef-3.2.28 → openstef-3.4.30}/openstef/tasks/create_wind_forecast.py +2 -2
- {openstef-3.2.28 → openstef-3.4.30}/openstef/tasks/optimize_hyperparameters.py +32 -8
- {openstef-3.2.28 → openstef-3.4.30}/openstef/tasks/split_forecast.py +19 -13
- openstef-3.4.30/openstef/tasks/train_model.py +193 -0
- openstef-3.4.30/openstef/tasks/utils/__init__.py +3 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/tasks/utils/dependencies.py +5 -5
- {openstef-3.2.28 → openstef-3.4.30}/openstef/tasks/utils/predictionjobloop.py +4 -5
- {openstef-3.2.28 → openstef-3.4.30}/openstef/tasks/utils/taskcontext.py +11 -4
- openstef-3.4.30/openstef/validation/__init__.py +3 -0
- openstef-3.4.30/openstef/validation/validation.py +322 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef.egg-info/PKG-INFO +65 -36
- {openstef-3.2.28 → openstef-3.4.30}/openstef.egg-info/SOURCES.txt +9 -5
- openstef-3.4.30/openstef.egg-info/requires.txt +19 -0
- {openstef-3.2.28 → openstef-3.4.30}/pyproject.toml +3 -3
- {openstef-3.2.28 → openstef-3.4.30}/setup.py +4 -9
- openstef-3.2.28/openstef/__main__.py +0 -51
- openstef-3.2.28/openstef/data/dazls_stored.sav +0 -0
- openstef-3.2.28/openstef/data/dutch_holidays_2020-2022.csv.license +0 -3
- openstef-3.2.28/openstef/data/pv_single_coefs.csv.license +0 -3
- openstef-3.2.28/openstef/feature_engineering/historic_features.py +0 -40
- openstef-3.2.28/openstef/model/metamodels/__init__.py +0 -3
- openstef-3.2.28/openstef/model/regressors/__init__.py +0 -3
- openstef-3.2.28/openstef/model/regressors/dazls.py +0 -157
- openstef-3.2.28/openstef/model/regressors/proloaf.py +0 -281
- openstef-3.2.28/openstef/model_selection/__init__.py +0 -3
- openstef-3.2.28/openstef/monitoring/__init__.py +0 -3
- openstef-3.2.28/openstef/pipeline/__init__.py +0 -3
- openstef-3.2.28/openstef/postprocessing/__init__.py +0 -3
- openstef-3.2.28/openstef/preprocessing/__init__.py +0 -3
- openstef-3.2.28/openstef/preprocessing/preprocessing.py +0 -27
- openstef-3.2.28/openstef/tasks/__init__.py +0 -3
- openstef-3.2.28/openstef/tasks/create_forecast.py +0 -92
- openstef-3.2.28/openstef/tasks/run_tracy.py +0 -147
- openstef-3.2.28/openstef/tasks/train_model.py +0 -124
- openstef-3.2.28/openstef/tasks/utils/__init__.py +0 -3
- openstef-3.2.28/openstef/validation/__init__.py +0 -3
- openstef-3.2.28/openstef/validation/validation.py +0 -405
- openstef-3.2.28/openstef.egg-info/requires.txt +0 -23
- {openstef-3.2.28 → openstef-3.4.30}/LICENSE +0 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/data/dutch_holidays_2020-2022.csv +0 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef/data/pv_single_coefs.csv +0 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef.egg-info/dependency_links.txt +0 -0
- {openstef-3.2.28 → openstef-3.4.30}/openstef.egg-info/top_level.txt +0 -0
- {openstef-3.2.28 → openstef-3.4.30}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: openstef
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.4.30
|
4
4
|
Summary: Open short term energy forecaster
|
5
5
|
Home-page: https://github.com/OpenSTEF/openstef
|
6
6
|
Author: Alliander N.V
|
@@ -10,24 +10,42 @@ Keywords: energy,forecasting,machinelearning
|
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
11
11
|
Classifier: Intended Audience :: Developers
|
12
12
|
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
|
13
|
-
Classifier: Programming Language :: Python :: 3.7
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
15
13
|
Classifier: Programming Language :: Python :: 3.9
|
16
14
|
Classifier: Programming Language :: Python :: 3.10
|
17
|
-
Requires-Python: >=3.
|
15
|
+
Requires-Python: >=3.9.0
|
18
16
|
Description-Content-Type: text/markdown
|
19
|
-
Provides-Extra: proloaf
|
20
17
|
License-File: LICENSE
|
18
|
+
Requires-Dist: holidays==0.21
|
19
|
+
Requires-Dist: joblib==1.3.2
|
20
|
+
Requires-Dist: lightgbm~=3.3
|
21
|
+
Requires-Dist: matplotlib~=3.7
|
22
|
+
Requires-Dist: mlflow~=2.3
|
23
|
+
Requires-Dist: networkx~=3.1
|
24
|
+
Requires-Dist: optuna~=3.1
|
25
|
+
Requires-Dist: optuna-integration~=3.6
|
26
|
+
Requires-Dist: pandas~=2.2.0
|
27
|
+
Requires-Dist: plotly~=5.18
|
28
|
+
Requires-Dist: pvlib==0.9.4
|
29
|
+
Requires-Dist: pydantic~=2.4
|
30
|
+
Requires-Dist: pydantic-settings~=2.3
|
31
|
+
Requires-Dist: pymsteams~=0.2.2
|
32
|
+
Requires-Dist: scikit-learn~=1.3
|
33
|
+
Requires-Dist: scipy~=1.10
|
34
|
+
Requires-Dist: statsmodels~=0.13.5
|
35
|
+
Requires-Dist: structlog<25,>=23.1
|
36
|
+
Requires-Dist: xgboost~=2.0
|
21
37
|
|
22
38
|
<!--
|
23
|
-
SPDX-FileCopyrightText: 2017-
|
39
|
+
SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
|
24
40
|
|
25
41
|
SPDX-License-Identifier: MPL-2.0
|
26
42
|
-->
|
27
43
|
|
28
|
-
|
29
|
-
|
30
|
-
[](https://pepy.tech/project/openstef)
|
47
|
+
[](https://pepy.tech/project/openstef)
|
48
|
+
[](https://bestpractices.coreinfrastructure.org/projects/5585)
|
31
49
|
<!-- SonarCloud badges -->
|
32
50
|
[](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
|
33
51
|
[](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
|
@@ -38,21 +56,29 @@ SPDX-License-Identifier: MPL-2.0
|
|
38
56
|
[](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
|
39
57
|
[](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
|
40
58
|
[](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
|
41
|
-
[](https://bestpractices.coreinfrastructure.org/projects/5585)
|
42
|
-
|
43
|
-
# OpenSTEF
|
44
|
-
|
45
|
-
OpenSTEF is a Python package which is used to make short term forecasts for the energy sector. This repository contains all components for the machine learning pipeline required to make a forecast. In order to use the package you need to provide your own data storage and retrieval interface.
|
46
59
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
60
|
+
OpenSTEF is a Python package designed for generating short-term forecasts in the energy sector. The repository includes all the essential components required for machine learning pipelines that facilitate the forecasting process. To utilize the package, users are required to furnish their own data storage and retrieval interface.
|
61
|
+
|
62
|
+
# Table of contents
|
63
|
+
- [OpenSTEF](#openstef)
|
64
|
+
- [Table of contents](#table-of-contents)
|
65
|
+
- [External information sources](#external-information-sources)
|
66
|
+
- [Installation](#install)
|
67
|
+
- [Usage](#usage)
|
68
|
+
- [Example notebooks](#example-notebooks)
|
69
|
+
- [Reference Implementation](#reference-implementation)
|
70
|
+
- [Database connector for OpenSTEF](#database-connector-for-openstef)
|
71
|
+
- [License](license)
|
72
|
+
- [Contributing](#contributing)
|
73
|
+
- [Contact](#contact)
|
74
|
+
|
75
|
+
# External information sources
|
76
|
+
- [Documentation website](https://openstef.github.io/openstef/index.html);
|
77
|
+
- [Python package](https://pypi.org/project/openstef/);
|
78
|
+
- [Linux Foundation project page](https://www.lfenergy.org/projects/openstef/);
|
79
|
+
- [Documentation on dashboard](https://raw.githack.com/OpenSTEF/.github/main/profile/html/openstef_dashboard_doc.html);
|
80
|
+
- [Video about OpenSTEF](https://www.lfenergy.org/forecasting-to-create-a-more-resilient-optimized-grid/);
|
81
|
+
- [Teams channel](https://teams.microsoft.com/l/team/19%3ac08a513650524fc988afb296cd0358cc%40thread.tacv2/conversations?groupId=bfcb763a-3a97-4938-81d7-b14512aa537d&tenantId=697f104b-d7cb-48c8-ac9f-bd87105bafdc)
|
56
82
|
|
57
83
|
# Installation
|
58
84
|
|
@@ -62,10 +88,6 @@ Want to join the discussion? Join our [Teams channel](https://teams.microsoft.co
|
|
62
88
|
pip install openstef
|
63
89
|
```
|
64
90
|
|
65
|
-
_**Optional**_: if you would like to use the proloaf model with OpenSTEF install the proloaf dependencies by running:
|
66
|
-
```shell
|
67
|
-
pip install openstef[proloaf]
|
68
|
-
```
|
69
91
|
### Remark regarding installation within a **conda environment on Windows**:
|
70
92
|
|
71
93
|
A version of the pywin32 package will be installed as a secondary dependency along with the installation of the openstef package. Since conda relies on an old version of pywin32, the new installation can break conda's functionality. The following command can solve this issue:
|
@@ -76,27 +98,34 @@ For more information on this issue see the [readme of pywin32](https://github.co
|
|
76
98
|
|
77
99
|
# Usage
|
78
100
|
|
101
|
+
## Example notebooks
|
102
|
+
To help you get started, a set of fundamental example notebooks has been created. You can access these offline examples [here](https://github.com/OpenSTEF/openstef-offline-example).
|
103
|
+
|
104
|
+
## Reference Implementation
|
105
|
+
A complete implementation including databases, user interface, example data, etc. is available at: https://github.com/OpenSTEF/openstef-reference
|
106
|
+
|
107
|
+

|
108
|
+
Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
|
109
|
+
Dashboard documentation can be found [here](https://raw.githack.com/OpenSTEF/.github/main/profile/html/openstef_dashboard_doc.html).
|
110
|
+
|
79
111
|
To run a task use:
|
80
112
|
|
81
113
|
```shell
|
82
114
|
python -m openstef task <task_name>
|
83
115
|
```
|
84
116
|
|
85
|
-
##
|
86
|
-
|
87
|
-
|
88
|
-

|
89
|
-
Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
|
90
|
-
Dashboard documentation can be found [here](https://github.com/OpenSTEF/.github/blob/main/profile/README.md).
|
117
|
+
## Database connector for openstef
|
118
|
+
This repository provides an interface to OpenSTEF (reference) databases. The repository can be found [here](https://github.com/OpenSTEF/openstef-dbc).
|
91
119
|
|
92
|
-
|
120
|
+
# License
|
93
121
|
This project is licensed under the Mozilla Public License, version 2.0 - see LICENSE for details.
|
94
122
|
|
95
123
|
## Licenses third-party libraries
|
96
124
|
This project includes third-party libraries, which are licensed under their own respective Open-Source licenses. SPDX-License-Identifier headers are used to show which license is applicable. The concerning license files can be found in the LICENSES directory.
|
97
125
|
|
98
|
-
|
126
|
+
# Contributing
|
99
127
|
Please read [CODE_OF_CONDUCT.md](https://github.com/OpenSTEF/.github/blob/main/CODE_OF_CONDUCT.md), [CONTRIBUTING.md](https://github.com/OpenSTEF/.github/blob/main/CONTRIBUTING.md) and [PROJECT_GOVERNANCE.md](https://github.com/OpenSTEF/.github/blob/main/PROJECT_GOVERNANCE.md) for details on the process for submitting pull requests to us.
|
100
128
|
|
101
|
-
|
129
|
+
# Contact
|
102
130
|
Please read [SUPPORT.md](https://github.com/OpenSTEF/.github/blob/main/SUPPORT.md) for how to connect and get into contact with the OpenSTEF project
|
131
|
+
|
@@ -1,12 +1,14 @@
|
|
1
1
|
<!--
|
2
|
-
SPDX-FileCopyrightText: 2017-
|
2
|
+
SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
|
3
3
|
|
4
4
|
SPDX-License-Identifier: MPL-2.0
|
5
5
|
-->
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
[](https://pepy.tech/project/openstef)
|
10
|
+
[](https://pepy.tech/project/openstef)
|
11
|
+
[](https://bestpractices.coreinfrastructure.org/projects/5585)
|
10
12
|
<!-- SonarCloud badges -->
|
11
13
|
[](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
|
12
14
|
[](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
|
@@ -17,21 +19,29 @@ SPDX-License-Identifier: MPL-2.0
|
|
17
19
|
[](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
|
18
20
|
[](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
|
19
21
|
[](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
|
20
|
-
[](https://bestpractices.coreinfrastructure.org/projects/5585)
|
21
|
-
|
22
|
-
# OpenSTEF
|
23
|
-
|
24
|
-
OpenSTEF is a Python package which is used to make short term forecasts for the energy sector. This repository contains all components for the machine learning pipeline required to make a forecast. In order to use the package you need to provide your own data storage and retrieval interface.
|
25
22
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
23
|
+
OpenSTEF is a Python package designed for generating short-term forecasts in the energy sector. The repository includes all the essential components required for machine learning pipelines that facilitate the forecasting process. To utilize the package, users are required to furnish their own data storage and retrieval interface.
|
24
|
+
|
25
|
+
# Table of contents
|
26
|
+
- [OpenSTEF](#openstef)
|
27
|
+
- [Table of contents](#table-of-contents)
|
28
|
+
- [External information sources](#external-information-sources)
|
29
|
+
- [Installation](#install)
|
30
|
+
- [Usage](#usage)
|
31
|
+
- [Example notebooks](#example-notebooks)
|
32
|
+
- [Reference Implementation](#reference-implementation)
|
33
|
+
- [Database connector for OpenSTEF](#database-connector-for-openstef)
|
34
|
+
- [License](license)
|
35
|
+
- [Contributing](#contributing)
|
36
|
+
- [Contact](#contact)
|
37
|
+
|
38
|
+
# External information sources
|
39
|
+
- [Documentation website](https://openstef.github.io/openstef/index.html);
|
40
|
+
- [Python package](https://pypi.org/project/openstef/);
|
41
|
+
- [Linux Foundation project page](https://www.lfenergy.org/projects/openstef/);
|
42
|
+
- [Documentation on dashboard](https://raw.githack.com/OpenSTEF/.github/main/profile/html/openstef_dashboard_doc.html);
|
43
|
+
- [Video about OpenSTEF](https://www.lfenergy.org/forecasting-to-create-a-more-resilient-optimized-grid/);
|
44
|
+
- [Teams channel](https://teams.microsoft.com/l/team/19%3ac08a513650524fc988afb296cd0358cc%40thread.tacv2/conversations?groupId=bfcb763a-3a97-4938-81d7-b14512aa537d&tenantId=697f104b-d7cb-48c8-ac9f-bd87105bafdc)
|
35
45
|
|
36
46
|
# Installation
|
37
47
|
|
@@ -41,10 +51,6 @@ Want to join the discussion? Join our [Teams channel](https://teams.microsoft.co
|
|
41
51
|
pip install openstef
|
42
52
|
```
|
43
53
|
|
44
|
-
_**Optional**_: if you would like to use the proloaf model with OpenSTEF install the proloaf dependencies by running:
|
45
|
-
```shell
|
46
|
-
pip install openstef[proloaf]
|
47
|
-
```
|
48
54
|
### Remark regarding installation within a **conda environment on Windows**:
|
49
55
|
|
50
56
|
A version of the pywin32 package will be installed as a secondary dependency along with the installation of the openstef package. Since conda relies on an old version of pywin32, the new installation can break conda's functionality. The following command can solve this issue:
|
@@ -55,27 +61,34 @@ For more information on this issue see the [readme of pywin32](https://github.co
|
|
55
61
|
|
56
62
|
# Usage
|
57
63
|
|
64
|
+
## Example notebooks
|
65
|
+
To help you get started, a set of fundamental example notebooks has been created. You can access these offline examples [here](https://github.com/OpenSTEF/openstef-offline-example).
|
66
|
+
|
67
|
+
## Reference Implementation
|
68
|
+
A complete implementation including databases, user interface, example data, etc. is available at: https://github.com/OpenSTEF/openstef-reference
|
69
|
+
|
70
|
+

|
71
|
+
Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
|
72
|
+
Dashboard documentation can be found [here](https://raw.githack.com/OpenSTEF/.github/main/profile/html/openstef_dashboard_doc.html).
|
73
|
+
|
58
74
|
To run a task use:
|
59
75
|
|
60
76
|
```shell
|
61
77
|
python -m openstef task <task_name>
|
62
78
|
```
|
63
79
|
|
64
|
-
##
|
65
|
-
|
66
|
-
|
67
|
-

|
68
|
-
Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
|
69
|
-
Dashboard documentation can be found [here](https://github.com/OpenSTEF/.github/blob/main/profile/README.md).
|
80
|
+
## Database connector for openstef
|
81
|
+
This repository provides an interface to OpenSTEF (reference) databases. The repository can be found [here](https://github.com/OpenSTEF/openstef-dbc).
|
70
82
|
|
71
|
-
|
83
|
+
# License
|
72
84
|
This project is licensed under the Mozilla Public License, version 2.0 - see LICENSE for details.
|
73
85
|
|
74
86
|
## Licenses third-party libraries
|
75
87
|
This project includes third-party libraries, which are licensed under their own respective Open-Source licenses. SPDX-License-Identifier headers are used to show which license is applicable. The concerning license files can be found in the LICENSES directory.
|
76
88
|
|
77
|
-
|
89
|
+
# Contributing
|
78
90
|
Please read [CODE_OF_CONDUCT.md](https://github.com/OpenSTEF/.github/blob/main/CODE_OF_CONDUCT.md), [CONTRIBUTING.md](https://github.com/OpenSTEF/.github/blob/main/CONTRIBUTING.md) and [PROJECT_GOVERNANCE.md](https://github.com/OpenSTEF/.github/blob/main/PROJECT_GOVERNANCE.md) for details on the process for submitting pull requests to us.
|
79
91
|
|
80
|
-
|
92
|
+
# Contact
|
81
93
|
Please read [SUPPORT.md](https://github.com/OpenSTEF/.github/blob/main/SUPPORT.md) for how to connect and get into contact with the OpenSTEF project
|
94
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# SPDX-FileCopyrightText: 2017-
|
1
|
+
# SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: MPL-2.0
|
4
4
|
|
@@ -0,0 +1,19 @@
|
|
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
|
+
from pydantic import Field
|
6
|
+
from pydantic_settings import BaseSettings, SettingsConfigDict
|
7
|
+
|
8
|
+
|
9
|
+
class AppSettings(BaseSettings):
|
10
|
+
"""Global app settings."""
|
11
|
+
|
12
|
+
model_config = SettingsConfigDict(
|
13
|
+
env_prefix="openstef_", env_file=".env", extra="ignore"
|
14
|
+
)
|
15
|
+
|
16
|
+
post_teams_messages: bool = True
|
17
|
+
|
18
|
+
# Logging settings.
|
19
|
+
log_level: str = Field("INFO", description="Log level used for logging statements.")
|
@@ -1,3 +1,3 @@
|
|
1
|
-
# SPDX-FileCopyrightText: 2017-
|
1
|
+
# SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: MPL-2.0
|
@@ -0,0 +1,99 @@
|
|
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,10 +1,10 @@
|
|
1
|
-
# SPDX-FileCopyrightText: 2017-
|
1
|
+
# SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: MPL-2.0
|
4
4
|
"""Specifies the dataclass for model specifications."""
|
5
5
|
from typing import Optional, Union
|
6
6
|
|
7
|
-
from pydantic import BaseModel
|
7
|
+
from pydantic.v1 import BaseModel
|
8
8
|
|
9
9
|
|
10
10
|
class ModelSpecificationDataClass(BaseModel):
|
@@ -1,13 +1,15 @@
|
|
1
|
-
# SPDX-FileCopyrightText: 2017-
|
1
|
+
# SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: MPL-2.0
|
4
4
|
"""Specifies the prediction job dataclass."""
|
5
|
-
from typing import
|
5
|
+
from typing import Optional, Union
|
6
6
|
|
7
|
-
from pydantic import BaseModel
|
7
|
+
from pydantic.v1 import BaseModel
|
8
8
|
|
9
|
-
from .
|
10
|
-
from .
|
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
|
11
13
|
|
12
14
|
|
13
15
|
class PredictionJobDataClass(BaseModel):
|
@@ -17,61 +19,65 @@ class PredictionJobDataClass(BaseModel):
|
|
17
19
|
"""The predictions job id (often abreviated as pid)."""
|
18
20
|
model: str
|
19
21
|
"""The model type that should be used.
|
20
|
-
|
22
|
+
|
21
23
|
Options are:
|
22
24
|
- ``"xgb"``
|
23
25
|
- ``"xgb_quantile"``
|
24
26
|
- ``"lgb"``
|
25
27
|
- ``"linear"``
|
26
|
-
- ``"
|
27
|
-
|
28
|
+
- ``"linear_quantile"``
|
29
|
+
- ``"xgb_multioutput_quantile"``
|
30
|
+
- ``"flatliner"``
|
31
|
+
|
28
32
|
If unsure what to pick, choose ``"xgb"``.
|
29
|
-
|
33
|
+
|
30
34
|
"""
|
35
|
+
model_kwargs: Optional[dict]
|
36
|
+
"""The model parameters that should be used."""
|
31
37
|
forecast_type: str
|
32
38
|
"""The type of forecasts that should be made.
|
33
|
-
|
39
|
+
|
34
40
|
Options are:
|
35
41
|
- ``"demand"``
|
36
42
|
- ``"wind"``
|
37
|
-
- ``"basecase"``
|
38
|
-
|
43
|
+
- ``"basecase"``
|
44
|
+
|
39
45
|
If unsure what to pick, choose ``"demand"``.
|
40
|
-
|
46
|
+
|
41
47
|
"""
|
42
|
-
horizon_minutes: int
|
43
|
-
"""The horizon of the desired forecast in minutes."""
|
48
|
+
horizon_minutes: Optional[int] = 2880
|
49
|
+
"""The horizon of the desired forecast in minutes used in tasks. Defaults to 2880 minutes (i.e. 2 days)."""
|
44
50
|
resolution_minutes: int
|
45
51
|
"""The resolution of the desired forecast in minutes."""
|
46
|
-
lat: float
|
47
|
-
"""Latitude of the forecasted location in degrees."""
|
48
|
-
lon: float
|
49
|
-
"""Longitude of the forecasted location in degrees."""
|
52
|
+
lat: Optional[float] = 52.132633
|
53
|
+
"""Latitude of the forecasted location in degrees. Used for fetching weather data in tasks, calculating derrived features and component splitting."""
|
54
|
+
lon: Optional[float] = 5.291266
|
55
|
+
"""Longitude of the forecasted location in degrees. Used for fetching weather data in tasks, calculating derrived features and component splitting."""
|
50
56
|
name: str
|
51
57
|
"""Name of the forecast, e.g. the location name."""
|
52
58
|
train_components: Optional[bool]
|
53
59
|
"""Whether splitting the forecasts in wind, solar, rest is desired."""
|
54
60
|
description: Optional[str]
|
55
61
|
"""Optional description of the prediction job for human reference."""
|
56
|
-
quantiles: Optional[
|
62
|
+
quantiles: Optional[list[float]]
|
57
63
|
"""Quantiles that have to be forecasted."""
|
58
64
|
train_split_func: Optional[SplitFuncDataClass]
|
59
65
|
"""Optional custom splitting function for operational procces."""
|
60
66
|
backtest_split_func: Optional[SplitFuncDataClass]
|
61
67
|
"""Optional custom splitting function for backtesting."""
|
62
|
-
train_horizons_minutes: Optional[
|
68
|
+
train_horizons_minutes: Optional[list[int]]
|
63
69
|
"""List of horizons that should be taken into account during training."""
|
64
70
|
default_modelspecs: Optional[ModelSpecificationDataClass]
|
65
71
|
"""Default model specifications"""
|
66
72
|
save_train_forecasts: bool = False
|
67
73
|
"""Indicate wether the forecasts produced during the training process should be saved."""
|
68
|
-
|
74
|
+
completeness_threshold: float = 0.5
|
69
75
|
"""Minimum fraction of data that should be available for making a regular forecast."""
|
70
76
|
minimal_table_length: int = 100
|
71
77
|
"""Minimum length (in rows) of the forecast input for making a regular forecast."""
|
72
|
-
|
73
|
-
"""Number of
|
74
|
-
depends_on: Optional[
|
78
|
+
flatliner_threshold_minutes: int = 1440
|
79
|
+
"""Number of minutes that the load has to be constant to detect a flatliner. """
|
80
|
+
depends_on: Optional[list[Union[int, str]]]
|
75
81
|
"""Link to another prediction job on which this prediction job might depend."""
|
76
82
|
sid: Optional[str]
|
77
83
|
"""Only required for create_solar_forecast task"""
|
@@ -81,6 +87,16 @@ class PredictionJobDataClass(BaseModel):
|
|
81
87
|
"""Only required for create_wind_forecast task"""
|
82
88
|
hub_height: Optional[float]
|
83
89
|
"""Only required for create_wind_forecast task"""
|
90
|
+
pipelines_to_run: list[PipelineType] = [
|
91
|
+
PipelineType.TRAIN,
|
92
|
+
PipelineType.HYPER_PARMATERS,
|
93
|
+
PipelineType.FORECAST,
|
94
|
+
]
|
95
|
+
"""The pipelines to run for this pj"""
|
96
|
+
alternative_forecast_model_pid: Optional[Union[int, str]]
|
97
|
+
"""The pid that references another prediction job from which the model should be used for making forecasts."""
|
98
|
+
data_prep_class: Optional[DataPrepDataClass]
|
99
|
+
"""The import string for the custom data prep class"""
|
84
100
|
|
85
101
|
class Config:
|
86
102
|
"""Pydantic model configuration.
|
@@ -1,13 +1,13 @@
|
|
1
|
-
# SPDX-FileCopyrightText: 2017-
|
1
|
+
# SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: MPL-2.0
|
4
4
|
"""Specifies the split function dataclass."""
|
5
5
|
import inspect
|
6
6
|
import json
|
7
7
|
from importlib import import_module
|
8
|
-
from typing import Any, Callable,
|
8
|
+
from typing import Any, Callable, Sequence, Union
|
9
9
|
|
10
|
-
from pydantic import BaseModel
|
10
|
+
from pydantic.v1 import BaseModel
|
11
11
|
|
12
12
|
|
13
13
|
class SplitFuncDataClass(BaseModel):
|
@@ -15,7 +15,7 @@ class SplitFuncDataClass(BaseModel):
|
|
15
15
|
|
16
16
|
function: Union[str, Callable]
|
17
17
|
arguments: Union[
|
18
|
-
str,
|
18
|
+
str, dict[str, Any]
|
19
19
|
] # JSON string holding the function parameters or dict
|
20
20
|
|
21
21
|
def __getitem__(self, key: str):
|
@@ -64,13 +64,13 @@ class SplitFuncDataClass(BaseModel):
|
|
64
64
|
|
65
65
|
return split_func
|
66
66
|
|
67
|
-
def _load_arguments(self) ->
|
67
|
+
def _load_arguments(self) -> dict[str, Any]:
|
68
68
|
"""Load the arguments.
|
69
69
|
|
70
70
|
Convert the arguments from JSON if they are given as strings or simply return them otherwise.
|
71
71
|
|
72
72
|
Returns:
|
73
|
-
arguments (
|
73
|
+
arguments (dict[str, Any]): The additional arguments to be passed to he function
|
74
74
|
|
75
75
|
"""
|
76
76
|
if isinstance(self.arguments, str):
|
@@ -80,18 +80,18 @@ class SplitFuncDataClass(BaseModel):
|
|
80
80
|
|
81
81
|
def load(
|
82
82
|
self, required_arguments: Sequence[str] = None
|
83
|
-
) ->
|
83
|
+
) -> tuple[Callable, dict[str, Any]]:
|
84
84
|
"""Load the function and its arguments.
|
85
85
|
|
86
86
|
If the function and the arguments are given as strings in the instane attributes, load them as Python objects
|
87
87
|
otherwise just return them from the instance attributes.
|
88
88
|
|
89
89
|
Args:
|
90
|
-
required_arguments (
|
90
|
+
required_arguments (list[str]): list of arguments the loaded function must have
|
91
91
|
|
92
92
|
Returns:
|
93
93
|
- function (Callable)
|
94
|
-
- arguments (
|
94
|
+
- arguments (dict[str, Any])
|
95
95
|
|
96
96
|
"""
|
97
97
|
return self._load_split_function(required_arguments), self._load_arguments()
|