openstef 3.2.16__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 (138) hide show
  1. {openstef-3.2.16/openstef.egg-info → openstef-3.4.16}/PKG-INFO +62 -14
  2. openstef-3.2.16/PKG-INFO → openstef-3.4.16/README.md +42 -30
  3. {openstef-3.2.16 → 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.4.16/openstef/data/dazls_model_3.4.7/dazls_stored_3.4.7_adaptation_model.z.license +3 -0
  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.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.16/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.16 → openstef-3.4.16}/openstef/data_classes/model_specifications.py +12 -7
  28. openstef-3.4.16/openstef/data_classes/prediction_job.py +122 -0
  29. {openstef-3.2.16 → openstef-3.4.16}/openstef/data_classes/split_function.py +22 -15
  30. {openstef-3.2.16 → openstef-3.4.16}/openstef/enums.py +6 -6
  31. openstef-3.4.16/openstef/exceptions.py +74 -0
  32. {openstef-3.2.16/openstef/data_classes → openstef-3.4.16/openstef/feature_engineering}/__init__.py +1 -1
  33. {openstef-3.2.16 → openstef-3.4.16}/openstef/feature_engineering/apply_features.py +20 -28
  34. openstef-3.4.16/openstef/feature_engineering/data_preparation.py +145 -0
  35. {openstef-3.2.16 → openstef-3.4.16}/openstef/feature_engineering/feature_adder.py +88 -44
  36. {openstef-3.2.16 → openstef-3.4.16}/openstef/feature_engineering/feature_applicator.py +40 -29
  37. {openstef-3.2.16 → openstef-3.4.16}/openstef/feature_engineering/general.py +26 -23
  38. {openstef-3.2.16 → openstef-3.4.16}/openstef/feature_engineering/holiday_features.py +42 -26
  39. {openstef-3.2.16 → openstef-3.4.16}/openstef/feature_engineering/lag_features.py +35 -32
  40. {openstef-3.2.16 → openstef-3.4.16}/openstef/feature_engineering/weather_features.py +91 -73
  41. {openstef-3.2.16/openstef/feature_engineering → openstef-3.4.16/openstef/metrics}/__init__.py +1 -1
  42. {openstef-3.2.16 → openstef-3.4.16}/openstef/metrics/figure.py +102 -38
  43. {openstef-3.2.16 → openstef-3.4.16}/openstef/metrics/metrics.py +139 -77
  44. {openstef-3.2.16 → openstef-3.4.16}/openstef/metrics/reporter.py +58 -11
  45. {openstef-3.2.16/openstef/monitoring → openstef-3.4.16/openstef/model}/__init__.py +1 -1
  46. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/basecase.py +14 -12
  47. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/confidence_interval_applicator.py +39 -36
  48. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/fallback.py +7 -8
  49. openstef-3.4.16/openstef/model/metamodels/__init__.py +3 -0
  50. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/metamodels/grouped_regressor.py +50 -44
  51. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/metamodels/missing_values_handler.py +40 -42
  52. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/model_creator.py +14 -32
  53. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/objective.py +85 -88
  54. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/objective_creator.py +10 -6
  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.16 → openstef-3.4.16}/openstef/model/regressors/custom_regressor.py +11 -19
  58. openstef-3.4.16/openstef/model/regressors/dazls.py +191 -0
  59. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/regressors/lgbm.py +1 -1
  60. openstef-3.4.16/openstef/model/regressors/linear.py +90 -0
  61. openstef-3.4.16/openstef/model/regressors/regressor.py +114 -0
  62. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/regressors/xgb.py +1 -1
  63. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/regressors/xgb_quantile.py +44 -28
  64. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/serializer.py +85 -38
  65. {openstef-3.2.16 → openstef-3.4.16}/openstef/model/standard_deviation_generator.py +21 -9
  66. openstef-3.4.16/openstef/model_selection/__init__.py +3 -0
  67. {openstef-3.2.16 → openstef-3.4.16}/openstef/model_selection/model_selection.py +52 -47
  68. openstef-3.4.16/openstef/monitoring/__init__.py +3 -0
  69. {openstef-3.2.16 → openstef-3.4.16}/openstef/monitoring/performance_meter.py +12 -12
  70. {openstef-3.2.16 → openstef-3.4.16}/openstef/monitoring/teams.py +47 -43
  71. openstef-3.4.16/openstef/pipeline/__init__.py +3 -0
  72. {openstef-3.2.16 → openstef-3.4.16}/openstef/pipeline/create_basecase_forecast.py +38 -18
  73. openstef-3.4.16/openstef/pipeline/create_component_forecast.py +171 -0
  74. {openstef-3.2.16 → openstef-3.4.16}/openstef/pipeline/create_forecast.py +62 -30
  75. {openstef-3.2.16 → openstef-3.4.16}/openstef/pipeline/optimize_hyperparameters.py +90 -57
  76. {openstef-3.2.16 → openstef-3.4.16}/openstef/pipeline/train_create_forecast_backtest.py +51 -33
  77. {openstef-3.2.16 → openstef-3.4.16}/openstef/pipeline/train_model.py +204 -124
  78. {openstef-3.2.16 → openstef-3.4.16}/openstef/pipeline/utils.py +23 -12
  79. openstef-3.4.16/openstef/postprocessing/__init__.py +3 -0
  80. {openstef-3.2.16 → openstef-3.4.16}/openstef/postprocessing/postprocessing.py +52 -50
  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.16 → openstef-3.4.16}/openstef/tasks/calculate_kpi.py +27 -34
  85. {openstef-3.2.16 → openstef-3.4.16}/openstef/tasks/create_basecase_forecast.py +30 -10
  86. {openstef-3.2.16 → openstef-3.4.16}/openstef/tasks/create_components_forecast.py +45 -27
  87. openstef-3.4.16/openstef/tasks/create_forecast.py +137 -0
  88. {openstef-3.2.16 → openstef-3.4.16}/openstef/tasks/create_solar_forecast.py +29 -23
  89. {openstef-3.2.16 → openstef-3.4.16}/openstef/tasks/create_wind_forecast.py +11 -9
  90. {openstef-3.2.16 → openstef-3.4.16}/openstef/tasks/optimize_hyperparameters.py +36 -11
  91. {openstef-3.2.16 → openstef-3.4.16}/openstef/tasks/split_forecast.py +49 -41
  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.16 → openstef-3.4.16}/openstef/tasks/utils/dependencies.py +23 -19
  95. {openstef-3.2.16 → openstef-3.4.16}/openstef/tasks/utils/predictionjobloop.py +53 -56
  96. {openstef-3.2.16 → openstef-3.4.16}/openstef/tasks/utils/taskcontext.py +38 -30
  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.4.16/openstef.egg-info/PKG-INFO +136 -0
  100. {openstef-3.2.16 → openstef-3.4.16}/openstef.egg-info/SOURCES.txt +22 -4
  101. openstef-3.4.16/openstef.egg-info/requires.txt +18 -0
  102. openstef-3.4.16/pyproject.toml +21 -0
  103. {openstef-3.2.16 → openstef-3.4.16}/setup.py +4 -9
  104. openstef-3.2.16/README.md +0 -64
  105. openstef-3.2.16/openstef/__main__.py +0 -51
  106. openstef-3.2.16/openstef/data/dutch_holidays_2020-2022.csv.license +0 -3
  107. openstef-3.2.16/openstef/data/pv_single_coefs.csv.license +0 -3
  108. openstef-3.2.16/openstef/data_classes/prediction_job.py +0 -60
  109. openstef-3.2.16/openstef/exceptions.py +0 -54
  110. openstef-3.2.16/openstef/feature_engineering/historic_features.py +0 -43
  111. openstef-3.2.16/openstef/metrics/__init__.py +0 -0
  112. openstef-3.2.16/openstef/model/metamodels/__init__.py +0 -0
  113. openstef-3.2.16/openstef/model/regressors/__init__.py +0 -0
  114. openstef-3.2.16/openstef/model/regressors/linear.py +0 -85
  115. openstef-3.2.16/openstef/model/regressors/proloaf.py +0 -281
  116. openstef-3.2.16/openstef/model/regressors/regressor.py +0 -55
  117. openstef-3.2.16/openstef/model/regressors/regressor_interface.py +0 -65
  118. openstef-3.2.16/openstef/model_selection/__init__.py +0 -0
  119. openstef-3.2.16/openstef/pipeline/__init__.py +0 -0
  120. openstef-3.2.16/openstef/pipeline/create_component_forecast.py +0 -55
  121. openstef-3.2.16/openstef/postprocessing/__init__.py +0 -3
  122. openstef-3.2.16/openstef/preprocessing/__init__.py +0 -3
  123. openstef-3.2.16/openstef/preprocessing/preprocessing.py +0 -26
  124. openstef-3.2.16/openstef/tasks/__init__.py +0 -3
  125. openstef-3.2.16/openstef/tasks/create_forecast.py +0 -99
  126. openstef-3.2.16/openstef/tasks/run_tracy.py +0 -136
  127. openstef-3.2.16/openstef/tasks/train_model.py +0 -125
  128. openstef-3.2.16/openstef/tasks/utils/__init__.py +0 -3
  129. openstef-3.2.16/openstef/validation/__init__.py +0 -3
  130. openstef-3.2.16/openstef/validation/validation.py +0 -401
  131. openstef-3.2.16/openstef.egg-info/requires.txt +0 -24
  132. openstef-3.2.16/pyproject.toml +0 -12
  133. {openstef-3.2.16 → openstef-3.4.16}/LICENSE +0 -0
  134. {openstef-3.2.16 → openstef-3.4.16}/openstef/data/dutch_holidays_2020-2022.csv +0 -0
  135. {openstef-3.2.16 → openstef-3.4.16}/openstef/data/pv_single_coefs.csv +0 -0
  136. {openstef-3.2.16 → openstef-3.4.16}/openstef.egg-info/dependency_links.txt +0 -0
  137. {openstef-3.2.16 → openstef-3.4.16}/openstef.egg-info/top_level.txt +0 -0
  138. {openstef-3.2.16 → openstef-3.4.16}/setup.cfg +0 -0
