openstef 3.2.28__tar.gz → 3.4.16__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.
Files changed (130) hide show
  1. {openstef-3.2.28 → openstef-3.4.16}/PKG-INFO +56 -22
  2. {openstef-3.2.28 → openstef-3.4.16}/README.md +36 -17
  3. {openstef-3.2.28 → openstef-3.4.16}/openstef/__init__.py +1 -1
  4. openstef-3.4.16/openstef/__main__.py +3 -0
  5. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_adaptation_model.z +0 -0
  6. openstef-3.2.28/openstef/data/dazls_stored.sav.license → openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_adaptation_model.z.license +1 -1
  7. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_adaptation_model_features.z +0 -0
  8. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_adaptation_model_features.z.license +3 -0
  9. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_adaptation_model_scaler.z +0 -0
  10. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_adaptation_model_scaler.z.license +3 -0
  11. openstef-3.2.28/openstef/data/dazls_stored.sav → openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_domain_model.z +0 -0
  12. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_domain_model.z.license +3 -0
  13. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_domain_model_features.z +2 -0
  14. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_domain_model_features.z.license +3 -0
  15. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_domain_model_scaler.z +0 -0
  16. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_domain_model_scaler.z.license +3 -0
  17. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_model_card.md +14 -0
  18. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_model_card.md.license +3 -0
  19. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_target.z +0 -0
  20. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_target.z.license +3 -0
  21. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_target_scaler.z +0 -0
  22. openstef-3.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_target_scaler.z.license +3 -0
  23. openstef-3.4.16/openstef/data/dutch_holidays_2020-2022.csv.license +3 -0
  24. openstef-3.4.16/openstef/data/pv_single_coefs.csv.license +3 -0
  25. {openstef-3.2.28/openstef/model → openstef-3.4.16/openstef/data_classes}/__init__.py +1 -1
  26. openstef-3.4.16/openstef/data_classes/data_prep.py +99 -0
  27. {openstef-3.2.28 → openstef-3.4.16}/openstef/data_classes/model_specifications.py +2 -2
  28. {openstef-3.2.28 → openstef-3.4.16}/openstef/data_classes/prediction_job.py +36 -25
  29. {openstef-3.2.28 → openstef-3.4.16}/openstef/data_classes/split_function.py +9 -9
  30. {openstef-3.2.28 → openstef-3.4.16}/openstef/enums.py +6 -6
  31. {openstef-3.2.28 → openstef-3.4.16}/openstef/exceptions.py +11 -1
  32. {openstef-3.2.28/openstef/data_classes → openstef-3.4.16/openstef/feature_engineering}/__init__.py +1 -1
  33. {openstef-3.2.28 → openstef-3.4.16}/openstef/feature_engineering/apply_features.py +3 -10
  34. openstef-3.4.16/openstef/feature_engineering/data_preparation.py +145 -0
  35. {openstef-3.2.28 → openstef-3.4.16}/openstef/feature_engineering/feature_adder.py +10 -13
  36. {openstef-3.2.28 → openstef-3.4.16}/openstef/feature_engineering/feature_applicator.py +6 -10
  37. {openstef-3.2.28 → openstef-3.4.16}/openstef/feature_engineering/general.py +3 -4
  38. {openstef-3.2.28 → openstef-3.4.16}/openstef/feature_engineering/holiday_features.py +19 -10
  39. {openstef-3.2.28 → openstef-3.4.16}/openstef/feature_engineering/lag_features.py +11 -13
  40. {openstef-3.2.28 → openstef-3.4.16}/openstef/feature_engineering/weather_features.py +6 -6
  41. {openstef-3.2.28/openstef/feature_engineering → openstef-3.4.16/openstef/metrics}/__init__.py +1 -1
  42. {openstef-3.2.28 → openstef-3.4.16}/openstef/metrics/figure.py +77 -16
  43. {openstef-3.2.28 → openstef-3.4.16}/openstef/metrics/metrics.py +11 -4
  44. {openstef-3.2.28 → openstef-3.4.16}/openstef/metrics/reporter.py +34 -4
  45. {openstef-3.2.28/openstef/metrics → openstef-3.4.16/openstef/model}/__init__.py +1 -1
  46. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/basecase.py +1 -1
  47. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/confidence_interval_applicator.py +17 -11
  48. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/fallback.py +1 -1
  49. openstef-3.4.16/openstef/model/metamodels/__init__.py +3 -0
  50. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/metamodels/grouped_regressor.py +7 -7
  51. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/metamodels/missing_values_handler.py +2 -1
  52. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/model_creator.py +9 -28
  53. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/objective.py +42 -52
  54. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/objective_creator.py +4 -4
  55. openstef-3.4.16/openstef/model/regressors/__init__.py +3 -0
  56. openstef-3.4.16/openstef/model/regressors/arima.py +197 -0
  57. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/regressors/custom_regressor.py +7 -18
  58. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/regressors/dazls.py +56 -22
  59. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/regressors/lgbm.py +1 -1
  60. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/regressors/linear.py +1 -1
  61. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/regressors/regressor.py +3 -4
  62. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/regressors/xgb.py +1 -1
  63. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/regressors/xgb_quantile.py +15 -7
  64. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/serializer.py +54 -35
  65. {openstef-3.2.28 → openstef-3.4.16}/openstef/model/standard_deviation_generator.py +4 -6
  66. openstef-3.4.16/openstef/model_selection/__init__.py +3 -0
  67. {openstef-3.2.28 → openstef-3.4.16}/openstef/model_selection/model_selection.py +22 -14
  68. openstef-3.4.16/openstef/monitoring/__init__.py +3 -0
  69. {openstef-3.2.28 → openstef-3.4.16}/openstef/monitoring/performance_meter.py +2 -3
  70. {openstef-3.2.28 → openstef-3.4.16}/openstef/monitoring/teams.py +1 -1
  71. openstef-3.4.16/openstef/pipeline/__init__.py +3 -0
  72. {openstef-3.2.28 → openstef-3.4.16}/openstef/pipeline/create_basecase_forecast.py +22 -13
  73. {openstef-3.2.28 → openstef-3.4.16}/openstef/pipeline/create_component_forecast.py +42 -11
  74. {openstef-3.2.28 → openstef-3.4.16}/openstef/pipeline/create_forecast.py +50 -18
  75. {openstef-3.2.28 → openstef-3.4.16}/openstef/pipeline/optimize_hyperparameters.py +68 -34
  76. {openstef-3.2.28 → openstef-3.4.16}/openstef/pipeline/train_create_forecast_backtest.py +25 -14
  77. {openstef-3.2.28 → openstef-3.4.16}/openstef/pipeline/train_model.py +140 -63
  78. {openstef-3.2.28 → openstef-3.4.16}/openstef/pipeline/utils.py +5 -3
  79. openstef-3.4.16/openstef/postprocessing/__init__.py +3 -0
  80. {openstef-3.2.28 → openstef-3.4.16}/openstef/postprocessing/postprocessing.py +10 -23
  81. openstef-3.4.16/openstef/preprocessing/__init__.py +3 -0
  82. openstef-3.4.16/openstef/preprocessing/preprocessing.py +42 -0
  83. openstef-3.4.16/openstef/tasks/__init__.py +3 -0
  84. {openstef-3.2.28 → openstef-3.4.16}/openstef/tasks/calculate_kpi.py +8 -17
  85. {openstef-3.2.28 → openstef-3.4.16}/openstef/tasks/create_basecase_forecast.py +22 -2
  86. {openstef-3.2.28 → openstef-3.4.16}/openstef/tasks/create_components_forecast.py +32 -10
  87. openstef-3.4.16/openstef/tasks/create_forecast.py +137 -0
  88. {openstef-3.2.28 → openstef-3.4.16}/openstef/tasks/create_solar_forecast.py +2 -2
  89. {openstef-3.2.28 → openstef-3.4.16}/openstef/tasks/create_wind_forecast.py +2 -2
  90. {openstef-3.2.28 → openstef-3.4.16}/openstef/tasks/optimize_hyperparameters.py +32 -8
  91. {openstef-3.2.28 → openstef-3.4.16}/openstef/tasks/split_forecast.py +12 -13
  92. openstef-3.4.16/openstef/tasks/train_model.py +193 -0
  93. openstef-3.4.16/openstef/tasks/utils/__init__.py +3 -0
  94. {openstef-3.2.28 → openstef-3.4.16}/openstef/tasks/utils/dependencies.py +5 -5
  95. {openstef-3.2.28 → openstef-3.4.16}/openstef/tasks/utils/predictionjobloop.py +4 -5
  96. {openstef-3.2.28 → openstef-3.4.16}/openstef/tasks/utils/taskcontext.py +4 -4
  97. openstef-3.4.16/openstef/validation/__init__.py +3 -0
  98. openstef-3.4.16/openstef/validation/validation.py +300 -0
  99. {openstef-3.2.28 → openstef-3.4.16}/openstef.egg-info/PKG-INFO +56 -22
  100. {openstef-3.2.28 → openstef-3.4.16}/openstef.egg-info/SOURCES.txt +21 -5
  101. openstef-3.4.16/openstef.egg-info/requires.txt +18 -0
  102. {openstef-3.2.28 → openstef-3.4.16}/pyproject.toml +3 -3
  103. {openstef-3.2.28 → openstef-3.4.16}/setup.py +4 -9
  104. openstef-3.2.28/openstef/__main__.py +0 -51
  105. openstef-3.2.28/openstef/data/dutch_holidays_2020-2022.csv.license +0 -3
  106. openstef-3.2.28/openstef/data/pv_single_coefs.csv.license +0 -3
  107. openstef-3.2.28/openstef/feature_engineering/historic_features.py +0 -40
  108. openstef-3.2.28/openstef/model/metamodels/__init__.py +0 -3
  109. openstef-3.2.28/openstef/model/regressors/__init__.py +0 -3
  110. openstef-3.2.28/openstef/model/regressors/proloaf.py +0 -281
  111. openstef-3.2.28/openstef/model_selection/__init__.py +0 -3
  112. openstef-3.2.28/openstef/monitoring/__init__.py +0 -3
  113. openstef-3.2.28/openstef/pipeline/__init__.py +0 -3
  114. openstef-3.2.28/openstef/postprocessing/__init__.py +0 -3
  115. openstef-3.2.28/openstef/preprocessing/__init__.py +0 -3
  116. openstef-3.2.28/openstef/preprocessing/preprocessing.py +0 -27
  117. openstef-3.2.28/openstef/tasks/__init__.py +0 -3
  118. openstef-3.2.28/openstef/tasks/create_forecast.py +0 -92
  119. openstef-3.2.28/openstef/tasks/run_tracy.py +0 -147
  120. openstef-3.2.28/openstef/tasks/train_model.py +0 -124
  121. openstef-3.2.28/openstef/tasks/utils/__init__.py +0 -3
  122. openstef-3.2.28/openstef/validation/__init__.py +0 -3
  123. openstef-3.2.28/openstef/validation/validation.py +0 -405
  124. openstef-3.2.28/openstef.egg-info/requires.txt +0 -23
  125. {openstef-3.2.28 → openstef-3.4.16}/LICENSE +0 -0
  126. {openstef-3.2.28 → openstef-3.4.16}/openstef/data/dutch_holidays_2020-2022.csv +0 -0
  127. {openstef-3.2.28 → openstef-3.4.16}/openstef/data/pv_single_coefs.csv +0 -0
  128. {openstef-3.2.28 → openstef-3.4.16}/openstef.egg-info/dependency_links.txt +0 -0
  129. {openstef-3.2.28 → openstef-3.4.16}/openstef.egg-info/top_level.txt +0 -0
  130. {openstef-3.2.28 → openstef-3.4.16}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openstef
