anemoi-datasets 0.3.5__py3-none-any.whl → 0.3.6__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.
- anemoi/datasets/_version.py +2 -2
- anemoi/datasets/commands/compare.py +2 -0
- anemoi/datasets/compute/recentre.py +1 -1
- anemoi/datasets/create/functions/filters/rename.py +14 -0
- anemoi/datasets/create/loaders.py +6 -3
- anemoi/datasets/data/misc.py +3 -3
- {anemoi_datasets-0.3.5.dist-info → anemoi_datasets-0.3.6.dist-info}/METADATA +6 -10
- {anemoi_datasets-0.3.5.dist-info → anemoi_datasets-0.3.6.dist-info}/RECORD +12 -12
- {anemoi_datasets-0.3.5.dist-info → anemoi_datasets-0.3.6.dist-info}/LICENSE +0 -0
- {anemoi_datasets-0.3.5.dist-info → anemoi_datasets-0.3.6.dist-info}/WHEEL +0 -0
- {anemoi_datasets-0.3.5.dist-info → anemoi_datasets-0.3.6.dist-info}/entry_points.txt +0 -0
- {anemoi_datasets-0.3.5.dist-info → anemoi_datasets-0.3.6.dist-info}/top_level.txt +0 -0
anemoi/datasets/_version.py
CHANGED
|
@@ -14,6 +14,8 @@ from . import Command
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class Compare(Command):
|
|
17
|
+
"""Compare two datasets. This command compares the variables in two datasets and prints the mean of the common variables. It does not compare the data itself (yet)."""
|
|
18
|
+
|
|
17
19
|
def add_arguments(self, command_parser):
|
|
18
20
|
command_parser.add_argument("dataset1")
|
|
19
21
|
command_parser.add_argument("dataset2")
|
|
@@ -29,7 +29,7 @@ CLIP_VARIABLES = (
|
|
|
29
29
|
"swl1",
|
|
30
30
|
)
|
|
31
31
|
|
|
32
|
-
SKIP = ("class", "stream", "type", "number", "expver", "_leg_number", "anoffset")
|
|
32
|
+
SKIP = ("class", "stream", "type", "number", "expver", "_leg_number", "anoffset", "time", "date", "step")
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def check_compatible(f1, f2, centre_field_as_mars, ensemble_field_as_mars):
|
|
@@ -13,6 +13,14 @@ from climetlab.indexing.fieldset import FieldArray
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class RenamedFieldMapping:
|
|
16
|
+
"""Rename a field based on the value of another field.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
field (Field): The field to be renamed.
|
|
20
|
+
what (str): The name of the field that will be used to rename the field.
|
|
21
|
+
renaming (dict): A dictionary mapping the values of 'what' to the new names.
|
|
22
|
+
"""
|
|
23
|
+
|
|
16
24
|
def __init__(self, field, what, renaming):
|
|
17
25
|
self.field = field
|
|
18
26
|
self.what = what
|
|
@@ -29,6 +37,12 @@ class RenamedFieldMapping:
|
|
|
29
37
|
|
|
30
38
|
|
|
31
39
|
class RenamedFieldFormat:
|
|
40
|
+
"""Rename a field based on a format string.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
format (str): A string that defines the new name of the field.
|
|
44
|
+
"""
|
|
45
|
+
|
|
32
46
|
def __init__(self, field, format):
|
|
33
47
|
self.field = field
|
|
34
48
|
self.format = format
|
|
@@ -177,11 +177,14 @@ class InitialiserLoader(Loader):
|
|
|
177
177
|
return
|
|
178
178
|
if isinstance(obj, (dict, DictObj)):
|
|
179
179
|
if "grid" in obj:
|
|
180
|
+
previous = obj["grid"]
|
|
180
181
|
obj["grid"] = "20./20."
|
|
181
|
-
LOG.warn(f"Running in test mode. Setting grid to {obj['grid']}")
|
|
182
|
+
LOG.warn(f"Running in test mode. Setting grid to {obj['grid']} instead of {previous}")
|
|
182
183
|
if "number" in obj:
|
|
183
|
-
obj["number"]
|
|
184
|
-
|
|
184
|
+
if isinstance(obj["number"], (list, tuple)):
|
|
185
|
+
previous = obj["number"]
|
|
186
|
+
obj["number"] = previous[0:3]
|
|
187
|
+
LOG.warn(f"Running in test mode. Setting number to {obj['number']} instead of {previous}")
|
|
185
188
|
for k, v in obj.items():
|
|
186
189
|
set_to_test_mode(v)
|
|
187
190
|
|
anemoi/datasets/data/misc.py
CHANGED
|
@@ -133,9 +133,9 @@ def _as_date(d, dates, last):
|
|
|
133
133
|
|
|
134
134
|
if "-" in d and ":" in d:
|
|
135
135
|
date, time = d.replace(" ", "T").split("T")
|
|
136
|
-
year, month, day = date.split("-")
|
|
137
|
-
hour, minute, second = time.split(":")
|
|
138
|
-
return np.datetime64(f"{year:04}-{month:02}-{day:02}T{hour}:{minute}:{second}")
|
|
136
|
+
year, month, day = [int(_) for _ in date.split("-")]
|
|
137
|
+
hour, minute, second = [int(_) for _ in time.split(":")]
|
|
138
|
+
return np.datetime64(f"{year:04}-{month:02}-{day:02}T{hour:02}:{minute:02}:{second:02}")
|
|
139
139
|
|
|
140
140
|
if "-" in d:
|
|
141
141
|
assert ":" not in d
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: anemoi-datasets
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.6
|
|
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
|
|
@@ -230,21 +230,14 @@ Requires-Dist: semantic-version
|
|
|
230
230
|
Requires-Dist: tqdm
|
|
231
231
|
Requires-Dist: zarr <=2.17
|
|
232
232
|
Provides-Extra: all
|
|
233
|
-
Requires-Dist: anemoi-utils[provenance] >=0.3 ; extra == 'all'
|
|
234
233
|
Requires-Dist: boto3 ; extra == 'all'
|
|
235
234
|
Requires-Dist: climetlab >=0.23.2 ; extra == 'all'
|
|
236
235
|
Requires-Dist: earthkit-meteo ; extra == 'all'
|
|
237
236
|
Requires-Dist: ecmwflibs >=0.6.3 ; extra == 'all'
|
|
238
237
|
Requires-Dist: entrypoints ; extra == 'all'
|
|
239
|
-
Requires-Dist: numpy ; extra == 'all'
|
|
240
238
|
Requires-Dist: pyproj ; extra == 'all'
|
|
241
|
-
Requires-Dist: pytest ; extra == 'all'
|
|
242
|
-
Requires-Dist: pyyaml ; extra == 'all'
|
|
243
239
|
Requires-Dist: requests ; extra == 'all'
|
|
244
240
|
Requires-Dist: s3fs ; extra == 'all'
|
|
245
|
-
Requires-Dist: semantic-version ; extra == 'all'
|
|
246
|
-
Requires-Dist: tqdm ; extra == 'all'
|
|
247
|
-
Requires-Dist: zarr <=2.17 ; extra == 'all'
|
|
248
241
|
Provides-Extra: create
|
|
249
242
|
Requires-Dist: climetlab >=0.23.2 ; extra == 'create'
|
|
250
243
|
Requires-Dist: earthkit-meteo ; extra == 'create'
|
|
@@ -253,11 +246,14 @@ Requires-Dist: entrypoints ; extra == 'create'
|
|
|
253
246
|
Requires-Dist: pyproj ; extra == 'create'
|
|
254
247
|
Provides-Extra: dev
|
|
255
248
|
Requires-Dist: boto3 ; extra == 'dev'
|
|
249
|
+
Requires-Dist: climetlab >=0.23.2 ; extra == 'dev'
|
|
256
250
|
Requires-Dist: earthkit-meteo ; extra == 'dev'
|
|
257
251
|
Requires-Dist: ecmwflibs >=0.6.3 ; extra == 'dev'
|
|
252
|
+
Requires-Dist: entrypoints ; extra == 'dev'
|
|
258
253
|
Requires-Dist: nbsphinx ; extra == 'dev'
|
|
259
254
|
Requires-Dist: pandoc ; extra == 'dev'
|
|
260
255
|
Requires-Dist: pyproj ; extra == 'dev'
|
|
256
|
+
Requires-Dist: pytest ; extra == 'dev'
|
|
261
257
|
Requires-Dist: requests ; extra == 'dev'
|
|
262
258
|
Requires-Dist: s3fs ; extra == 'dev'
|
|
263
259
|
Requires-Dist: sphinx ; extra == 'dev'
|
|
@@ -273,6 +269,6 @@ Provides-Extra: remote
|
|
|
273
269
|
Requires-Dist: boto3 ; extra == 'remote'
|
|
274
270
|
Requires-Dist: requests ; extra == 'remote'
|
|
275
271
|
Requires-Dist: s3fs ; extra == 'remote'
|
|
276
|
-
Provides-Extra:
|
|
277
|
-
Requires-Dist: pytest ; extra == '
|
|
272
|
+
Provides-Extra: tests
|
|
273
|
+
Requires-Dist: pytest ; extra == 'tests'
|
|
278
274
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
anemoi/datasets/__init__.py,sha256=DC7ttKT--pmhBQALX_Cn7P28dngsJucKi5y-Ydm28QM,700
|
|
2
2
|
anemoi/datasets/__main__.py,sha256=cLA2PidDTOUHaDGzd0_E5iioKYNe-PSTv567Y2fuwQk,723
|
|
3
|
-
anemoi/datasets/_version.py,sha256=
|
|
3
|
+
anemoi/datasets/_version.py,sha256=IKAQ4gPrCQ2FWMXOFRqouULC2EQI1zCb4iXHsnfbmTQ,411
|
|
4
4
|
anemoi/datasets/grids.py,sha256=3YBMMJodgYhavarXPAlMZHaMtDT9v2IbTmAXZTqf8Qo,8481
|
|
5
5
|
anemoi/datasets/commands/__init__.py,sha256=qAybFZPBBQs0dyx7dZ3X5JsLpE90pwrqt1vSV7cqEIw,706
|
|
6
|
-
anemoi/datasets/commands/compare.py,sha256=
|
|
6
|
+
anemoi/datasets/commands/compare.py,sha256=p2jQOAC3JhScCLF0GjTCO8goYLWLN8p7vzy_gf5fFcI,1473
|
|
7
7
|
anemoi/datasets/commands/copy.py,sha256=fba-zjD0iTHHXHhPEcm8VhDzsXQXDUxlbtTA1TovyT0,9991
|
|
8
8
|
anemoi/datasets/commands/create.py,sha256=POdOsVDlvRrHFFkI3SNXNgNIbSxkVUUPMoo660x7Ma0,987
|
|
9
9
|
anemoi/datasets/commands/inspect.py,sha256=G3fzcgiLaU8jln7GKvgamN7Y06-qC_JnFw2SbNn1_E4,18646
|
|
10
10
|
anemoi/datasets/commands/scan.py,sha256=HxsLdCgBMSdEXjlJfPq5M_9LxXHHQIoZ1ZEHO_AoPgA,2881
|
|
11
11
|
anemoi/datasets/compute/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
anemoi/datasets/compute/recentre.py,sha256=
|
|
12
|
+
anemoi/datasets/compute/recentre.py,sha256=GRxI6rY_KyXJnZGPxU_UO9YDb-rY_raK70Fiwv1mjhs,4792
|
|
13
13
|
anemoi/datasets/create/__init__.py,sha256=jji65Zni5aPTvS269fAMix4pN9ukmSoK0z5SVsbpr5E,5807
|
|
14
14
|
anemoi/datasets/create/check.py,sha256=DLjw-eyaCNxPhoKFsP4Yn_l3SIr57YHdyPR-tE5vx80,5791
|
|
15
15
|
anemoi/datasets/create/chunks.py,sha256=YEDcr0K2KiiceSTiBuZzj0TbRbzZ9J546XO7rrrTFQw,2441
|
|
16
16
|
anemoi/datasets/create/config.py,sha256=uLIp1WHg3hbqwwMV9EepMwJQsXJAGImkbo0okBeEVd4,7683
|
|
17
17
|
anemoi/datasets/create/input.py,sha256=3G7sqdn7R1pLBeeswXwwi8VRAHrBnjq1PdRYHJBe594,27741
|
|
18
|
-
anemoi/datasets/create/loaders.py,sha256=
|
|
18
|
+
anemoi/datasets/create/loaders.py,sha256=Y9HwH_yPDvnrOTpXVwZxB6VKqGYrHC4xMKhizUhR4lU,30081
|
|
19
19
|
anemoi/datasets/create/patch.py,sha256=xjCLhvIQKRqmypsKInRU1CvFh1uoaB3YGSQP1UVZZik,3682
|
|
20
20
|
anemoi/datasets/create/persistent.py,sha256=nT8gvhVPdI1H3zW_F7uViGKIlQQ94jCDrMSWTmhQ2_A,4290
|
|
21
21
|
anemoi/datasets/create/size.py,sha256=A1w6RkaL0L9IlwIdmYsCTJTecmY_QtvbkGf__jvQle0,1068
|
|
@@ -27,7 +27,7 @@ anemoi/datasets/create/functions/__init__.py,sha256=v5RRSAK8LiNdPbxy0c9WxqMx3AMH
|
|
|
27
27
|
anemoi/datasets/create/functions/filters/__init__.py,sha256=Xe9G54CKvCI3ji-7k0R5l0WZZdhlydRgawsXuBcX_hg,379
|
|
28
28
|
anemoi/datasets/create/functions/filters/empty.py,sha256=X7gAZS_jl9X0ztGs3Arn8DkOB6iP4Draq4EAKa4I8hc,617
|
|
29
29
|
anemoi/datasets/create/functions/filters/noop.py,sha256=ZP434Z1rFlqdgXse_1ZzqC2XAqRQlYlXlVfGLx7rK8g,444
|
|
30
|
-
anemoi/datasets/create/functions/filters/rename.py,sha256=
|
|
30
|
+
anemoi/datasets/create/functions/filters/rename.py,sha256=cGoHr-IS-PhYEtZvXDpH03gtfZ9uT7uEZqu9EDxAxN0,2105
|
|
31
31
|
anemoi/datasets/create/functions/filters/rotate_winds.py,sha256=fUdh8ILcMzMzckGlvwzdgG-c7w5R9NnWfaijp28Bf5M,4092
|
|
32
32
|
anemoi/datasets/create/functions/filters/unrotate_winds.py,sha256=nsa3EHly8ppWd2WH4ROoMczM8WFu5qKaIhO_UFcL9TY,3502
|
|
33
33
|
anemoi/datasets/create/functions/sources/__init__.py,sha256=Xe9G54CKvCI3ji-7k0R5l0WZZdhlydRgawsXuBcX_hg,379
|
|
@@ -56,7 +56,7 @@ anemoi/datasets/data/grids.py,sha256=rooOeR6rvjl4U8B4LO3N23fcgxvGE7ZUmhVryk1QS4M
|
|
|
56
56
|
anemoi/datasets/data/indexing.py,sha256=625m__JG5m_tDMrkz1hB6Vydenwt0oHuyAlc-o3Zwos,4799
|
|
57
57
|
anemoi/datasets/data/join.py,sha256=dtCBbMTicqrRPxfBULi3RwEcQBLhQpIcvCjdN5A3XUU,4892
|
|
58
58
|
anemoi/datasets/data/masked.py,sha256=Fzkehyka70CiS0LYSy_uyVYu2gKLwDSxlbm8GiC_pYs,3742
|
|
59
|
-
anemoi/datasets/data/misc.py,sha256=
|
|
59
|
+
anemoi/datasets/data/misc.py,sha256=cu2rMNtq8M8yzcR1CGHHQksE0p9C2SLVigOTMH6ilMs,10400
|
|
60
60
|
anemoi/datasets/data/select.py,sha256=U3AEid80mrJKu0SF4lLc-bRWMVcAZwHNUHUHRehvuHU,3680
|
|
61
61
|
anemoi/datasets/data/statistics.py,sha256=PKRgcCiZEb1HjkIveVGhE3TzUy9Qe3AYWGFD72Urah8,1514
|
|
62
62
|
anemoi/datasets/data/stores.py,sha256=oEjUra0zzIysiUvh-RBQRzcbviggejEQiMO5RfpjPyM,10896
|
|
@@ -65,9 +65,9 @@ anemoi/datasets/data/unchecked.py,sha256=xhdMg-ToI1UfBWHNsWyn1y2meZWngZtHx-33L0K
|
|
|
65
65
|
anemoi/datasets/dates/__init__.py,sha256=4ItowfLLh90T8L_JOjtv98lE6M7gAaWt7dV3niUrFvk,4473
|
|
66
66
|
anemoi/datasets/dates/groups.py,sha256=iq310Pi7ullglOhcNblv14MmcT8FPgYCD5s45qAfV_s,3383
|
|
67
67
|
anemoi/datasets/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
|
-
anemoi_datasets-0.3.
|
|
69
|
-
anemoi_datasets-0.3.
|
|
70
|
-
anemoi_datasets-0.3.
|
|
71
|
-
anemoi_datasets-0.3.
|
|
72
|
-
anemoi_datasets-0.3.
|
|
73
|
-
anemoi_datasets-0.3.
|
|
68
|
+
anemoi_datasets-0.3.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
69
|
+
anemoi_datasets-0.3.6.dist-info/METADATA,sha256=sEnXtS3eh-ix9Z1aR8RFDqBlnmK-XE6A42ga2uE_Utc,16017
|
|
70
|
+
anemoi_datasets-0.3.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
71
|
+
anemoi_datasets-0.3.6.dist-info/entry_points.txt,sha256=yR-o-4uiPEA_GLBL81SkMYnUoxq3CAV3hHulQiRtGG0,66
|
|
72
|
+
anemoi_datasets-0.3.6.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
|
|
73
|
+
anemoi_datasets-0.3.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|