@@ -1,27 +1,41 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openstef
3
- Version: 3.2.16
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
7
7
  Author-email: korte.termijn.prognoses@alliander.com
8
8
  License: MPL-2.0
9
9
  Keywords: energy,forecasting,machinelearning
10
- Platform: UNKNOWN
11
10
  Classifier: Development Status :: 5 - Production/Stable
12
11
  Classifier: Intended Audience :: Developers
13
12
  Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
13
  Classifier: Programming Language :: Python :: 3.9
17
14
  Classifier: Programming Language :: Python :: 3.10
18
- Requires-Python: >=3.7.0
15
+ Requires-Python: >=3.9.0
19
16
  Description-Content-Type: text/markdown
20
- Provides-Extra: proloaf
21
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
22
36
 
23
37
  <!--
24
- 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>
25
39
 
26
40
  SPDX-License-Identifier: MPL-2.0
27
41
  -->
@@ -40,10 +54,37 @@ SPDX-License-Identifier: MPL-2.0
40
54
  [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=sqale_index)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
41
55
  [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
42
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)
43
59
 
44
60
  # OpenSTEF
45
61
 
46
- 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. `openstef` is available at: https://pypi.org/project/openstef/
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)
47
88
 
48
89
  # Installation
49
90
 
@@ -53,10 +94,13 @@ OpenSTEF is a Python package which is used to make short term forecasts for the
53
94
  pip install openstef