3
- Version: 3.2.28
3
+ Version: 3.4.16
4
4
  Summary: Open short term energy forecaster
5
5
  Home-page: https://github.com/OpenSTEF/openstef
6
6
  Author: Alliander N.V
@@ -10,17 +10,32 @@ 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.7.0
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: pymsteams~=0.2.2
31
+ Requires-Dist: scikit-learn~=1.3
32
+ Requires-Dist: scipy~=1.10
33
+ Requires-Dist: statsmodels~=0.13.5
34
+ Requires-Dist: structlog<25,>=23.1
35
+ Requires-Dist: xgboost~=2.0
21
36
 
22
37
  <!--
23
- SPDX-FileCopyrightText: 2017-2022 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
38
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
24
39
 
25
40
  SPDX-License-Identifier: MPL-2.0
26
41
  -->
@@ -39,20 +54,37 @@ SPDX-License-Identifier: MPL-2.0
39
54
  [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=sqale_index)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
40
55
  [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
41
56
  [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5585/badge)](https://bestpractices.coreinfrastructure.org/projects/5585)
57
+ [![Downloads](https://static.pepy.tech/badge/openstef)](https://pepy.tech/project/openstef)
58
+ [![Downloads](https://static.pepy.tech/badge/openstef/month)](https://pepy.tech/project/openstef)
42
59
 
43
60
  # OpenSTEF
44
61
 
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
-
47
- Find the latest information on the project on [the project's website](https://www.lfenergy.org/projects/openstef/).
48
-
49
- The `openstef` Python package is available at: https://pypi.org/project/openstef/.
50
-
51
- Documentation is available at: https://openstef.github.io/openstef/index.html.
52
-
53
- You can also watch a [video about OpenSTEF](https://www.lfenergy.org/forecasting-to-create-a-more-resilient-optimized-grid/) instead of reading about the project.
54
-
55
- Want to join the discussion? Join our [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).
62
+ 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.
63
+
64
+ # Table of contents
65
+ - [OpenSTEF](#openstef)
66
+ - [Table of contents](#table-of-contents)
67
+ - [External information sources](#external-information-sources)
68
+ - [Installation](#installation)
69
+ - [Install the openstef package](#install-the-openstef-package)
70
+ - [Remark regarding installation within a **conda environment on Windows**:](#remark-regarding-installation-within-a-conda-environment-on-windows)
71
+ - [Usage](#usage)
72
+ - [Reference Implementation](#reference-implementation)
73
+ - [Openstef-dbc - Database connector for openstef](#openstef-dbc---database-connector-for-openstef)
74
+ - [Example notebooks](#example-notebooks)
75
+ - [License](#license)
76
+ - [Licenses third-party libraries](#licenses-third-party-libraries)
77
+ - [Contributing](#contributing)
78
+ - [Contact](#contact)
79
+
80
+ # External information sources
81
+ - [Documentation website](https://openstef.github.io/openstef/index.html);
82
+ - [Python package](https://pypi.org/project/openstef/);
83
+ - [Project website](https://www.lfenergy.org/projects/openstef/);
84
+ - [Documentation on dashboard](https://raw.githack.com/OpenSTEF/.github/main/profile/html/openstef_dashboard_doc.html);
85
+ - [Linux Foundation project page](https://openstef.github.io/openstef/index.html)
86
+ - [Video about OpenSTEF](https://www.lfenergy.org/forecasting-to-create-a-more-resilient-optimized-grid/);
87
+ - [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
88
 
57
89
  # Installation
58
90
 
@@ -62,10 +94,6 @@ Want to join the discussion? Join our [Teams channel](https://teams.microsoft.co
62
94
  pip install openstef
63
95
  ```
64
96
 
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
97
  ### Remark regarding installation within a **conda environment on Windows**:
70
98
 
71
99
  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:
@@ -86,9 +114,15 @@ python -m openstef task <task_name>
86
114
  A complete implementation including databases, user interface, example data, etc. is available at: https://github.com/OpenSTEF/openstef-reference
87
115
 
88
116
  ![screenshot](https://user-images.githubusercontent.com/60883372/146760483-29af3ac7-62af-4f13-98c7-982a79c517d1.jpg)
89
- Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
117
+ Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
90
118
  Dashboard documentation can be found [here](https://github.com/OpenSTEF/.github/blob/main/profile/README.md).
91
119
 
120
+ ## Openstef-dbc - Database connector for openstef
121
+ This repository provides an interface to OpenSTEF (reference) databases. The repository can be found [here](https://github.com/OpenSTEF/openstef-dbc).
122
+
123
+ ## Example notebooks
124
+ 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).
125
+
92
126
  ## License
93
127
  This project is licensed under the Mozilla Public License, version 2.0 - see LICENSE for details.
94
128
 
@@ -1,5 +1,5 @@
1
1
  <!--
2
- SPDX-FileCopyrightText: 2017-2022 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
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
  -->
@@ -18,20 +18,37 @@ SPDX-License-Identifier: MPL-2.0
18
18
  [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=sqale_index)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
19
19
  [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
20
20
  [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5585/badge)](https://bestpractices.coreinfrastructure.org/projects/5585)
21
+ [![Downloads](https://static.pepy.tech/badge/openstef)](https://pepy.tech/project/openstef)
22
+ [![Downloads](https://static.pepy.tech/badge/openstef/month)](https://pepy.tech/project/openstef)
21
23
 
22
24
  # OpenSTEF
23
25
 
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
-
26
- Find the latest information on the project on [the project's website](https://www.lfenergy.org/projects/openstef/).
27
-
28
- The `openstef` Python package is available at: https://pypi.org/project/openstef/.
29
-
30
- Documentation is available at: https://openstef.github.io/openstef/index.html.
31
-
32
- You can also watch a [video about OpenSTEF](https://www.lfenergy.org/forecasting-to-create-a-more-resilient-optimized-grid/) instead of reading about the project.
33
-
34
- Want to join the discussion? Join our [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).
26
+ 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.
27
+
28
+ # Table of contents
29
+ - [OpenSTEF](#openstef)
30
+ - [Table of contents](#table-of-contents)
31
+ - [External information sources](#external-information-sources)
32
+ - [Installation](#installation)
33
+ - [Install the openstef package](#install-the-openstef-package)
34
+ - [Remark regarding installation within a **conda environment on Windows**:](#remark-regarding-installation-within-a-conda-environment-on-windows)
35
+ - [Usage](#usage)
36
+ - [Reference Implementation](#reference-implementation)
37
+ - [Openstef-dbc - Database connector for openstef](#openstef-dbc---database-connector-for-openstef)
38
+ - [Example notebooks](#example-notebooks)
39
+ - [License](#license)
40
+ - [Licenses third-party libraries](#licenses-third-party-libraries)
41
+ - [Contributing](#contributing)
42
+ - [Contact](#contact)
43
+
44
+ # External information sources
45
+ - [Documentation website](https://openstef.github.io/openstef/index.html);
46
+ - [Python package](https://pypi.org/project/openstef/);
47
+ - [Project website](https://www.lfenergy.org/projects/openstef/);
48
+ - [Documentation on dashboard](https://raw.githack.com/OpenSTEF/.github/main/profile/html/openstef_dashboard_doc.html);
49
+ - [Linux Foundation project page](https://openstef.github.io/openstef/index.html)
50
+ - [Video about OpenSTEF](https://www.lfenergy.org/forecasting-to-create-a-more-resilient-optimized-grid/);
51
+ - [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
52
 
36
53
  # Installation
37
54
 
@@ -41,10 +58,6 @@ Want to join the discussion? Join our [Teams channel](https://teams.microsoft.co
41
58
  pip install openstef
42
59
  ```
43
60
 
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
61
  ### Remark regarding installation within a **conda environment on Windows**:
49
62
 
50
63
  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:
@@ -65,9 +78,15 @@ python -m openstef task <task_name>
65
78
  A complete implementation including databases, user interface, example data, etc. is available at: https://github.com/OpenSTEF/openstef-reference
66
79
 
67
80
  ![screenshot](https://user-images.githubusercontent.com/60883372/146760483-29af3ac7-62af-4f13-98c7-982a79c517d1.jpg)
68
- Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
81
+ Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
69
82
  Dashboard documentation can be found [here](https://github.com/OpenSTEF/.github/blob/main/profile/README.md).
70
83
 
84
+ ## Openstef-dbc - Database connector for openstef
85
+ This repository provides an interface to OpenSTEF (reference) databases. The repository can be found [here](https://github.com/OpenSTEF/openstef-dbc).
86
+
87
+ ## Example notebooks
88
+ 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).
89
+
71
90
  ## License
72
91
  This project is licensed under the Mozilla Public License, version 2.0 - see LICENSE for details.
73
92
 
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: 2017-2022 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
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,3 @@
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
@@ -1,3 +1,3 @@
1
- SPDX-FileCopyrightText: 2017-2022 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
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
@@ -0,0 +1,3 @@
1
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
+
3
+ SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,3 @@
1
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
+
3
+ SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,3 @@
1
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
+
3
+ SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,2 @@
1
+ x^%�;
2
+ �0DS����#U�}� $c��
@@ -0,0 +1,3 @@
1
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
+
3
+ SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,3 @@
1
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
+
3
+ SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,14 @@
1
+ "
2
+ # Model details : dazls_model_test_eval
3
+
4
+ ## Description
5
+ **Model Name**: dazls_model_test_eval
6
+ **Author**: KTP, Alliander
7
+ **Model type**: Energy splitting model
8
+ **Model Architecture**: KNeighestNeighbours
9
+ **Date**: 2024-01-31
10
+
11
+ ## Intended use
12
+ This is a DAZLs model aimed at determining the energy splits for substations.
13
+ Each of these splits are determined based on a set of features that are available in production,
14
+ and in this case have their origin in the Dutch energy grid.
@@ -0,0 +1,3 @@
1
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
+
3
+ SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,3 @@
1
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
+
3
+ SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,3 @@
1
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
+
3
+ SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,3 @@
1
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
+
3
+ SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,3 @@
1
+ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
+
3
+ SPDX-License-Identifier: MPL-2.0
@@ -1,3 +1,3 @@
1
- # SPDX-FileCopyrightText: 2017-2022 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
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-2022 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
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-2022 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
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 List, Optional, Union
5
+ from typing import Optional, Union
6
6
 
7
- from pydantic import BaseModel
7
+ from pydantic.v1 import BaseModel
8
8
 
9
- from .model_specifications import ModelSpecificationDataClass
10
- from .split_function import SplitFuncDataClass
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,60 @@ 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
- - ``"proloaf"`` (extra dependencies requiered, see README)
27
-
28
+
28
29
  If unsure what to pick, choose ``"xgb"``.
29
-
30
+
30
31
  """
31
32
  forecast_type: str
32
33
  """The type of forecasts that should be made.
33
-
34
+
34
35
  Options are:
35
36
  - ``"demand"``
36
37
  - ``"wind"``
37
- - ``"basecase"``
38
-
38
+ - ``"basecase"``
39
+
39
40
  If unsure what to pick, choose ``"demand"``.
40
-
41
+
41
42
  """
42
- horizon_minutes: int
43
- """The horizon of the desired forecast in minutes."""
43
+ horizon_minutes: Optional[int] = 2880
44
+ """The horizon of the desired forecast in minutes used in tasks. Defaults to 2880 minutes (i.e. 2 days)."""
44
45
  resolution_minutes: int
45
46
  """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."""
47
+ lat: Optional[float] = 52.132633
48
+ """Latitude of the forecasted location in degrees. Used for fetching weather data in tasks, calculating derrived features and component splitting."""
49
+ lon: Optional[float] = 5.291266
50
+ """Longitude of the forecasted location in degrees. Used for fetching weather data in tasks, calculating derrived features and component splitting."""
50
51
  name: str
51
52
  """Name of the forecast, e.g. the location name."""
52
53
  train_components: Optional[bool]
53
54
  """Whether splitting the forecasts in wind, solar, rest is desired."""
54
55
  description: Optional[str]
55
56
  """Optional description of the prediction job for human reference."""
56
- quantiles: Optional[List[float]]
57
+ quantiles: Optional[list[float]]
57
58
  """Quantiles that have to be forecasted."""
58
59
  train_split_func: Optional[SplitFuncDataClass]
59
60
  """Optional custom splitting function for operational procces."""
60
61
  backtest_split_func: Optional[SplitFuncDataClass]
61
62
  """Optional custom splitting function for backtesting."""
62
- train_horizons_minutes: Optional[List[int]]
63
+ train_horizons_minutes: Optional[list[int]]
63
64
  """List of horizons that should be taken into account during training."""
64
65
  default_modelspecs: Optional[ModelSpecificationDataClass]
65
66
  """Default model specifications"""
66
67
  save_train_forecasts: bool = False
67
68
  """Indicate wether the forecasts produced during the training process should be saved."""
68
- completeness_treshold: float = 0.5
69
+ completeness_threshold: float = 0.5
69
70
  """Minimum fraction of data that should be available for making a regular forecast."""
70
71
  minimal_table_length: int = 100
71
72
  """Minimum length (in rows) of the forecast input for making a regular forecast."""
72
- flatliner_treshold: int = 24
73
- """Number of consecutive values that have to be constant to detect a flatliner. """
74
- depends_on: Optional[List[Union[int, str]]]
73
+ flatliner_threshold_minutes: int = 1440
74
+ """Number of minutes that the load has to be constant to detect a flatliner. """
75
+ depends_on: Optional[list[Union[int, str]]]
75
76
  """Link to another prediction job on which this prediction job might depend."""
76
77
  sid: Optional[str]
77
78
  """Only required for create_solar_forecast task"""
@@ -81,6 +82,16 @@ class PredictionJobDataClass(BaseModel):
81
82
  """Only required for create_wind_forecast task"""
82
83
  hub_height: Optional[float]
83
84
  """Only required for create_wind_forecast task"""
85
+ pipelines_to_run: list[PipelineType] = [
86
+ PipelineType.TRAIN,
87
+ PipelineType.HYPER_PARMATERS,
88
+ PipelineType.FORECAST,
89
+ ]
90
+ """The pipelines to run for this pj"""
91
+ alternative_forecast_model_pid: Optional[Union[int, str]]
92
+ """The pid that references another prediction job from which the model should be used for making forecasts."""
93
+ data_prep_class: Optional[DataPrepDataClass]
94
+ """The import string for the custom data prep class"""
84
95
 
85
96
  class Config:
86
97
  """Pydantic model configuration.
@@ -1,13 +1,13 @@
1
- # SPDX-FileCopyrightText: 2017-2022 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
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, Dict, Sequence, Tuple, Union
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, Dict[str, Any]
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) -> Dict[str, Any]:
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 (Dict[str, Any]): The additional arguments to be passed to he function
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
- ) -> Tuple[Callable, Dict[str, Any]]:
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 (List[str]): list of arguments the loaded function must have
90
+ required_arguments (list[str]): list of arguments the loaded function must have
91
91
 
92
92
  Returns:
93
93
  - function (Callable)
94
- - arguments (Dict[str, Any])
94
+ - arguments (dict[str, Any])
95
95
 
96
96
  """
97
97
  return self._load_split_function(required_arguments), self._load_arguments()