openstef 3.4.35__py3-none-any.whl → 3.4.37__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,9 +10,7 @@ import pandas as pd
10
10
 
11
11
  from openstef import PROJECT_ROOT
12
12
 
13
- HOLIDAY_CSV_PATH: str = (
14
- PROJECT_ROOT / "openstef" / "data" / "dutch_holidays_2020-2022.csv"
15
- )
13
+ HOLIDAY_CSV_PATH: str = PROJECT_ROOT / "openstef" / "data" / "dutch_holidays.csv"
16
14
 
17
15
 
18
16
  def generate_holiday_feature_functions(
@@ -46,12 +44,14 @@ def generate_holiday_feature_functions(
46
44
  - Pinksteren
47
45
  - Kerst
48
46
 
47
+
49
48
  The 'Brugdagen' are updated untill dec 2020. (Generated using agenda)
50
49
 
51
50
  Args:
52
51
  country: Country for which to create holiday features.
53
52
  years: years for which to create holiday features.
54
53
  path_to_school_holidays_csv: Filepath to csv with school holidays.
54
+ NOTE: Dutch holidays csv file is only until January 2026.
55
55
 
56
56
  Returns:
57
57
  Dictionary with functions that check if a given date is a holiday, keys
@@ -108,7 +108,7 @@ def create_components_forecast_pipeline(
108
108
 
109
109
  # Make component forecasts
110
110
  try:
111
- input_data = create_input(pj, input_data, weather_data)
111
+ dazls_input_data = create_input(pj, input_data, weather_data)
112
112
 
113
113
  # Save and load the model as .sav file (or as .z file)
114
114
  # For the code contact: korte.termijn.prognoses@alliander.com
@@ -119,13 +119,13 @@ def create_components_forecast_pipeline(
119
119
 
120
120
  # Use the predict function of Dazls model
121
121
  # As input data we use the input_data function which takes into consideration what we want as an input for the forecast and what Dazls can accept as an input
122
- forecasts = dazls_model.predict(x=input_data)
122
+ forecasts = dazls_model.predict(x=dazls_input_data)
123
123
 
124
124
  # Set the columns for the output forecast dataframe
125
125
  forecasts = pd.DataFrame(
126
126
  forecasts,
127
127
  columns=["forecast_wind_on_shore", "forecast_solar"],
128
- index=input_data.index,
128
+ index=dazls_input_data.index,
129
129
  )
130
130
 
131
131
  # Make post-processed forecasts for solar and wind power
@@ -140,18 +140,25 @@ def create_components_forecast_pipeline(
140
140
 
141
141
  # Make forecast for the component: "forecast_other"
142
142
  forecasts["forecast_other"] = (
143
- input_data["total_load"]
143
+ dazls_input_data["total_load"]
144
144
  - forecasts["forecast_solar"]
145
145
  - forecasts["forecast_wind_on_shore"]
146
146
  )
147
+
148
+ # Make sure the forecasts have the same form as the input data. Pad with 0 if necessary
149
+ forecasts = forecasts.reindex(index=input_data.index, fill_value=0)
147
150
  except Exception as e:
148
- # In case something goes wrong we fall back on aan empty dataframe
151
+ # In case something goes wrong we fall back on an a zero-filled dataframe
149
152
  logger.warning(
150
153
  f"Could not make component forecasts: {e}, falling back on series of"
151
154
  " zeros!",
152
155
  exc_info=e,
153
156
  )
154
- forecasts = pd.DataFrame()
157
+ forecasts = pd.DataFrame(
158
+ data=0,
159
+ index=input_data.index,
160
+ columns=["forecast_wind_on_shore", "forecast_solar", "forecast_other"],
161
+ )
155
162
 
156
163
  # Prepare for output
157
164
  # Add more prediction properties to the forecast ("pid","customer","description","type","algtype)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openstef
3
- Version: 3.4.35
3
+ Version: 3.4.37
4
4
  Summary: Open short term energy forecaster
5
5
  Home-page: https://github.com/OpenSTEF/openstef
6
6
  Author: Alliander N.V
@@ -63,7 +63,7 @@ OpenSTEF is a Python package designed for generating short-term forecasts in the
63
63
  - [OpenSTEF](#openstef)
64
64
  - [Table of contents](#table-of-contents)
65
65
  - [External information sources](#external-information-sources)
66
- - [Installation](#install)
66
+ - [Installation](#installation)
67
67
  - [Usage](#usage)
68
68
  - [Example notebooks](#example-notebooks)
69
69
  - [Reference Implementation](#reference-implementation)
@@ -96,6 +96,19 @@ pip install pywin32==300
96
96
  ```
97
97
  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).
98
98
 
99
+ ## Remark regarding installation on Apple Silicon
100
+
101
+ If you want to install the `openstef` package on Apple Silicon (Mac with M1-chip or newer), you can encounter issues with the dependencies, such as `xgboost`. Solution:
102
+
103
+ 1. Run `brew install libomp` (if you haven’t installed Homebrew: [follow instructions here](https://brew.sh/))
104
+ 2. If your interpreter can not find the `libomp` installation in `/usr/local/bin`, it is probably in `/opt/brew/Cellar`. Run:
105
+ ```sh
106
+ mkdir -p /usr/local/opt/libomp/
107
+ ln -s /opt/brew/Cellar/libomp/{your_version}/lib /usr/local/opt/libomp/lib
108
+ ```
109
+ 3. Uninstall `xgboost` with `pip` (`pip uninstall xgboost`) and install with `conda-forge` (`conda install -c conda-forge xgboost`)
110
+ 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'`)
111
+
99
112
  # Usage
100
113
 
101
114
  ## Example notebooks
@@ -4,8 +4,8 @@ openstef/app_settings.py,sha256=EJTDtimctFQQ-3f7ZcOQaRYohpZk3JD6aZBWPFYM2_A,582
4
4
  openstef/enums.py,sha256=TTchQ0iZ3PXBjMVmVid_x7W-zU1jNiHa-4wDMGyNWic,755
5
5
  openstef/exceptions.py,sha256=U4u2LTcdT6cmzpipT2Jh7kq9nCjT_-6gntn8yjuhGU0,1993
6
6
  openstef/settings.py,sha256=nSgkBqFxuqB3w7Rwo60i8j37c5ngDbt6vpjHS6QtJXQ,354
7
- openstef/data/dutch_holidays_2020-2022.csv,sha256=pS-CjE0igYXd-2dG-MlqyvR2fgYgXkbNmgCKyTjmwxs,23704
8
- openstef/data/dutch_holidays_2020-2022.csv.license,sha256=AxxHusqwIXU5RHl5ZMU65LyXmgtbj6QlcnFaOEN4kEE,145
7
+ openstef/data/dutch_holidays.csv,sha256=Cg8EYjXp1O0lcFOkIOmrS5HaOArrxZwOXsZ9pVkIcKI,49847
8
+ openstef/data/dutch_holidays.csv.license,sha256=AxxHusqwIXU5RHl5ZMU65LyXmgtbj6QlcnFaOEN4kEE,145
9
9
  openstef/data/pv_single_coefs.csv,sha256=jadIEYdHvl1lnV_06X_FASkJZ6C3Hecs5xZnH1gPMvI,24779
10
10
  openstef/data/pv_single_coefs.csv.license,sha256=AxxHusqwIXU5RHl5ZMU65LyXmgtbj6QlcnFaOEN4kEE,145
11
11
  openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z,sha256=2HEXuEvt5BMZMcDPiMfRiABgDQ698H_eM410XREIQK0,1293
@@ -23,7 +23,7 @@ openstef/feature_engineering/data_preparation.py,sha256=htca9LBO3ZN1D-iX4vXf0UN1
23
23
  openstef/feature_engineering/feature_adder.py,sha256=aSqDl_gUrB3H2TD3cNvU5JniY_KOb4u4a2A6J7zB2BQ,6835
24
24
  openstef/feature_engineering/feature_applicator.py,sha256=DR7jayrEMlra4BFL1Ps5WV2fxbkQ6VaOTa5RIKM-YNk,7447
25
25
  openstef/feature_engineering/general.py,sha256=tgU4_1stag9jJmaQAfWCMhfBscznVuQvW5hPK_z9_9g,4438
26
- openstef/feature_engineering/holiday_features.py,sha256=3Ff4Lkm26h8wJVoBplUewt4HfsvOUS9zj0x0MxewIm8,7842
26
+ openstef/feature_engineering/holiday_features.py,sha256=e4BfS4Wrd3sn_SeXh8F1tL1JNu99oa2smSJJiejcrIw,7891
27
27
  openstef/feature_engineering/lag_features.py,sha256=Dr6qS8UhdgEHPZZSe-w6ibtjl_lcbcQohhqdZN9fqEU,5652
28
28
  openstef/feature_engineering/missing_values_transformer.py,sha256=M5FNzpGubgAO-VoHoKpTlp6vLt6DlXt8lEYa96g7IMg,3565
29
29
  openstef/feature_engineering/weather_features.py,sha256=Lr9DItyHvJ2CpWQ1r6A83tJKtR2k_Wwn32FdFTGblO0,15750
@@ -62,7 +62,7 @@ openstef/monitoring/performance_meter.py,sha256=6aCGjJFXFq-7qwaJyBkF3MLqjgVK6FMF
62
62
  openstef/monitoring/teams.py,sha256=A-tlZeuAgolxFHjgT3gGjraxzW2dmuB-UAOz4xgYNIQ,6668
63
63
  openstef/pipeline/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
64
64
  openstef/pipeline/create_basecase_forecast.py,sha256=YkpiqohETTAETb4GiVlK_btw5dpixJy2LmFZdm10iaI,4623
65
- openstef/pipeline/create_component_forecast.py,sha256=XlE9oo37qwmZPE2Dgg19CDfFPRKgrLuyW069pS035UQ,5668
65
+ openstef/pipeline/create_component_forecast.py,sha256=U2v_R-FSOXWVbWeknsJbkulN1YK56fL7-bB1h2B1yzw,6021
66
66
  openstef/pipeline/create_forecast.py,sha256=F09civdIumNQwJq2hraea5QTQx7DgvEliXKs4Y3f8Mc,5689
67
67
  openstef/pipeline/optimize_hyperparameters.py,sha256=3SLkcLR7XC4IeN48C-XT_lxlfCqW_D0NoMpZcrB9UUM,11045
68
68
  openstef/pipeline/train_create_forecast_backtest.py,sha256=-kZqCWal5zYLL0k0Sapks1zTmU5unNAooVPaPos1_7E,6050
@@ -88,8 +88,8 @@ openstef/tasks/utils/predictionjobloop.py,sha256=Ysy3zF5lzPMz_asYDKeF5m0qgVT3tCt
88
88
  openstef/tasks/utils/taskcontext.py,sha256=L9K14ycwgVxbIVUjH2DIn_QWbnu-OfxcGtQ1K9T6sus,5630
89
89
  openstef/validation/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
90
90
  openstef/validation/validation.py,sha256=628xaDbAm8B4AYtFOAn8_SXLjejNfULGCfX3hVf_mU0,11119
91
- openstef-3.4.35.dist-info/LICENSE,sha256=7Pm2fWFFHHUG5lDHed1vl5CjzxObIXQglnYsEdtjo_k,14907
92
- openstef-3.4.35.dist-info/METADATA,sha256=BhiGgkicPfG4UNjBRc6lyyO7fQR6fj9VsFZs34u2PfI,7359
93
- openstef-3.4.35.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
94
- openstef-3.4.35.dist-info/top_level.txt,sha256=kD0H4PqrQoncZ957FvqwfBxa89kTrun4Z_RAPs_HhLs,9
95
- openstef-3.4.35.dist-info/RECORD,,
91
+ openstef-3.4.37.dist-info/LICENSE,sha256=7Pm2fWFFHHUG5lDHed1vl5CjzxObIXQglnYsEdtjo_k,14907
92
+ openstef-3.4.37.dist-info/METADATA,sha256=b0R7zOl0NTWd7INS7AeJti5jVdG9RxUdGpp8aa0e5Q4,8281
93
+ openstef-3.4.37.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
94
+ openstef-3.4.37.dist-info/top_level.txt,sha256=kD0H4PqrQoncZ957FvqwfBxa89kTrun4Z_RAPs_HhLs,9
95
+ openstef-3.4.37.dist-info/RECORD,,