openstef 3.4.62__tar.gz → 3.4.64__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 (110) hide show
  1. {openstef-3.4.62 → openstef-3.4.64}/PKG-INFO +35 -6
  2. {openstef-3.4.62 → openstef-3.4.64}/README.md +28 -4
  3. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/gblinear_quantile.py +1 -1
  4. openstef-3.4.64/openstef/plotting/__init__.py +3 -0
  5. openstef-3.4.64/openstef/plotting/load_forecast_plotter.py +216 -0
  6. {openstef-3.4.62 → openstef-3.4.64}/openstef.egg-info/PKG-INFO +35 -6
  7. {openstef-3.4.62 → openstef-3.4.64}/openstef.egg-info/SOURCES.txt +2 -0
  8. {openstef-3.4.62 → openstef-3.4.64}/openstef.egg-info/requires.txt +8 -0
  9. {openstef-3.4.62 → openstef-3.4.64}/setup.py +11 -1
  10. {openstef-3.4.62 → openstef-3.4.64}/LICENSE +0 -0
  11. {openstef-3.4.62 → openstef-3.4.64}/openstef/__init__.py +0 -0
  12. {openstef-3.4.62 → openstef-3.4.64}/openstef/__main__.py +0 -0
  13. {openstef-3.4.62 → openstef-3.4.64}/openstef/app_settings.py +0 -0
  14. {openstef-3.4.62 → openstef-3.4.64}/openstef/data/NL_terrestrial_radiation.csv +0 -0
  15. {openstef-3.4.62 → openstef-3.4.64}/openstef/data/NL_terrestrial_radiation.csv.license +0 -0
  16. {openstef-3.4.62 → openstef-3.4.64}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z +0 -0
  17. {openstef-3.4.62 → openstef-3.4.64}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z.license +0 -0
  18. {openstef-3.4.62 → openstef-3.4.64}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_model_card.md +0 -0
  19. {openstef-3.4.62 → openstef-3.4.64}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_model_card.md.license +0 -0
  20. {openstef-3.4.62 → openstef-3.4.64}/openstef/data/dutch_holidays.csv +0 -0
  21. {openstef-3.4.62 → openstef-3.4.64}/openstef/data/dutch_holidays.csv.license +0 -0
  22. {openstef-3.4.62 → openstef-3.4.64}/openstef/data/pv_single_coefs.csv +0 -0
  23. {openstef-3.4.62 → openstef-3.4.64}/openstef/data/pv_single_coefs.csv.license +0 -0
  24. {openstef-3.4.62 → openstef-3.4.64}/openstef/data_classes/__init__.py +0 -0
  25. {openstef-3.4.62 → openstef-3.4.64}/openstef/data_classes/data_prep.py +0 -0
  26. {openstef-3.4.62 → openstef-3.4.64}/openstef/data_classes/model_specifications.py +0 -0
  27. {openstef-3.4.62 → openstef-3.4.64}/openstef/data_classes/prediction_job.py +0 -0
  28. {openstef-3.4.62 → openstef-3.4.64}/openstef/data_classes/split_function.py +0 -0
  29. {openstef-3.4.62 → openstef-3.4.64}/openstef/enums.py +0 -0
  30. {openstef-3.4.62 → openstef-3.4.64}/openstef/exceptions.py +0 -0
  31. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/__init__.py +0 -0
  32. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/apply_features.py +0 -0
  33. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/bidding_zone_to_country_mapping.py +0 -0
  34. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/cyclic_features.py +0 -0
  35. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/data_preparation.py +0 -0
  36. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/feature_adder.py +0 -0
  37. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/feature_applicator.py +0 -0
  38. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/general.py +0 -0
  39. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/holiday_features.py +0 -0
  40. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/lag_features.py +0 -0
  41. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/missing_values_transformer.py +0 -0
  42. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/rolling_features.py +0 -0
  43. {openstef-3.4.62 → openstef-3.4.64}/openstef/feature_engineering/weather_features.py +0 -0
  44. {openstef-3.4.62 → openstef-3.4.64}/openstef/metrics/__init__.py +0 -0
  45. {openstef-3.4.62 → openstef-3.4.64}/openstef/metrics/figure.py +0 -0
  46. {openstef-3.4.62 → openstef-3.4.64}/openstef/metrics/metrics.py +0 -0
  47. {openstef-3.4.62 → openstef-3.4.64}/openstef/metrics/reporter.py +0 -0
  48. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/__init__.py +0 -0
  49. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/basecase.py +0 -0
  50. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/confidence_interval_applicator.py +0 -0
  51. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/fallback.py +0 -0
  52. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/metamodels/__init__.py +0 -0
  53. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/metamodels/feature_clipper.py +0 -0
  54. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/metamodels/grouped_regressor.py +0 -0
  55. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/metamodels/missing_values_handler.py +0 -0
  56. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/model_creator.py +0 -0
  57. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/objective.py +0 -0
  58. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/objective_creator.py +0 -0
  59. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/__init__.py +0 -0
  60. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/arima.py +0 -0
  61. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/custom_regressor.py +0 -0
  62. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/dazls.py +0 -0
  63. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/flatliner.py +0 -0
  64. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/lgbm.py +0 -0
  65. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/linear.py +0 -0
  66. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/linear_quantile.py +0 -0
  67. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/regressor.py +0 -0
  68. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/xgb.py +0 -0
  69. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/xgb_multioutput_quantile.py +0 -0
  70. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/regressors/xgb_quantile.py +0 -0
  71. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/serializer.py +0 -0
  72. {openstef-3.4.62 → openstef-3.4.64}/openstef/model/standard_deviation_generator.py +0 -0
  73. {openstef-3.4.62 → openstef-3.4.64}/openstef/model_selection/__init__.py +0 -0
  74. {openstef-3.4.62 → openstef-3.4.64}/openstef/model_selection/model_selection.py +0 -0
  75. {openstef-3.4.62 → openstef-3.4.64}/openstef/monitoring/__init__.py +0 -0
  76. {openstef-3.4.62 → openstef-3.4.64}/openstef/monitoring/performance_meter.py +0 -0
  77. {openstef-3.4.62 → openstef-3.4.64}/openstef/monitoring/teams.py +0 -0
  78. {openstef-3.4.62 → openstef-3.4.64}/openstef/pipeline/__init__.py +0 -0
  79. {openstef-3.4.62 → openstef-3.4.64}/openstef/pipeline/create_basecase_forecast.py +0 -0
  80. {openstef-3.4.62 → openstef-3.4.64}/openstef/pipeline/create_component_forecast.py +0 -0
  81. {openstef-3.4.62 → openstef-3.4.64}/openstef/pipeline/create_forecast.py +0 -0
  82. {openstef-3.4.62 → openstef-3.4.64}/openstef/pipeline/optimize_hyperparameters.py +0 -0
  83. {openstef-3.4.62 → openstef-3.4.64}/openstef/pipeline/train_create_forecast_backtest.py +0 -0
  84. {openstef-3.4.62 → openstef-3.4.64}/openstef/pipeline/train_model.py +0 -0
  85. {openstef-3.4.62 → openstef-3.4.64}/openstef/pipeline/utils.py +0 -0
  86. {openstef-3.4.62 → openstef-3.4.64}/openstef/postprocessing/__init__.py +0 -0
  87. {openstef-3.4.62 → openstef-3.4.64}/openstef/postprocessing/postprocessing.py +0 -0
  88. {openstef-3.4.62 → openstef-3.4.64}/openstef/preprocessing/__init__.py +0 -0
  89. {openstef-3.4.62 → openstef-3.4.64}/openstef/preprocessing/preprocessing.py +0 -0
  90. {openstef-3.4.62 → openstef-3.4.64}/openstef/settings.py +0 -0
  91. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/__init__.py +0 -0
  92. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/calculate_kpi.py +0 -0
  93. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/create_basecase_forecast.py +0 -0
  94. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/create_components_forecast.py +0 -0
  95. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/create_forecast.py +0 -0
  96. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/create_solar_forecast.py +0 -0
  97. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/create_wind_forecast.py +0 -0
  98. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/optimize_hyperparameters.py +0 -0
  99. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/split_forecast.py +0 -0
  100. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/train_model.py +0 -0
  101. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/utils/__init__.py +0 -0
  102. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/utils/dependencies.py +0 -0
  103. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/utils/predictionjobloop.py +0 -0
  104. {openstef-3.4.62 → openstef-3.4.64}/openstef/tasks/utils/taskcontext.py +0 -0
  105. {openstef-3.4.62 → openstef-3.4.64}/openstef/validation/__init__.py +0 -0
  106. {openstef-3.4.62 → openstef-3.4.64}/openstef/validation/validation.py +0 -0
  107. {openstef-3.4.62 → openstef-3.4.64}/openstef.egg-info/dependency_links.txt +0 -0
  108. {openstef-3.4.62 → openstef-3.4.64}/openstef.egg-info/top_level.txt +0 -0
  109. {openstef-3.4.62 → openstef-3.4.64}/pyproject.toml +0 -0
  110. {openstef-3.4.62 → openstef-3.4.64}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: openstef
