hefty 0.1.2__tar.gz → 0.1.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hefty
3
- Version: 0.1.2
3
+ Version: 0.1.4
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hefty"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  description = "Some (relatively) lightweight short-term energy forecasting tools for solar, wind, and load."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -1249,6 +1249,11 @@ def get_solar_forecast_ensemble_subset(
1249
1249
 
1250
1250
  # get deterministic temp_air
1251
1251
  search_str = ':2t:sfc:g:0001:od:cf:enfo'
1252
+ product = 'enfo'
1253
+ # account for IFS changes starting 2026-05-12 06z
1254
+ if (init_date.tz_localize(None) > pd.to_datetime('2026-05-12')):
1255
+ product = 'oper'
1256
+ search_str = '2t:sfc'
1252
1257
 
1253
1258
  # try n times based loosely on
1254
1259
  # https://thingspython.wordpress.com/2021/12/05/how-to-try-something-n-times-in-python/
@@ -1259,7 +1264,7 @@ def get_solar_forecast_ensemble_subset(
1259
1264
  # try downloading
1260
1265
  ds = FastHerbie(DATES=[init_date],
1261
1266
  model=model_herbie,
1262
- product='enfo',
1267
+ product=product,
1263
1268
  fxx=fxx_range,
1264
1269
  priority=priority).xarray(search_str)
1265
1270
  else:
@@ -1267,7 +1272,7 @@ def get_solar_forecast_ensemble_subset(
1267
1272
  # partial files
1268
1273
  ds = FastHerbie(DATES=[init_date],
1269
1274
  model=model_herbie,
1270
- product='enfo',
1275
+ product=product,
1271
1276
  fxx=fxx_range,
1272
1277
  priority=priority).xarray(search_str,
1273
1278
  overwrite=True)
@@ -1687,10 +1692,16 @@ def get_solar_forecast_ensemble(latitude, longitude, init_date, run_length,
1687
1692
  # get deterministic temp_air using ifs control member
1688
1693
  search_str = ':2t:sfc:g:0001:od:cf:enfo'
1689
1694
  get_control = None
1695
+ product = 'enfo'
1696
+ # account for IFS changes starting 2026-05-12 06z
1697
+ if (init_date.tz_localize(None) > pd.to_datetime('2026-05-12')):
1698
+ product = 'oper'
1699
+ search_str = '2t:sfc'
1690
1700
  elif model == 'aifs_ens':
1691
1701
  search_str = ':2t:sfc:'
1692
1702
  # Herbie kwarg to get control member, https://herbie.readthedocs.io/en/stable/gallery/ecmwf_models/ecmwf.html#AIFS-Ensembles
1693
1703
  get_control = True
1704
+ product = 'enfo'
1694
1705
 
1695
1706
  # try n times based loosely on
1696
1707
  # https://thingspython.wordpress.com/2021/12/05/how-to-try-something-n-times-in-python/
@@ -1701,7 +1712,7 @@ def get_solar_forecast_ensemble(latitude, longitude, init_date, run_length,
1701
1712
  # try downloading
1702
1713
  FH = FastHerbie(DATES=[init_date],
1703
1714
  model=model_herbie,
1704
- product='enfo',
1715
+ product=product,
1705
1716
  fxx=fxx_range,
1706
1717
  priority=priority,
1707
1718
  get_control=get_control,
@@ -1713,7 +1724,7 @@ def get_solar_forecast_ensemble(latitude, longitude, init_date, run_length,
1713
1724
  # partial files
1714
1725
  FH = FastHerbie(DATES=[init_date],
1715
1726
  model=model_herbie,
1716
- product='enfo',
1727
+ product=product,
1717
1728
  fxx=fxx_range,
1718
1729
  priority=priority,
1719
1730
  get_control=get_control,
@@ -131,7 +131,7 @@ def get_fcast_definition(model='gfs'):
131
131
  '2024-03-10 12:00',
132
132
  '2024-03-10 18:00'], # https://herbie.readthedocs.io/en/stable/gallery/ecmwf_models/ecmwf.html#Data-Availability
133
133
  'start_hour': [0, 150, 0],
134
- 'end_hour': [144, 240, 144],
134
+ 'end_hour': [144, 360, 144],
135
135
  'interval': [3, 6, 3],
136
136
  'first_cycle': [0, 0, 6],
137
137
  'update_period': [12, 12, 12],
@@ -760,7 +760,13 @@ def model_input_formatter(init_date, run_length, lead_time_to_start=0,
760
760
  fxx_range = range(lead_time_to_start, fxx_max + 1, 3)
761
761
 
762
762
  # Herbie inputs
763
- if init_date.hour == 6 or init_date.hour == 18:
763
+ init_date = pd.to_datetime(init_date)
764
+ # scda goes away/went away 2026-05-12
765
+ # see https://confluence.ecmwf.int/display/FCST/Implementation+of+IFS+Cycle+50r1
766
+ if (init_date.tz_localize(None) <
767
+ pd.to_datetime('2026-05-12 06:00') and
768
+ (init_date.hour == 6 or
769
+ init_date.hour == 18)):
764
770
  product = 'scda'
765
771
  else:
766
772
  product = 'oper'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hefty
3
- Version: 0.1.2
3
+ Version: 0.1.4
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes