anemoi-datasets 0.3.1__py3-none-any.whl → 0.3.2__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.
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.3.1'
16
- __version_tuple__ = version_tuple = (0, 3, 1)
15
+ __version__ = version = '0.3.2'
16
+ __version_tuple__ = version_tuple = (0, 3, 2)
@@ -8,7 +8,30 @@
8
8
  #
9
9
 
10
10
 
11
+ import importlib
12
+
13
+ import entrypoints
14
+
15
+
11
16
  def assert_is_fieldset(obj):
12
17
  from climetlab.readers.grib.index import FieldSet
13
18
 
14
19
  assert isinstance(obj, FieldSet), type(obj)
20
+
21
+
22
+ def import_function(name, kind):
23
+
24
+ name = name.replace("-", "_")
25
+
26
+ plugins = {}
27
+ for e in entrypoints.get_group_all(f"anemoi.datasets.{kind}s"):
28
+ plugins[e.name.replace("_", "-")] = e
29
+
30
+ if name in plugins:
31
+ return plugins[name].load()
32
+
33
+ module = importlib.import_module(
34
+ f".{kind}.{name}",
35
+ package=__name__,
36
+ )
37
+ return module.execute
@@ -7,7 +7,6 @@
7
7
  # nor does it submit to any jurisdiction.
8
8
  #
9
9
  import datetime
10
- import importlib
11
10
  import logging
12
11
  import time
13
12
  from collections import defaultdict
@@ -21,6 +20,7 @@ from climetlab.indexing.fieldset import FieldSet
21
20
 
22
21
  from anemoi.datasets.dates import Dates
23
22
 
23
+ from .functions import import_function
24
24
  from .template import Context
25
25
  from .template import notify_result
26
26
  from .template import resolve
@@ -65,14 +65,6 @@ def time_delta_to_string(delta):
65
65
  return f"minus_{hours}h"
66
66
 
67
67
 
68
- def import_function(name, kind):
69
- module = importlib.import_module(
70
- f"..functions.{kind}.{name}",
71
- package=__name__,
72
- )
73
- return module.execute
74
-
75
-
76
68
  def is_function(name, kind):
77
69
  name, delta = parse_function_name(name) # noqa
78
70
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: anemoi-datasets
3
- Version: 0.3.1
3
+ Version: 0.3.2
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
@@ -232,9 +232,10 @@ Requires-Dist: zarr <=2.17
232
232
  Provides-Extra: all
233
233
  Requires-Dist: anemoi-utils[provenance] >=0.3 ; extra == 'all'
234
234
  Requires-Dist: boto3 ; extra == 'all'
235
- Requires-Dist: climetlab >=0.22.1 ; extra == 'all'
235
+ Requires-Dist: climetlab >=0.23.2 ; extra == 'all'
236
236
  Requires-Dist: earthkit-meteo ; extra == 'all'
237
237
  Requires-Dist: ecmwflibs >=0.6.3 ; extra == 'all'
238
+ Requires-Dist: entrypoints ; extra == 'all'
238
239
  Requires-Dist: numpy ; extra == 'all'
239
240
  Requires-Dist: pyproj ; extra == 'all'
240
241
  Requires-Dist: pyyaml ; extra == 'all'
@@ -244,13 +245,13 @@ Requires-Dist: semantic-version ; extra == 'all'
244
245
  Requires-Dist: tqdm ; extra == 'all'
245
246
  Requires-Dist: zarr <=2.17 ; extra == 'all'
246
247
  Provides-Extra: create
247
- Requires-Dist: climetlab >=0.22.1 ; extra == 'create'
248
+ Requires-Dist: climetlab >=0.23.2 ; extra == 'create'
248
249
  Requires-Dist: earthkit-meteo ; extra == 'create'
249
250
  Requires-Dist: ecmwflibs >=0.6.3 ; extra == 'create'
251
+ Requires-Dist: entrypoints ; extra == 'create'
250
252
  Requires-Dist: pyproj ; extra == 'create'
251
253
  Provides-Extra: dev
252
254
  Requires-Dist: boto3 ; extra == 'dev'
253
- Requires-Dist: climetlab >=0.22.1 ; extra == 'dev'
254
255
  Requires-Dist: earthkit-meteo ; extra == 'dev'
255
256
  Requires-Dist: ecmwflibs >=0.6.3 ; extra == 'dev'
256
257
  Requires-Dist: nbsphinx ; extra == 'dev'
@@ -1,6 +1,6 @@
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=HzPz9rq3s1AiZXregKlqKaJJ2wGMtvH_a3V9la9CnpM,411
3
+ anemoi/datasets/_version.py,sha256=9jP8Fo8egXoMs_T3DFqSuJYg4n9o9mnwYubl_hnut4k,411
4
4
  anemoi/datasets/grids.py,sha256=3YBMMJodgYhavarXPAlMZHaMtDT9v2IbTmAXZTqf8Qo,8481
5
5
  anemoi/datasets/commands/__init__.py,sha256=qAybFZPBBQs0dyx7dZ3X5JsLpE90pwrqt1vSV7cqEIw,706
