hefty 0.3.0__tar.gz → 0.3.2__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.
- {hefty-0.3.0/src/hefty.egg-info → hefty-0.3.2}/PKG-INFO +3 -3
- {hefty-0.3.0 → hefty-0.3.2}/README.md +1 -1
- {hefty-0.3.0 → hefty-0.3.2}/pyproject.toml +2 -2
- {hefty-0.3.0 → hefty-0.3.2}/src/hefty/solar.py +11 -8
- {hefty-0.3.0 → hefty-0.3.2/src/hefty.egg-info}/PKG-INFO +3 -3
- {hefty-0.3.0 → hefty-0.3.2}/tests/test_adjust_forecast_datetimes.py +2 -2
- {hefty-0.3.0 → hefty-0.3.2}/tests/test_get_solar_forecast.py +4 -2
- {hefty-0.3.0 → hefty-0.3.2}/tests/test_get_solar_forecast_ensemble.py +4 -2
- {hefty-0.3.0 → hefty-0.3.2}/tests/test_get_solar_forecast_fast.py +4 -2
- {hefty-0.3.0 → hefty-0.3.2}/tests/test_get_wind_forecast.py +4 -2
- {hefty-0.3.0 → hefty-0.3.2}/LICENSE +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/setup.cfg +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/src/hefty/__init__.py +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/src/hefty/custom.py +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/src/hefty/pv_model.py +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/src/hefty/utilities.py +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/src/hefty/wind.py +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/src/hefty.egg-info/SOURCES.txt +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/src/hefty.egg-info/dependency_links.txt +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/src/hefty.egg-info/requires.txt +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/src/hefty.egg-info/top_level.txt +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/tests/test_model_input_formatter.py +0 -0
- {hefty-0.3.0 → hefty-0.3.2}/tests/test_pv_model.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hefty
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Some (relatively) lightweight short-term energy forecasting tools for solar, wind, and load.
|
|
5
5
|
Author: Will Hobbs
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Intended Audience :: Science/Research
|
|
13
13
|
Classifier: Topic :: Scientific/Engineering
|
|
14
|
-
Requires-Python:
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
Requires-Dist: herbie-data[scikit-learn]>=2026.9.2
|
|
@@ -223,7 +223,7 @@ Those outputs could then be directly passed as inputs to `hefty.solar.get_solar_
|
|
|
223
223
|
|
|
224
224
|
Model delays are more than just a fixed time: they can vary by lead time and by cycle time. And some cycles have different total run lengths and interval size for some models. `adjust_forecast_datetimes` adjusts for all of this for you.
|
|
225
225
|
|
|
226
|
-
Delays calculated in `adjust_forecast_datetimes` are based on experiments in this
|
|
226
|
+
Delays calculated in `adjust_forecast_datetimes` are based on experiments in this notebook [docs/forecast_model_delays.ipynb](docs/forecast_model_delays.ipynb) (or see this markdown version, [docs/forecast_model_delays.md](docs/forecast_model_delays.md)), documentation published by ECMWF, and this cool dashboard by dynamical.org https://dynamical.org/status/.
|
|
227
227
|
|
|
228
228
|
## Local disk space
|
|
229
229
|
The current version of hefty keeps copies of downloaded grib files on your local storage. This can result in a large amount of disk space being used up. Future versions of hefty may change this (see [issue #70](https://github.com/williamhobbs/hefty/issues/70)), but for now, users may need to monitor storage space and manually delete files if needed.
|
|
@@ -201,7 +201,7 @@ Those outputs could then be directly passed as inputs to `hefty.solar.get_solar_
|
|
|
201
201
|
|
|
202
202
|
Model delays are more than just a fixed time: they can vary by lead time and by cycle time. And some cycles have different total run lengths and interval size for some models. `adjust_forecast_datetimes` adjusts for all of this for you.
|
|
203
203
|
|
|
204
|
-
Delays calculated in `adjust_forecast_datetimes` are based on experiments in this
|
|
204
|
+
Delays calculated in `adjust_forecast_datetimes` are based on experiments in this notebook [docs/forecast_model_delays.ipynb](docs/forecast_model_delays.ipynb) (or see this markdown version, [docs/forecast_model_delays.md](docs/forecast_model_delays.md)), documentation published by ECMWF, and this cool dashboard by dynamical.org https://dynamical.org/status/.
|
|
205
205
|
|
|
206
206
|
## Local disk space
|
|
207
207
|
The current version of hefty keeps copies of downloaded grib files on your local storage. This can result in a large amount of disk space being used up. Future versions of hefty may change this (see [issue #70](https://github.com/williamhobbs/hefty/issues/70)), but for now, users may need to monitor storage space and manually delete files if needed.
|
|
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hefty"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.2"
|
|
8
8
|
description = "Some (relatively) lightweight short-term energy forecasting tools for solar, wind, and load."
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.11
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
11
|
authors = [
|
|
12
12
|
{ name="Will Hobbs" },
|
|
13
13
|
]
|
|
@@ -346,7 +346,8 @@ def get_solar_forecast(latitude, longitude, init_date, run_length,
|
|
|
346
346
|
unmixed = ((mixed['hour_of_mixed_period'] * mixed['sdswrf']
|
|
347
347
|
- (mixed['hour_of_mixed_period'] - mixed['int_len'])
|
|
348
348
|
* mixed['sdswrf_prev']) / mixed['int_len'])
|
|
349
|
-
|
|
349
|
+
# clip to avoid occasional small negative ghi in GEFS, see GH #35
|
|
350
|
+
df['ghi'] = unmixed.clip(lower=0)
|
|
350
351
|
|
|
351
352
|
elif model in {'ifs', 'ifs_ens', 'aifs', 'aifs_ens', 'cams'}:
|
|
352
353
|
# for ifs ghi: cumulative J/m^s to average W/m^2 over the interval
|
|
@@ -407,7 +408,7 @@ def get_solar_forecast(latitude, longitude, init_date, run_length,
|
|
|
407
408
|
df['ghi_csi'] = df['ghi'] / df['ghi_clear']
|
|
408
409
|
|
|
409
410
|
# avoid divide by zero issues
|
|
410
|
-
df.loc[df['
|
|
411
|
+
df.loc[df['ghi_clear'] == 0, 'ghi_csi'] = 0
|
|
411
412
|
|
|
412
413
|
# 60min version of data, centered at bottom of the hour
|
|
413
414
|
new_index = pd.date_range(df.index.min(),
|
|
@@ -828,7 +829,8 @@ def get_solar_forecast_fast(latitude, longitude, init_date, run_length,
|
|
|
828
829
|
unmixed = ((mixed['hour_of_mixed_period'] * mixed['sdswrf']
|
|
829
830
|
- (mixed['hour_of_mixed_period'] - mixed['int_len'])
|
|
830
831
|
* mixed['sdswrf_prev']) / mixed['int_len'])
|
|
831
|
-
|
|
832
|
+
# clip to avoid occasional small negative ghi in GEFS, see GH #35
|
|
833
|
+
df['ghi'] = unmixed.clip(lower=0)
|
|
832
834
|
|
|
833
835
|
elif model in ['ifs', 'ifs_ens', 'aifs', 'aifs_ens']:
|
|
834
836
|
# for ifs ghi: cumulative J/m^s to average W/m^2 over the interval
|
|
@@ -879,7 +881,7 @@ def get_solar_forecast_fast(latitude, longitude, init_date, run_length,
|
|
|
879
881
|
df['ghi_csi'] = df['ghi'] / df['ghi_clear']
|
|
880
882
|
|
|
881
883
|
# avoid divide by zero issues
|
|
882
|
-
df.loc[df['
|
|
884
|
+
df.loc[df['ghi_clear'] == 0, 'ghi_csi'] = 0
|
|
883
885
|
|
|
884
886
|
# 60min version of data, centered at bottom of the hour
|
|
885
887
|
new_index = pd.date_range(df.index.min(),
|
|
@@ -1268,7 +1270,7 @@ def get_solar_forecast_ensemble_subset(
|
|
|
1268
1270
|
df['ghi_csi'] = df['ghi'] / df['ghi_clear']
|
|
1269
1271
|
|
|
1270
1272
|
# avoid divide by zero issues
|
|
1271
|
-
df.loc[df['
|
|
1273
|
+
df.loc[df['ghi_clear'] == 0, 'ghi_csi'] = 0
|
|
1272
1274
|
|
|
1273
1275
|
# make a dummy column
|
|
1274
1276
|
df['dummy'] = 0
|
|
@@ -1729,7 +1731,7 @@ def get_solar_forecast_ensemble(latitude, longitude, init_date, run_length,
|
|
|
1729
1731
|
df['ghi_csi'] = df['ghi'] / df['ghi_clear']
|
|
1730
1732
|
|
|
1731
1733
|
# avoid divide by zero issues
|
|
1732
|
-
df.loc[df['
|
|
1734
|
+
df.loc[df['ghi_clear'] == 0, 'ghi_csi'] = 0
|
|
1733
1735
|
|
|
1734
1736
|
# 60min version of data, centered at bottom of the hour
|
|
1735
1737
|
new_index = pd.date_range(df.index.min(),
|
|
@@ -1869,7 +1871,8 @@ def get_solar_forecast_ensemble(latitude, longitude, init_date, run_length,
|
|
|
1869
1871
|
unmixed = ((mixed['hour_of_mixed_period'] * mixed['sdswrf']
|
|
1870
1872
|
- (mixed['hour_of_mixed_period'] - mixed['int_len'])
|
|
1871
1873
|
* mixed['sdswrf_prev']) / mixed['int_len'])
|
|
1872
|
-
|
|
1874
|
+
# clip to avoid occasional small negative ghi in GEFS, see GH #35
|
|
1875
|
+
df['ghi'] = unmixed.clip(lower=0)
|
|
1873
1876
|
|
|
1874
1877
|
# make 1min interval clear sky data covering our time range
|
|
1875
1878
|
times = pd.date_range(
|
|
@@ -1905,7 +1908,7 @@ def get_solar_forecast_ensemble(latitude, longitude, init_date, run_length,
|
|
|
1905
1908
|
df['ghi_csi'] = df['ghi'] / df['ghi_clear']
|
|
1906
1909
|
|
|
1907
1910
|
# avoid divide by zero issues
|
|
1908
|
-
df.loc[df['
|
|
1911
|
+
df.loc[df['ghi_clear'] == 0, 'ghi_csi'] = 0
|
|
1909
1912
|
|
|
1910
1913
|
# 60min version of data, centered at bottom of the hour
|
|
1911
1914
|
new_index = pd.date_range(df.index.min(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hefty
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Some (relatively) lightweight short-term energy forecasting tools for solar, wind, and load.
|
|
5
5
|
Author: Will Hobbs
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Intended Audience :: Science/Research
|
|
13
13
|
Classifier: Topic :: Scientific/Engineering
|
|
14
|
-
Requires-Python:
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
Requires-Dist: herbie-data[scikit-learn]>=2026.9.2
|
|
@@ -223,7 +223,7 @@ Those outputs could then be directly passed as inputs to `hefty.solar.get_solar_
|
|
|
223
223
|
|
|
224
224
|
Model delays are more than just a fixed time: they can vary by lead time and by cycle time. And some cycles have different total run lengths and interval size for some models. `adjust_forecast_datetimes` adjusts for all of this for you.
|
|
225
225
|
|
|
226
|
-
Delays calculated in `adjust_forecast_datetimes` are based on experiments in this
|
|
226
|
+
Delays calculated in `adjust_forecast_datetimes` are based on experiments in this notebook [docs/forecast_model_delays.ipynb](docs/forecast_model_delays.ipynb) (or see this markdown version, [docs/forecast_model_delays.md](docs/forecast_model_delays.md)), documentation published by ECMWF, and this cool dashboard by dynamical.org https://dynamical.org/status/.
|
|
227
227
|
|
|
228
228
|
## Local disk space
|
|
229
229
|
The current version of hefty keeps copies of downloaded grib files on your local storage. This can result in a large amount of disk space being used up. Future versions of hefty may change this (see [issue #70](https://github.com/williamhobbs/hefty/issues/70)), but for now, users may need to monitor storage space and manually delete files if needed.
|
|
@@ -20,7 +20,7 @@ def test_tz_warning():
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
def test_hrrr_too_far():
|
|
23
|
-
available_date = '2026-09-24 02:00'
|
|
23
|
+
available_date = '2026-09-24 02:00+00:00'
|
|
24
24
|
run_length_needed = 43
|
|
25
25
|
lead_time_to_start_needed = 1
|
|
26
26
|
model = 'hrrr'
|
|
@@ -32,7 +32,7 @@ def test_hrrr_too_far():
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
def test_gfs_way_too_far():
|
|
35
|
-
available_date = '2026-09-24 00:00'
|
|
35
|
+
available_date = '2026-09-24 00:00+00:00'
|
|
36
36
|
run_length_needed = 385
|
|
37
37
|
lead_time_to_start_needed = 0
|
|
38
38
|
model = 'gfs'
|
|
@@ -7,8 +7,10 @@ from hefty.solar import get_solar_forecast
|
|
|
7
7
|
|
|
8
8
|
# ignore xarray FutureWarnings (see https://github.com/blaylockbk/Herbie/issues/525).
|
|
9
9
|
# ignore grib file removal warnings
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
pytestmark = [
|
|
11
|
+
pytest.mark.filterwarnings('ignore:.*Will not remove GRIB.*'),
|
|
12
|
+
pytest.mark.filterwarnings('ignore:.*In a future version.*')
|
|
13
|
+
]
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
def test_hrrr():
|
|
@@ -7,8 +7,10 @@ from hefty.solar import get_solar_forecast_ensemble
|
|
|
7
7
|
|
|
8
8
|
# ignore xarray FutureWarnings (see https://github.com/blaylockbk/Herbie/issues/525).
|
|
9
9
|
# ignore grib file removal warnings
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
pytestmark = [
|
|
11
|
+
pytest.mark.filterwarnings('ignore:.*Will not remove GRIB.*'),
|
|
12
|
+
pytest.mark.filterwarnings('ignore:.*In a future version.*')
|
|
13
|
+
]
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
def test_gefs_dynamical():
|
|
@@ -7,8 +7,10 @@ from hefty.solar import get_solar_forecast_fast
|
|
|
7
7
|
|
|
8
8
|
# ignore xarray FutureWarnings (see https://github.com/blaylockbk/Herbie/issues/525).
|
|
9
9
|
# ignore grib file removal warnings
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
pytestmark = [
|
|
11
|
+
pytest.mark.filterwarnings('ignore:.*Will not remove GRIB.*'),
|
|
12
|
+
pytest.mark.filterwarnings('ignore:.*In a future version.*')
|
|
13
|
+
]
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
def test_hrrr():
|
|
@@ -7,8 +7,10 @@ from hefty.wind import get_wind_forecast
|
|
|
7
7
|
|
|
8
8
|
# ignore xarray FutureWarnings (see https://github.com/blaylockbk/Herbie/issues/525).
|
|
9
9
|
# ignore grib file removal warnings
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
pytestmark = [
|
|
11
|
+
pytest.mark.filterwarnings('ignore:.*Will not remove GRIB.*'),
|
|
12
|
+
pytest.mark.filterwarnings('ignore:.*In a future version.*')
|
|
13
|
+
]
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
def test_hrrr():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|