3
- Version: 3.4.62
3
+ Version: 3.4.64
4
4
  Summary: Open short term energy forecaster
5
5
  Home-page: https://github.com/OpenSTEF/openstef
6
6
  Author: Alliander N.V
@@ -33,7 +33,11 @@ Requires-Dist: scikit-learn<1.6,>=1.3
33
33
  Requires-Dist: scipy~=1.10
34
34
  Requires-Dist: statsmodels<1.0.0,>=0.13.5
35
35
  Requires-Dist: structlog<25,>=23.1
36
- Requires-Dist: xgboost~=2.0
36
+ Requires-Dist: xgboost~=2.0; extra == "gpu"
37
+ Provides-Extra: cpu
38
+ Requires-Dist: xgboost-cpu~=2.0; extra == "cpu"
39
+ Provides-Extra: gpu
40
+ Requires-Dist: xgboost; extra == "gpu"
37
41
  Dynamic: author
38
42
  Dynamic: author-email
39
43
  Dynamic: classifier
@@ -42,6 +46,7 @@ Dynamic: description-content-type
42
46
  Dynamic: home-page
43
47
  Dynamic: keywords
44
48
  Dynamic: license
49
+ Dynamic: provides-extra
45
50
  Dynamic: requires-dist
46
51
  Dynamic: requires-python
