anemoi-datasets 0.5.29__py3-none-any.whl → 0.5.30__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.
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.5.29'
32
- __version_tuple__ = version_tuple = (0, 5, 29)
31
+ __version__ = version = '0.5.30'
32
+ __version_tuple__ = version_tuple = (0, 5, 30)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -32,6 +32,7 @@ class FieldToInterval:
32
32
  "start_step_is_zero",
33
33
  "start_step_is_end_step",
34
34
  "start_step_greater_than_end_step",
35
+ "set_start_step_to_zero",
35
36
  ):
36
37
  raise ValueError(f"Unknown patch key: {key}")
37
38
 
@@ -45,6 +46,9 @@ class FieldToInterval:
45
46
 
46
47
  LOG.debug(f" field before patching: {startStep=}, {endStep=}")
47
48
 
49
+ if self.patches.get("set_start_step_to_zero", False):
50
+ startStep, endStep = 0, endStep
51
+
48
52
  if startStep > endStep:
49
53
  startStep, endStep = self.start_step_greater_than_end_step(startStep, endStep, field=field)
50
54
  elif startStep == endStep:
@@ -106,21 +106,18 @@ class GribIndex:
106
106
  """Create the necessary tables in the database."""
107
107
  assert self.update
108
108
 
109
- self.cursor.execute(
110
- """
109
+ self.cursor.execute("""
111
110
  CREATE TABLE IF NOT EXISTS paths (
112
111
  id INTEGER PRIMARY KEY,
113
112
  path TEXT not null
114
113
  )
115
- """
116
- )
114
+ """)
117
115
 
118
116
  columns = ("valid_datetime",)
119
117
  # We don't use NULL as a default because NULL is considered a different value
120
118
  # in UNIQUE INDEX constraints (https://www.sqlite.org/lang_createindex.html)
121
119
 
122
- self.cursor.execute(
123
- f"""
120
+ self.cursor.execute(f"""
124
121
  CREATE TABLE IF NOT EXISTS grib_index (
125
122
  _id INTEGER PRIMARY KEY,
126
123
  _path_id INTEGER not null,
@@ -128,30 +125,23 @@ class GribIndex:
128
125
  _length INTEGER not null,
129
126
  {', '.join(f"{key} TEXT not null default ''" for key in columns)},
130
127
  FOREIGN KEY(_path_id) REFERENCES paths(id))
131
- """
132
- ) # ,
128
+ """) # ,
133
129
 
134
- self.cursor.execute(
135
- """
130
+ self.cursor.execute("""
136
131
  CREATE UNIQUE INDEX IF NOT EXISTS idx_grib_index_path_offset
137
132
  ON grib_index (_path_id, _offset)
138
- """
139
- )
133
+ """)
140
134
 
141
- self.cursor.execute(
142
- f"""
135
+ self.cursor.execute(f"""
143
136
  CREATE UNIQUE INDEX IF NOT EXISTS idx_grib_index_all_keys
144
137
  ON grib_index ({', '.join(columns)})
145
- """
146
- )
138
+ """)
147
139
 
148
140
  for key in columns:
149
- self.cursor.execute(
150
- f"""
141
+ self.cursor.execute(f"""
151
142
  CREATE INDEX IF NOT EXISTS idx_grib_index_{key}
152
143
  ON grib_index ({key})
153
- """
154
- )
144
+ """)
155
145
 
156
146
  self._commit()
157
147
 
@@ -267,20 +257,16 @@ class GribIndex:
267
257
  self.cursor.execute("""DROP INDEX IF EXISTS idx_grib_index_all_keys""")
268
258
  all_columns = self._all_columns()
269
259
 
270
- self.cursor.execute(
271
- f"""
260
+ self.cursor.execute(f"""
272
261
  CREATE UNIQUE INDEX IF NOT EXISTS idx_grib_index_all_keys
273
262
  ON grib_index ({', '.join(all_columns)})
274
- """
275
- )
263
+ """)
276
264
 
277
265
  for key in all_columns:
278
- self.cursor.execute(
279
- f"""
266
+ self.cursor.execute(f"""
280
267
  CREATE INDEX IF NOT EXISTS idx_grib_index_{key}
281
268
  ON grib_index ({key})
282
- """
283
- )
269
+ """)
284
270
 
285
271
  def add_grib_file(self, path: str) -> None:
286
272
  """Add a GRIB file to the database.
@@ -542,9 +528,7 @@ class GribIndex:
542
528
  dates = [d.isoformat() for d in dates]
543
529
 
544
530
  query = """SELECT _path_id, _offset, _length