54
95
  ```
55
96
 
56
- _**Optional**_: if you would like to use the proloaf model with OpenSTEF install the proloaf dependencies by running:
97
+ ### Remark regarding installation within a **conda environment on Windows**:
98
+
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:
57
100
  ```shell
58
- pip install openstef[proloaf]
101
+ pip install pywin32==300
59
102
  ```
103
+ For more information on this issue see the [readme of pywin32](https://github.com/mhammond/pywin32#installing-via-pip) or [this Github issue](https://github.com/mhammond/pywin32/issues/1865#issue-1212752696).
60
104
 
61
105
  # Usage
62
106
 
@@ -70,9 +114,15 @@ python -m openstef task <task_name>
70
114
  A complete implementation including databases, user interface, example data, etc. is available at: https://github.com/OpenSTEF/openstef-reference
71
115
 
72
116
  ![screenshot](https://user-images.githubusercontent.com/60883372/146760483-29af3ac7-62af-4f13-98c7-982a79c517d1.jpg)
73
- Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
117
+ Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
74
118
  Dashboard documentation can be found [here](https://github.com/OpenSTEF/.github/blob/main/profile/README.md).
75
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
+
76
126
  ## License
77
127
  This project is licensed under the Mozilla Public License, version 2.0 - see LICENSE for details.
78
128
 
@@ -80,9 +130,7 @@ This project is licensed under the Mozilla Public License, version 2.0 - see LIC
80
130
  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.
81
131
 
82
132
  ## Contributing
83
- 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_GOVERNANACE.md](https://github.com/OpenSTEF/.github/blob/main/PROJECT_GOVERNANCE.md) for details on the process for submitting pull requests to us.
133
+ 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.
84
134
 
85
135
  ## Contact
86
136
  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
87
-
88
-
@@ -1,27 +1,5 @@
1
- Metadata-Version: 2.1
2
- Name: openstef
3
- Version: 3.2.16
4
- Summary: Open short term energy forecaster
5
- Home-page: https://github.com/OpenSTEF/openstef
6
- Author: Alliander N.V
7
- Author-email: korte.termijn.prognoses@alliander.com
8
- License: MPL-2.0
9
- Keywords: energy,forecasting,machinelearning
10
- Platform: UNKNOWN
11
- Classifier: Development Status :: 5 - Production/Stable
12
- Classifier: Intended Audience :: Developers
13
- Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Requires-Python: >=3.7.0
19
- Description-Content-Type: text/markdown
20
- Provides-Extra: proloaf
21
- License-File: LICENSE
22
-
23
1
  <!--
24
- 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>
25
3
 
26
4
  SPDX-License-Identifier: MPL-2.0
27
5
  -->
@@ -40,10 +18,37 @@ SPDX-License-Identifier: MPL-2.0
40
18
  [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=sqale_index)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
41
19
  [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
42
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)
43
23
 
44
24
  # OpenSTEF
45
25
 
46
- 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. `openstef` is available at: https://pypi.org/project/openstef/
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)
47
52
 
48
53
  # Installation
49
54
 
@@ -53,10 +58,13 @@ OpenSTEF is a Python package which is used to make short term forecasts for the
53
58
  pip install openstef
54
59
  ```