6
6
  anemoi/datasets/commands/compare.py,sha256=tN3eqihvnZ0rFc0OUzrfI34PHDlYfc2l90ZIQBE1TDQ,1300
@@ -15,7 +15,7 @@ anemoi/datasets/create/__init__.py,sha256=jji65Zni5aPTvS269fAMix4pN9ukmSoK0z5SVs
15
15
  anemoi/datasets/create/check.py,sha256=DLjw-eyaCNxPhoKFsP4Yn_l3SIr57YHdyPR-tE5vx80,5791
16
16
  anemoi/datasets/create/chunks.py,sha256=YEDcr0K2KiiceSTiBuZzj0TbRbzZ9J546XO7rrrTFQw,2441
17
17
  anemoi/datasets/create/config.py,sha256=uLIp1WHg3hbqwwMV9EepMwJQsXJAGImkbo0okBeEVd4,7683
18
- anemoi/datasets/create/input.py,sha256=UqEIqbsld0whUJUPPVKMfF_LoeKTaTyxP5kBE6zjhsE,27888
18
+ anemoi/datasets/create/input.py,sha256=3G7sqdn7R1pLBeeswXwwi8VRAHrBnjq1PdRYHJBe594,27741
19
19
  anemoi/datasets/create/loaders.py,sha256=BDeb2CI_oWqIGcBnt39nRGIt3r3dK4rIidNO3pBunTk,29865
20
20
  anemoi/datasets/create/patch.py,sha256=xjCLhvIQKRqmypsKInRU1CvFh1uoaB3YGSQP1UVZZik,3682
21
21
  anemoi/datasets/create/persistent.py,sha256=nT8gvhVPdI1H3zW_F7uViGKIlQQ94jCDrMSWTmhQ2_A,4290
@@ -24,7 +24,7 @@ anemoi/datasets/create/template.py,sha256=2roItOYJzjGB0bKS28f6EjfpomP0ppT4v6T9fY
24
24
  anemoi/datasets/create/utils.py,sha256=H1-auNSZUSDW0Aog8CHnIfZlzgKE1XPoi1I40CqquA4,3676
25
25
  anemoi/datasets/create/writer.py,sha256=G1qAPvdn8anGnpWYhvSSP4u3Km_tHKPdMXm0G4skKSk,1379
26
26
  anemoi/datasets/create/zarr.py,sha256=hwM_PaYTa_IgFY1VC7qdYTWQ5MXCWWlMrzXsV_eAY0Q,4776
27
- anemoi/datasets/create/functions/__init__.py,sha256=K-Wi11mZI5Y6od0y6I_apDutoeay7wNrtB1P3-PizgI,513
27
+ anemoi/datasets/create/functions/__init__.py,sha256=PIsSTy0JNGKaPz1W7O6lt6CmZx44swip13ecGJpAatE,939
28
28
  anemoi/datasets/create/functions/filters/__init__.py,sha256=Xe9G54CKvCI3ji-7k0R5l0WZZdhlydRgawsXuBcX_hg,379
29
29
  anemoi/datasets/create/functions/filters/empty.py,sha256=X7gAZS_jl9X0ztGs3Arn8DkOB6iP4Draq4EAKa4I8hc,617
30
30
  anemoi/datasets/create/functions/filters/noop.py,sha256=ZP434Z1rFlqdgXse_1ZzqC2XAqRQlYlXlVfGLx7rK8g,444
@@ -66,9 +66,9 @@ anemoi/datasets/data/unchecked.py,sha256=qeUKthbvVVSPH-P366q1DEofvPzZSSXCXA49x-R
66
66
  anemoi/datasets/dates/__init__.py,sha256=zOph2N_mXYbjSvqEWYF1mmm-UZpljb61WLrdFJmi0qQ,4469
67
67
  anemoi/datasets/dates/groups.py,sha256=iq310Pi7ullglOhcNblv14MmcT8FPgYCD5s45qAfV_s,3383
68
68
  anemoi/datasets/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
- anemoi_datasets-0.3.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
70
- anemoi_datasets-0.3.1.dist-info/METADATA,sha256=cLrTNyT23kitgUq05PNMK5Ni-pI2AMwdzy4dOh7jZjo,16050
71
- anemoi_datasets-0.3.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
72
- anemoi_datasets-0.3.1.dist-info/entry_points.txt,sha256=yR-o-4uiPEA_GLBL81SkMYnUoxq3CAV3hHulQiRtGG0,66
73
- anemoi_datasets-0.3.1.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
74
- anemoi_datasets-0.3.1.dist-info/RECORD,,
69
+ anemoi_datasets-0.3.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
70
+ anemoi_datasets-0.3.2.dist-info/METADATA,sha256=Cx_08Q23kUn25ZOUV4yd8PRRdtDdg6_mwNrGNz_5TVk,16090
71
+ anemoi_datasets-0.3.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
72
+ anemoi_datasets-0.3.2.dist-info/entry_points.txt,sha256=yR-o-4uiPEA_GLBL81SkMYnUoxq3CAV3hHulQiRtGG0,66
73
+ anemoi_datasets-0.3.2.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
74
+ anemoi_datasets-0.3.2.dist-info/RECORD,,