545
- FROM grib_index WHERE valid_datetime IN ({})""".format(
546
- ", ".join("?" for _ in dates)
547
- )
531
+ FROM grib_index WHERE valid_datetime IN ({})""".format(", ".join("?" for _ in dates))
548
532
  params = dates
549
533
 
550
534
  for k, v in kwargs.items():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anemoi-datasets
3
- Version: 0.5.29
3
+ Version: 0.5.30
4
4
  Summary: A package to hold various functions to support training of ML models on ECMWF data.
5
5
  Author-email: "European Centre for Medium-Range Weather Forecasts (ECMWF)" <software.support@ecmwf.int>
6
6
  License: Apache License
@@ -218,9 +218,10 @@ Classifier: Operating System :: OS Independent
218
218
  Classifier: Programming Language :: Python :: 3 :: Only
219
219
  Classifier: Programming Language :: Python :: 3.11
220
220
  Classifier: Programming Language :: Python :: 3.12
221
+ Classifier: Programming Language :: Python :: 3.13
221
222
  Classifier: Programming Language :: Python :: Implementation :: CPython
222
223
  Classifier: Programming Language :: Python :: Implementation :: PyPy
223
- Requires-Python: >=3.11
224
+ Requires-Python: <3.14,>=3.11
224
225
  License-File: LICENSE
225
226
  Requires-Dist: anemoi-transform>=0.1.12
226
227
  Requires-Dist: anemoi-utils>=0.4.26
@@ -235,7 +236,7 @@ Requires-Dist: pyyaml
235
236
  Requires-Dist: ruamel-yaml>=0.16
236
237
  Requires-Dist: semantic-version
237
238
  Requires-Dist: tqdm
238
- Requires-Dist: zarr<=2.18.4
239
+ Requires-Dist: zarr<=2.18.7
239
240
  Provides-Extra: all
240
241
  Requires-Dist: anemoi-datasets[comparelam,create,remote,xarray]; extra == "all"
241
242
  Provides-Extra: comparelam
@@ -1,6 +1,6 @@
1
1
  anemoi/datasets/__init__.py,sha256=SPozLbLUFiQ9rtFVRlgeOobFUiFzj-jGo85Tt4YMJp4,1041
2
2
  anemoi/datasets/__main__.py,sha256=ErwAqE3rBc7OaNO2JRsEOhWpB8ldjAt7BFSuRhbnlqQ,936
3
- anemoi/datasets/_version.py,sha256=xSW5Ca_VuAUJfDmwl-rcc_fibXugpSpq_USIiH1ouFM,706
3
+ anemoi/datasets/_version.py,sha256=nlDBoPHNkA36lz3zWwFvhf44VnMEtmYAEf4dXn6AUnU,706
4
4
  anemoi/datasets/check.py,sha256=hbEMUurl2IjZbp56dBgOfAEsAmmgymgRM5ySaMJSTdk,2755
5
5
  anemoi/datasets/dumper.py,sha256=Jud4qGooSQjJcPHsJrrYiJ909nM-hvJGXEDK4kfZ0k4,2505
6
6
  anemoi/datasets/grids.py,sha256=ugJZznQ4frWH2qlYzV5ds4QLbzsGHwI_q5erVxocFxE,13926
@@ -62,7 +62,7 @@ anemoi/datasets/create/sources/empty.py,sha256=QQzbI2NJ0Z4X9DvECKJkqDiCO_SfzpBUp
62
62
  anemoi/datasets/create/sources/fdb.py,sha256=AkxvW7vZqJs2AbwYEzfkU5j3Udk4gTaGx2Pbwsa5qNk,4396
63
63
  anemoi/datasets/create/sources/forcings.py,sha256=hy1oyC1Zjg1uzO2UWfNiTJXfQRaM_B8vs8X7GXXO4Nc,1356
64
64
  anemoi/datasets/create/sources/grib.py,sha256=G1qLyZYZxUFr54IIrRQbeKTnpkZ5zjFH16_f-m6gurY,5060
65
- anemoi/datasets/create/sources/grib_index.py,sha256=QFdWZa50BxrXY4HMS3h-4mTJt-EyI9KvYxaP_N4Ilg4,20917
65
+ anemoi/datasets/create/sources/grib_index.py,sha256=yHiT6ZSZLid6OJ74WPzI5UaebnIaAvL1ZMZmEiPnhk0,20725
66
66
  anemoi/datasets/create/sources/hindcasts.py,sha256=4QuTSbaP5SfGFOdRSqm4jf__r7tMFx0lgPOlOVC6BEg,2773
67
67
  anemoi/datasets/create/sources/legacy.py,sha256=Lv8MgFvdpP6ygu6_wGI47dpq7nuvuSbaHJAiUGqC4z8,1254
68
68
  anemoi/datasets/create/sources/mars.py,sha256=OQVgdikBP__CYEPc82ClKgm-dxC9Pqsd44w55Vz1VJo,14625
@@ -79,7 +79,7 @@ anemoi/datasets/create/sources/xarray_zarr.py,sha256=tOcA1rUam0rwAYSIXe2QB9cSNW-
79
79
  anemoi/datasets/create/sources/zenodo.py,sha256=6NvK5KLMtb39a-YBs44sgPyc2k9NZU6oeYNbU8Lh98g,2259
80
80
  anemoi/datasets/create/sources/accumulate_utils/__init__.py,sha256=iLLlOculEHrloIO13MSrYGEMNBZ1vVwK9x9rxKXLK-M,393
81
81
  anemoi/datasets/create/sources/accumulate_utils/covering_intervals.py,sha256=Hm0pIATDl9zK_tAjDkhxlRa9yUUbaHKpHH_0igSv3Tk,7642
82
- anemoi/datasets/create/sources/accumulate_utils/field_to_interval.py,sha256=z-p2oDGJ0VPU5AXjgloLsL1ho5l_dmITCN7AVx9iGTU,5760
82
+ anemoi/datasets/create/sources/accumulate_utils/field_to_interval.py,sha256=maqgUvWVyNRJPsHvD1aMTB0D5QelmznoR5C6Wmeesk4,5909
83
83
  anemoi/datasets/create/sources/accumulate_utils/interval_generators.py,sha256=vqtHiKFUavnK26uUYdOOsPbUcyzgUnwxhQ_cydooNyU,13092
84
84
  anemoi/datasets/create/sources/xarray_support/README.md,sha256=56olM9Jh0vI0_bU9GI-IqbBcz4DZXWONqvdzN_VeAFE,78
85
85
  anemoi/datasets/create/sources/xarray_support/__init__.py,sha256=nYmNSwOX1g8JEEsnV9jnlK1jRbUqdGnvoL-AuqHNx7E,4943
@@ -128,9 +128,9 @@ anemoi/datasets/data/records/backends/__init__.py,sha256=u894d7duXMiGTOQh5WfuxTs
128
128
  anemoi/datasets/dates/__init__.py,sha256=4WFEG8tujrXOT6nbpy6BufBqcqGfECnvG42rmxgLh9w,13476
129
129
  anemoi/datasets/dates/groups.py,sha256=bdA6YjFtNlgFAXiov5-zFHZ3C_QtUrdQiSFgb2zWxVM,10034
130
130
  anemoi/datasets/schemas/recipe.json,sha256=UvfOQYKcTz-OrJv4is-qe-rhUNBrrmpcpXF32jB0Oz4,3208
131
- anemoi_datasets-0.5.29.dist-info/licenses/LICENSE,sha256=8HznKF1Vi2IvfLsKNE5A2iVyiri3pRjRPvPC9kxs6qk,11354
132
- anemoi_datasets-0.5.29.dist-info/METADATA,sha256=k0V8RvM-V88rDBfd_Ew0e-NW9b5BzCIlgeIfLjvlxFY,16181
133
- anemoi_datasets-0.5.29.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
134
- anemoi_datasets-0.5.29.dist-info/entry_points.txt,sha256=yR-o-4uiPEA_GLBL81SkMYnUoxq3CAV3hHulQiRtGG0,66
135
- anemoi_datasets-0.5.29.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
136
- anemoi_datasets-0.5.29.dist-info/RECORD,,
131
+ anemoi_datasets-0.5.30.dist-info/licenses/LICENSE,sha256=8HznKF1Vi2IvfLsKNE5A2iVyiri3pRjRPvPC9kxs6qk,11354
132
+ anemoi_datasets-0.5.30.dist-info/METADATA,sha256=7jOQpPGb_2fRLu2Ov0dVcTvWDZoriS-X-JNDITuBXdk,16238
133
+ anemoi_datasets-0.5.30.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
134
+ anemoi_datasets-0.5.30.dist-info/entry_points.txt,sha256=yR-o-4uiPEA_GLBL81SkMYnUoxq3CAV3hHulQiRtGG0,66
135
+ anemoi_datasets-0.5.30.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
136
+ anemoi_datasets-0.5.30.dist-info/RECORD,,