47
52
  Dynamic: summary
@@ -53,11 +58,15 @@ SPDX-License-Identifier: MPL-2.0
53
58
  -->
54
59
 
55
60
  # OpenSTEF
61
+
56
62
  <!-- Badges -->
63
+
57
64
  [![Downloads](https://static.pepy.tech/badge/openstef)](https://pepy.tech/project/openstef)
58
65
  [![Downloads](https://static.pepy.tech/badge/openstef/month)](https://pepy.tech/project/openstef)
59
66
  [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5585/badge)](https://bestpractices.coreinfrastructure.org/projects/5585)
67
+
60
68
  <!-- SonarCloud badges -->
69
+
61
70
  [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=bugs)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
62
71
  [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=code_smells)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
63
72
  [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=coverage)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
@@ -71,19 +80,21 @@ SPDX-License-Identifier: MPL-2.0
71
80
  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.
72
81
 
73
82
  # Table of contents
83
+
74
84
  - [OpenSTEF](#openstef)
75
85
  - [Table of contents](#table-of-contents)
76
86
  - [External information sources](#external-information-sources)
77
87
  - [Installation](#installation)
78
88
  - [Usage](#usage)
79
- - [Example notebooks](#example-notebooks)
80
- - [Reference Implementation](#reference-implementation)
81
- - [Database connector for OpenSTEF](#database-connector-for-openstef)
89
+ - [Example notebooks](#example-notebooks)
90
+ - [Reference Implementation](#reference-implementation)
91
+ - [Database connector for OpenSTEF](#database-connector-for-openstef)
82
92
  - [License](license)
83
93
  - [Contributing](#contributing)
84
94
  - [Contact](#contact)
85
95
 
86
96
  # External information sources
97
+
87
98
  - [Documentation website](https://openstef.github.io/openstef/index.html);
88
99
  - [Python package](https://pypi.org/project/openstef/);
89
100
  - [Linux Foundation project page](https://www.lfenergy.org/projects/openstef/);
@@ -101,9 +112,11 @@ pip install openstef
101
112
  ### Remark regarding installation within a **conda environment on Windows**
102
113
 
103
114
  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:
115
+
104
116
  ```shell
105
117
  pip install pywin32==300
106
118
  ```
119
+
107
120
  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).
108
121
 
109
122
  ## Remark regarding installation on Apple Silicon
@@ -112,19 +125,31 @@ If you want to install the `openstef` package on Apple Silicon (Mac with M1-chip
112
125
 
113
126
  1. Run `brew install libomp` (if you haven’t installed Homebrew: [follow instructions here](https://brew.sh/))
114
127
  2. If your interpreter can not find the `libomp` installation in `/usr/local/bin`, it is probably in `/opt/brew/Cellar`. Run:
128
+
115
129
  ```sh
116
130
  mkdir -p /usr/local/opt/libomp/
117
131
  ln -s /opt/brew/Cellar/libomp/{your_version}/lib /usr/local/opt/libomp/lib
118
132
  ```
133
+
119
134
  3. Uninstall `xgboost` with `pip` (`pip uninstall xgboost`) and install with `conda-forge` (`conda install -c conda-forge xgboost`)
120
135
  4. If you encounter similar issues with `lightgbm`: uninstall `lightgbm` with `pip` (`pip uninstall lightgbm`) and install later version with `conda-forge` (`conda install -c conda-forge 'lightgbm>=4.2.0'`)
121
136
 
137
+ ### Remark regarding installation with minimal XGBoost dependency
138
+
139
+ It is possible to install openSTEF with a minimal XGBoost (CPU-only) package. This only works on x86_64 (amd64) Linux and Windows platforms. Advantage is that significantly smaller dependencies are installed. In that case run:
140
+
141
+ ```shell
142
+ pip install openstef[cpu]
143
+ ```
144
+
122
145
  # Usage
123
146
 
124
147
  ## Example notebooks
148
+
125
149
  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).
126
150
 
127
151
  ## Reference Implementation
152
+
128
153
  A complete implementation including databases, user interface, example data, etc. is available at: https://github.com/OpenSTEF/openstef-reference
129
154
 
130
155
  ![screenshot](https://user-images.githubusercontent.com/60883372/146760483-29af3ac7-62af-4f13-98c7-982a79c517d1.jpg)
@@ -138,17 +163,21 @@ python -m openstef task <task_name>
138
163
  ```
139
164
 
140
165
  ## Database connector for openstef
166
+
141
167
  This repository provides an interface to OpenSTEF (reference) databases. The repository can be found [here](https://github.com/OpenSTEF/openstef-dbc).
142
168
 
143
169
  # License
170
+
144
171
  This project is licensed under the Mozilla Public License, version 2.0 - see LICENSE for details.
145
172
 
146
173
  ## Licenses third-party libraries
174
+
147
175
  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.
148
176
 
149
177
  # Contributing
178
+
150
179
  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.
151
180
 
152
181
  # Contact
182
+
153
183
  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
154
-
@@ -5,11 +5,15 @@ SPDX-License-Identifier: MPL-2.0
5
5
  -->
6
6
 
7
7
  # OpenSTEF
8
+
8
9
  <!-- Badges -->
10
+
9
11
  [![Downloads](https://static.pepy.tech/badge/openstef)](https://pepy.tech/project/openstef)
10
12
  [![Downloads](https://static.pepy.tech/badge/openstef/month)](https://pepy.tech/project/openstef)
11
13
  [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5585/badge)](https://bestpractices.coreinfrastructure.org/projects/5585)
14
+
12
15
  <!-- SonarCloud badges -->
16
+
13
17
  [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=bugs)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
14
18
  [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=code_smells)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
15
19
  [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=coverage)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
@@ -23,19 +27,21 @@ SPDX-License-Identifier: MPL-2.0
23
27
  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
28
 
25
29
  # Table of contents
30
+
26
31
  - [OpenSTEF](#openstef)
27
32
  - [Table of contents](#table-of-contents)
28
33
  - [External information sources](#external-information-sources)
29
34
  - [Installation](#installation)
30
35
  - [Usage](#usage)
31
- - [Example notebooks](#example-notebooks)
32
- - [Reference Implementation](#reference-implementation)
33
- - [Database connector for OpenSTEF](#database-connector-for-openstef)
36
+ - [Example notebooks](#example-notebooks)
37
+ - [Reference Implementation](#reference-implementation)
38
+ - [Database connector for OpenSTEF](#database-connector-for-openstef)
34
39
  - [License](license)
35
40
  - [Contributing](#contributing)
36
41
  - [Contact](#contact)
37
42
 
38
43
  # External information sources
44
+
39
45
  - [Documentation website](https://openstef.github.io/openstef/index.html);
40
46
  - [Python package](https://pypi.org/project/openstef/);
41
47
  - [Linux Foundation project page](https://www.lfenergy.org/projects/openstef/);
@@ -53,9 +59,11 @@ pip install openstef
53
59
  ### Remark regarding installation within a **conda environment on Windows**
54
60
 
55
61
  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:
62
+
56
63
  ```shell
57
64
  pip install pywin32==300
58
65
  ```
66
+
59
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
  ## Remark regarding installation on Apple Silicon
@@ -64,19 +72,31 @@ If you want to install the `openstef` package on Apple Silicon (Mac with M1-chip
64
72
 
65
73
  1. Run `brew install libomp` (if you haven’t installed Homebrew: [follow instructions here](https://brew.sh/))
66
74
  2. If your interpreter can not find the `libomp` installation in `/usr/local/bin`, it is probably in `/opt/brew/Cellar`. Run:
75
+
67
76
  ```sh
68
77
  mkdir -p /usr/local/opt/libomp/
69
78
  ln -s /opt/brew/Cellar/libomp/{your_version}/lib /usr/local/opt/libomp/lib
70
79
  ```
80
+
71
81
  3. Uninstall `xgboost` with `pip` (`pip uninstall xgboost`) and install with `conda-forge` (`conda install -c conda-forge xgboost`)
72
82
  4. If you encounter similar issues with `lightgbm`: uninstall `lightgbm` with `pip` (`pip uninstall lightgbm`) and install later version with `conda-forge` (`conda install -c conda-forge 'lightgbm>=4.2.0'`)
73
83
 
84
+ ### Remark regarding installation with minimal XGBoost dependency
85
+
86
+ It is possible to install openSTEF with a minimal XGBoost (CPU-only) package. This only works on x86_64 (amd64) Linux and Windows platforms. Advantage is that significantly smaller dependencies are installed. In that case run:
87
+
88
+ ```shell
89
+ pip install openstef[cpu]
90
+ ```
91
+
74
92
  # Usage
75
93
 
76
94
  ## Example notebooks
95
+
77
96
  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).
78
97
 
79
98
  ## Reference Implementation
99
+
80
100
  A complete implementation including databases, user interface, example data, etc. is available at: https://github.com/OpenSTEF/openstef-reference
81
101
 
82
102
  ![screenshot](https://user-images.githubusercontent.com/60883372/146760483-29af3ac7-62af-4f13-98c7-982a79c517d1.jpg)
@@ -90,17 +110,21 @@ python -m openstef task <task_name>
90
110
  ```
91
111
 
92
112
  ## Database connector for openstef
113
+
93
114
  This repository provides an interface to OpenSTEF (reference) databases. The repository can be found [here](https://github.com/OpenSTEF/openstef-dbc).
94
115
 
95
116
  # License
117
+
96
118
  This project is licensed under the Mozilla Public License, version 2.0 - see LICENSE for details.
97
119
 
98
120
  ## Licenses third-party libraries
121
+
99
122
  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.
100
123
 
101
124
  # Contributing
125
+
102
126
  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.
103
127
 
104
128
  # Contact
129
+
105
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
106
-
@@ -306,7 +306,7 @@ class GBLinearQuantileOpenstfRegressor(OpenstfRegressor):
306
306
  feature_names = booster.feature_names
307
307
 
308
308
  # Get importance
309
- feature_importance = [score.get(f, 0.0) for f in feature_names]
309
+ feature_importance = [np.abs(score.get(f, 0.0)) for f in feature_names]
310
310
  # Convert to array
311
311
  features_importance_array = np.array(feature_importance, dtype=np.float32)
312
312
 
@@ -0,0 +1,3 @@
1
+ # SPDX-FileCopyrightText: 2017-2025 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
2
+ #
3
+ # SPDX-License-Identifier: MPL-2.0
@@ -0,0 +1,216 @@
1
+ # SPDX-FileCopyrightText: 2017-2025 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
2
+ #
3
+ # SPDX-License-Identifier: MPL-2.0
4
+
5
+ from typing import Tuple, Optional
6
+
7
+ import numpy as np
8
+ from pydantic import BaseModel
9
+ import pandas as pd
10
+ import plotly.graph_objects as go
11
+ import plotly.express as px
12
+
13
+
14
+ class LoadForecastPlotter(BaseModel):
15
+ colormap: str = "Blues"
16
+ colormap_range: Tuple[float, float] = (0.2, 0.8)
17
+
18
+ fill_opacity: float = 0.5
19
+ stroke_opacity: float = 0.8
20
+ stroke_width: float = 1.5
21
+
22
+ def _get_color_by_value(self, value: float) -> str:
23
+ """Maps a normalized value to a color using the specified colormap.
24
+
25
+ Args:
26
+ value (float): A value between 0 and 1 to be mapped to a color.
27
+
28
+ Returns:
29
+ str: A color in the rgba format.
30
+ """
31
+ rescaled = self.colormap_range[0] + value * (
32
+ self.colormap_range[1] - self.colormap_range[0]
33
+ )
34
+ rescaled = min(1.0, max(0.0, rescaled))
35
+
36
+ return px.colors.sample_colorscale(
37
+ colorscale=self.colormap, samplepoints=[rescaled]
38
+ )[0]
39
+
40
+ def _get_quantile_colors(self, quantile: float) -> Tuple[str, str]:
41
+ """Generate fill and stroke colors for a given quantile using a colorscale.
42
+
43
+ Colors are determined based on the distance from the median (50th percentile).
44
+
45
+ Args:
46
+ quantile (float): The quantile value (0-100) to generate colors for.
47
+
48
+ Returns:
49
+ Tuple[str, str]: A tuple containing (fill_color, stroke_color).
50
+ """
51
+ fill_value = 1 - abs(quantile - 50.0) / 50.0
52
+ stroke_value = 1 - abs(quantile + 5.0 - 50.0) / 50.0
53
+ return (
54
+ self._get_color_by_value(fill_value),
55
+ self._get_color_by_value(stroke_value),
56
+ )
57
+
58
+ def _add_quantile_band(
59
+ self,
60
+ figure: go.Figure,
61
+ lower_quantile_data: pd.Series,
62
+ lower_quantile: float,
63
+ upper_quantile_data: pd.Series,
64
+ upper_quantile: float,
65
+ ):
66
+ """Add a quantile band to the plotly figure.
67
+
68
+ Creates a filled polygon representing the area between lower and upper quantiles,
69
+ and adds it to the provided figure along with hover information.
70
+
71
+ Args:
72
+ figure (go.Figure): The plotly figure to add the quantile band to.
73
+ lower_quantile_data (pd.Series): Series with data for the lower quantile.
74
+ lower_quantile (float): The percentile value of the lower quantile.
75
+ upper_quantile_data (pd.Series): Series with data for the upper quantile.
76
+ upper_quantile (float): The percentile value of the upper quantile.
77
+
78
+ Returns:
79
+ None: The figure is modified in place.
80
+ """
81
+ # Create polygon shape for the quantile band in counterclockwise order
82
+ x = list(lower_quantile_data.index) + list(upper_quantile_data.index[::-1])
83
+ y = list(lower_quantile_data) + list(upper_quantile_data[::-1])
84
+
85
+ # Get colors for the band
86
+ fill_color, stroke_color = self._get_quantile_colors(lower_quantile)
87
+
88
+ # Group traces by quantile range
89
+ legendgroup = f"quantile_{lower_quantile}_{upper_quantile}"
90
+
91
+ # Add a single trace that forms a filled polygon
92
+ figure.add_trace(
93
+ go.Scatter(
94
+ x=x,
95
+ y=y,
96
+ fill="toself",
97
+ fillcolor=f"rgba{fill_color[3:-1]}, {self.fill_opacity})",
98
+ line=dict(
99
+ color=f"rgba{stroke_color[3:-1]}, {self.stroke_opacity})",
100
+ width=self.stroke_width,
101
+ ),
102
+ name=f"{lower_quantile}%-{upper_quantile}%",
103
+ showlegend=True,
104
+ hoverinfo="skip",
105
+ legendgroup=legendgroup,
106
+ )
107
+ )
108
+
109
+ # Add an (invisible) line around the filled area to make quantile
110
+ # values selectable/hover-able.
111
+ # Hovering on filled area values is not supported by plotly.
112
+ figure.add_trace(
113
+ go.Scatter(
114
+ x=lower_quantile_data.index,
115
+ y=lower_quantile_data.values,
116
+ mode="lines",
117
+ line=dict(
118
+ width=self.stroke_width,
119
+ color=f"rgba{stroke_color[3:-1]}, {self.stroke_opacity})",
120
+ ),
121
+ customdata=np.column_stack(
122
+ (lower_quantile_data.values, upper_quantile_data.values)
123
+ ),
124
+ hovertemplate=(
125
+ f"{lower_quantile}%: %{{customdata[0]:,.4s}}<br>"
126
+ f"{upper_quantile}%: %{{customdata[1]:,.4s}}"
127
+ "<extra></extra>"
128
+ ),
129
+ name=f"{lower_quantile}%-{upper_quantile}% Hover Info",
130
+ showlegend=False,
131
+ legendgroup=legendgroup,
132
+ )
133
+ )
134
+
135
+ def plot(
136
+ self,
137
+ realized: Optional[pd.Series] = None,
138
+ forecast: Optional[pd.Series] = None,
139
+ quantiles: Optional[pd.DataFrame] = None,
140
+ ):
141
+ """Create a plot showing forecast quantiles and realized values.
142
+
143
+ Generates an interactive plotly figure displaying the forecast distribution
144
+ through quantile bands, the median forecast, and the actual realized values.
145
+
146
+ Args:
147
+ realized (pd.Series): Time series of realized (actual) values.
148
+ forecast (pd.Series): Time series of forecast values (typically the median).
149
+ quantiles (pd.DataFrame): DataFrame containing quantile predictions.
150
+ Column names should follow the format 'quantile_P{percentile:02d}',
151
+ e.g., 'quantile_P10', 'quantile_P90'.
152
+
153
+ Returns:
154
+ go.Figure: A plotly figure object with the configured visualization.
155
+ """
156
+ figure = go.Figure()
157
+
158
+ if quantiles is not None:
159
+ # Extract and sort quantile percentages
160
+ quantile_cols = [
161
+ col for col in quantiles.columns if col.startswith("quantile_P")
162
+ ]
163
+ percentiles = sorted([int(col.split("P")[1]) for col in quantile_cols])
164
+
165
+ # Add quantile bands from widest to narrowest
166
+ for i in range(len(percentiles) // 2):
167
+ lower_quantile, upper_quantile = percentiles[i], percentiles[-(i + 1)]
168
+ if float(lower_quantile) == 50.0:
169
+ continue
170
+
171
+ self._add_quantile_band(
172
+ figure=figure,
173
+ lower_quantile_data=quantiles[f"quantile_P{lower_quantile:02d}"],
174
+ lower_quantile=lower_quantile,
175
+ upper_quantile_data=quantiles[f"quantile_P{upper_quantile:02d}"],
176
+ upper_quantile=upper_quantile,
177
+ )
178
+
179
+ if forecast is not None:
180
+ # Add forecast line (50th percentile)
181
+ figure.add_trace(
182
+ go.Scatter(
183
+ x=forecast.index,
184
+ y=forecast,
185
+ mode="lines",
186
+ line=dict(color="blue", width=self.stroke_width),
187
+ name="Forecast (50th)",
188
+ customdata=forecast.values,
189
+ hovertemplate="Forecast (50th): %{customdata:,.4s}<extra></extra>",
190
+ )
191
+ )
192
+
193
+ if realized is not None:
194
+ # Add realized values on top
195
+ figure.add_trace(
196
+ go.Scatter(
197
+ x=realized.index,
198
+ y=realized,
199
+ mode="lines",
200
+ line=dict(color="red", width=self.stroke_width),
201
+ customdata=realized.values,
202
+ hovertemplate="Realized: %{customdata:,.4s}<extra></extra>",
203
+ name="Realized",
204
+ )
205
+ )
206
+
207
+ # Styling configuration
208
+ figure.update_layout(
209
+ title=f"Load Forecast vs Actual",
210
+ xaxis_title="Datetime [UTC]",
211
+ yaxis_title="Load [W]",
212
+ template="plotly_white",
213
+ hovermode="x unified",
214
+ )
215
+
216
+ return figure
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: openstef
3
- Version: 3.4.62
3
+ Version: 3.4.64
4
4
  Summary: Open short term energy forecaster
5
5
  Home-page: https://github.com/OpenSTEF/openstef
6
6
  Author: Alliander N.V
@@ -33,7 +33,11 @@ Requires-Dist: scikit-learn<1.6,>=1.3
33
33
  Requires-Dist: scipy~=1.10
34
34
  Requires-Dist: statsmodels<1.0.0,>=0.13.5
35
35
  Requires-Dist: structlog<25,>=23.1
36
- Requires-Dist: xgboost~=2.0
36
+ Requires-Dist: xgboost~=2.0; extra == "gpu"
37
+ Provides-Extra: cpu
38
+ Requires-Dist: xgboost-cpu~=2.0; extra == "cpu"
39
+ Provides-Extra: gpu
40
+ Requires-Dist: xgboost; extra == "gpu"
37
41
  Dynamic: author
38
42
  Dynamic: author-email
39
43
  Dynamic: classifier
@@ -42,6 +46,7 @@ Dynamic: description-content-type
42
46
  Dynamic: home-page
43
47
  Dynamic: keywords
44
48
  Dynamic: license
49
+ Dynamic: provides-extra
45
50
  Dynamic: requires-dist
46
51
  Dynamic: requires-python
47
52
  Dynamic: summary
@@ -53,11 +58,15 @@ SPDX-License-Identifier: MPL-2.0
53
58
  -->
54
59
 
55
60
  # OpenSTEF
61
+
56
62
  <!-- Badges -->
63
+
57
64
  [![Downloads](https://static.pepy.tech/badge/openstef)](https://pepy.tech/project/openstef)
58
65
  [![Downloads](https://static.pepy.tech/badge/openstef/month)](https://pepy.tech/project/openstef)
59
66
  [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5585/badge)](https://bestpractices.coreinfrastructure.org/projects/5585)
67
+
60
68
  <!-- SonarCloud badges -->
69
+
61
70
  [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=bugs)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
62
71
  [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=code_smells)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
63
72
  [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=coverage)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
@@ -71,19 +80,21 @@ SPDX-License-Identifier: MPL-2.0
71
80
  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.
72
81
 
73
82
  # Table of contents
83
+
74
84
  - [OpenSTEF](#openstef)
75
85
  - [Table of contents](#table-of-contents)
76
86
  - [External information sources](#external-information-sources)
77
87
  - [Installation](#installation)
78
88
  - [Usage](#usage)
79
- - [Example notebooks](#example-notebooks)
80
- - [Reference Implementation](#reference-implementation)
81
- - [Database connector for OpenSTEF](#database-connector-for-openstef)
89
+ - [Example notebooks](#example-notebooks)
90
+ - [Reference Implementation](#reference-implementation)
91
+ - [Database connector for OpenSTEF](#database-connector-for-openstef)
82
92
  - [License](license)
83
93
  - [Contributing](#contributing)
84
94
  - [Contact](#contact)
85
95
 
86
96
  # External information sources
97
+
87
98
  - [Documentation website](https://openstef.github.io/openstef/index.html);
88
99
  - [Python package](https://pypi.org/project/openstef/);
89
100
  - [Linux Foundation project page](https://www.lfenergy.org/projects/openstef/);
@@ -101,9 +112,11 @@ pip install openstef
101
112
  ### Remark regarding installation within a **conda environment on Windows**
102
113
 
103
114
  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:
115
+
104
116
  ```shell
105
117
  pip install pywin32==300
106
118
  ```
119
+
107
120
  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).
108
121
 
109
122
  ## Remark regarding installation on Apple Silicon
@@ -112,19 +125,31 @@ If you want to install the `openstef` package on Apple Silicon (Mac with M1-chip
112
125
 
113
126
  1. Run `brew install libomp` (if you haven’t installed Homebrew: [follow instructions here](https://brew.sh/))
114
127
  2. If your interpreter can not find the `libomp` installation in `/usr/local/bin`, it is probably in `/opt/brew/Cellar`. Run:
128
+
115
129
  ```sh
116
130
  mkdir -p /usr/local/opt/libomp/
117
131
  ln -s /opt/brew/Cellar/libomp/{your_version}/lib /usr/local/opt/libomp/lib
118
132
  ```
133
+
119
134
  3. Uninstall `xgboost` with `pip` (`pip uninstall xgboost`) and install with `conda-forge` (`conda install -c conda-forge xgboost`)
120
135
  4. If you encounter similar issues with `lightgbm`: uninstall `lightgbm` with `pip` (`pip uninstall lightgbm`) and install later version with `conda-forge` (`conda install -c conda-forge 'lightgbm>=4.2.0'`)
121
136
 
137
+ ### Remark regarding installation with minimal XGBoost dependency
138
+
139
+ It is possible to install openSTEF with a minimal XGBoost (CPU-only) package. This only works on x86_64 (amd64) Linux and Windows platforms. Advantage is that significantly smaller dependencies are installed. In that case run:
140
+
141
+ ```shell
142
+ pip install openstef[cpu]
143
+ ```
144
+
122
145
  # Usage
123
146
 
124
147
  ## Example notebooks
148
+
125
149
  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).
126
150
 
127
151
  ## Reference Implementation
152
+
128
153
  A complete implementation including databases, user interface, example data, etc. is available at: https://github.com/OpenSTEF/openstef-reference
129
154
 
130
155
  ![screenshot](https://user-images.githubusercontent.com/60883372/146760483-29af3ac7-62af-4f13-98c7-982a79c517d1.jpg)
@@ -138,17 +163,21 @@ python -m openstef task <task_name>
138
163
  ```
139
164
 
140
165
  ## Database connector for openstef
166
+
141
167
  This repository provides an interface to OpenSTEF (reference) databases. The repository can be found [here](https://github.com/OpenSTEF/openstef-dbc).
142
168
 
143
169
  # License
170
+
144
171
  This project is licensed under the Mozilla Public License, version 2.0 - see LICENSE for details.
145
172
 
146
173
  ## Licenses third-party libraries
174
+
147
175
  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.
148
176
 
149
177
  # Contributing
178
+
150
179
  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.
151
180
 
152
181
  # Contact
182
+
153
183
  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
154
-
@@ -85,6 +85,8 @@ openstef/pipeline/optimize_hyperparameters.py
85
85
  openstef/pipeline/train_create_forecast_backtest.py
86
86
  openstef/pipeline/train_model.py
87
87
  openstef/pipeline/utils.py
88
+ openstef/plotting/__init__.py
89
+ openstef/plotting/load_forecast_plotter.py
88
90
  openstef/postprocessing/__init__.py
89
91
  openstef/postprocessing/postprocessing.py
90
92
  openstef/preprocessing/__init__.py
@@ -17,4 +17,12 @@ scikit-learn<1.6,>=1.3
17
17
  scipy~=1.10
18
18
  statsmodels<1.0.0,>=0.13.5
19
19
  structlog<25,>=23.1
20
+
21
+ [:extra == "gpu"]
20
22
  xgboost~=2.0
23
+
24
+ [cpu]
25
+ xgboost-cpu~=2.0
26
+
27
+ [gpu]
28
+ xgboost
@@ -18,6 +18,10 @@ def read_requirements_from_file():
18
18
  line = line[: line.index("#")].strip()
19
19
  if len(line) == 0:
20
20
  continue
21
+ if "xgboost" in line:
22
+ line = (
23
+ line + '; extra == "gpu"'
24
+ ) # make sure xgboost is installed with GPU support when not specifying options
21
25
  requirements.append(line)
22
26
  return requirements
23
27
 
@@ -29,7 +33,7 @@ def read_long_description_from_readme():
29
33
 
30
34
  setup(
31
35
  name="openstef",
32
- version="3.4.62",
36
+ version="3.4.64",
33
37
  packages=find_packages(include=["openstef", "openstef.*"]),
34
38
  description="Open short term energy forecaster",
35
39
  long_description=read_long_description_from_readme(),
@@ -55,4 +59,10 @@ setup(
55
59
  r"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
56
60
  "Programming Language :: Python :: 3.11",
57
61
  ],
62
+ extras_require={
63
+ "cpu": [
64
+ "xgboost-cpu~=2.0"
65
+ ], # Add xgboost-cpu to avoid install large xgboost package when not using GPU
66
+ "gpu": ["xgboost"], # Needed to install xgboost with GPU support in normal case
67
+ },
58
68
  )
File without changes
File without changes
File without changes
File without changes