55
60
 
56
- _**Optional**_: if you would like to use the proloaf model with OpenSTEF install the proloaf dependencies by running:
61
+ ### Remark regarding installation within a **conda environment on Windows**:
62
+
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:
57
64
  ```shell
58
- pip install openstef[proloaf]
65
+ pip install pywin32==300
59
66
  ```
67
+ For more information on this issue see the [readme of pywin32](https://github.com/mhammond/pywin32#installing-via-pip) or [this Github issue](https://github.com/mhammond/pywin32/issues/1865#issue-1212752696).
60
68
 
61
69
  # Usage
62
70
 
@@ -70,9 +78,15 @@ python -m openstef task <task_name>
70
78
  A complete implementation including databases, user interface, example data, etc. is available at: https://github.com/OpenSTEF/openstef-reference
71
79
 
72
80
  ![screenshot](https://user-images.githubusercontent.com/60883372/146760483-29af3ac7-62af-4f13-98c7-982a79c517d1.jpg)
73
- Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
81
+ Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
74
82
  Dashboard documentation can be found [here](https://github.com/OpenSTEF/.github/blob/main/profile/README.md).
75
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
+
76
90
  ## License
77
91
  This project is licensed under the Mozilla Public License, version 2.0 - see LICENSE for details.
78
92
 
@@ -80,9 +94,7 @@ This project is licensed under the Mozilla Public License, version 2.0 - see LIC
80
94
  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.
81
95
 
82
96
  ## Contributing
83
- 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_GOVERNANACE.md](https://github.com/OpenSTEF/.github/blob/main/PROJECT_GOVERNANCE.md) for details on the process for submitting pull requests to us.
97
+ 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.
84
98
 
85
99
  ## Contact
86
100
  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
87
-
88
-
@@ -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
@@ -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,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,24 +1,29 @@
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):
11
+ """Holds all information regarding the training procces of a specific model."""
12
+
11
13
  id: Union[int, str]
12
14
  hyper_params: Optional[dict] = {}
15
+ """Hyperparameters that should be used during training."""
13
16
  feature_names: Optional[list] = None
17
+ """Features that should be used during training."""
14
18
  feature_modules: Optional[list] = []
19
+ """Feature modules that should be used during training."""
15
20
 
16
- def __getitem__(self, item):
17
- """Allows us to use subscription to get the items from the object"""
21
+ def __getitem__(self, item: str) -> any:
22
+ """Allows us to use subscription to get the items from the object."""
18
23
  return getattr(self, item)
19
24
 
20
- def __setitem__(self, key: str, value: any):
21
- """Allows us to use subscription to set the items in the object"""
25
+ def __setitem__(self, key: str, value: any) -> None:
26
+ """Allows us to use subscription to set the items in the object."""
22
27
  if hasattr(self, key):
23
28
  self.__dict__[key] = value
24
29
  else:
@@ -0,0 +1,122 @@
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
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
+
29
+ If unsure what to pick, choose ``"xgb"``.
30
+
31
+ """
32
+ forecast_type: str
33
+ """The type of forecasts that should be made.
34
+
35
+ Options are:
36
+ - ``"demand"``
37
+ - ``"wind"``
38
+ - ``"basecase"``
39
+
40
+ If unsure what to pick, choose ``"demand"``.
41
+
42
+ """
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)."""
45
+ resolution_minutes: int
46
+ """The resolution of the desired forecast in minutes."""
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."""
51
+ name: str
52
+ """Name of the forecast, e.g. the location name."""
53
+ train_components: Optional[bool]
54
+ """Whether splitting the forecasts in wind, solar, rest is desired."""
55
+ description: Optional[str]
56
+ """Optional description of the prediction job for human reference."""
57
+ quantiles: Optional[list[float]]
58
+ """Quantiles that have to be forecasted."""
59
+ train_split_func: Optional[SplitFuncDataClass]
60
+ """Optional custom splitting function for operational procces."""
61
+ backtest_split_func: Optional[SplitFuncDataClass]
62
+ """Optional custom splitting function for backtesting."""
63
+ train_horizons_minutes: Optional[list[int]]
64
+ """List of horizons that should be taken into account during training."""
65
+ default_modelspecs: Optional[ModelSpecificationDataClass]
66
+ """Default model specifications"""
67
+ save_train_forecasts: bool = False
68
+ """Indicate wether the forecasts produced during the training process should be saved."""
69
+ completeness_threshold: float = 0.5
70
+ """Minimum fraction of data that should be available for making a regular forecast."""
71
+ minimal_table_length: int = 100
72
+ """Minimum length (in rows) of the forecast input for making a regular forecast."""
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]]]
76
+ """Link to another prediction job on which this prediction job might depend."""
77
+ sid: Optional[str]
78
+ """Only required for create_solar_forecast task"""
79
+ turbine_type: Optional[str]
80
+ """Only required for create_wind_forecast task"""
81
+ n_turbines: Optional[float]
82
+ """Only required for create_wind_forecast task"""
83
+ hub_height: Optional[float]
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"""
95
+
96
+ class Config:
97
+ """Pydantic model configuration.
98
+
99
+ This following configuration is needed to prevent ids in "depends_on" to be converted from int to str when we
100
+ use integer ids.
101
+
102
+ """
103
+
104
+ smart_union = True
105
+
106
+ def __getitem__(self, item: str) -> any:
107
+ """Allows us to use subscription to get the items from the object."""
108
+ return getattr(self, item)
109
+
110
+ def __setitem__(self, key: str, value: any) -> None:
111
+ """Allows us to use subscription to set the items in the object."""
112
+ if hasattr(self, key):
113
+ self.__dict__[key] = value
114
+ else:
115
+ raise AttributeError(f"{key} not an attribute of prediction job.")
116
+
117
+ def get(self, key: str, default: any = None) -> any:
118
+ """Allows to use the get functions similar to a python dict."""
119
+ if hasattr(self, key):
120
+ return getattr(self, key)
121
+ else:
122
+ return default