anemoi-datasets 0.5.10__py3-none-any.whl → 0.5.12__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/create/__init__.py +1 -2
- anemoi/datasets/create/functions/filters/rename.py +0 -1
- anemoi/datasets/create/functions/sources/grib.py +6 -0
- anemoi/datasets/create/functions/sources/xarray/__init__.py +0 -1
- anemoi/datasets/create/functions/sources/xarray/field.py +3 -3
- anemoi/datasets/create/functions/sources/xarray/fieldlist.py +0 -2
- anemoi/datasets/create/functions/sources/xarray/variable.py +0 -3
- anemoi/datasets/create/input/action.py +0 -6
- anemoi/datasets/create/input/context.py +0 -6
- anemoi/datasets/create/input/data_sources.py +0 -7
- anemoi/datasets/create/input/empty.py +0 -7
- anemoi/datasets/create/input/filter.py +0 -7
- anemoi/datasets/create/input/function.py +0 -7
- anemoi/datasets/create/input/misc.py +0 -6
- anemoi/datasets/create/input/pipe.py +6 -1
- anemoi/datasets/create/input/repeated_dates.py +11 -6
- anemoi/datasets/create/input/result.py +0 -6
- anemoi/datasets/create/input/step.py +0 -7
- anemoi/datasets/data/dataset.py +6 -1
- anemoi/datasets/data/grids.py +6 -4
- anemoi/datasets/data/join.py +8 -1
- anemoi/datasets/dates/groups.py +1 -1
- {anemoi_datasets-0.5.10.dist-info → anemoi_datasets-0.5.12.dist-info}/METADATA +26 -27
- {anemoi_datasets-0.5.10.dist-info → anemoi_datasets-0.5.12.dist-info}/RECORD +29 -30
- {anemoi_datasets-0.5.10.dist-info → anemoi_datasets-0.5.12.dist-info}/WHEEL +1 -1
- anemoi/datasets/fields.py +0 -68
- {anemoi_datasets-0.5.10.dist-info → anemoi_datasets-0.5.12.dist-info}/LICENSE +0 -0
- {anemoi_datasets-0.5.10.dist-info → anemoi_datasets-0.5.12.dist-info}/entry_points.txt +0 -0
- {anemoi_datasets-0.5.10.dist-info → anemoi_datasets-0.5.12.dist-info}/top_level.txt +0 -0
anemoi/datasets/_version.py
CHANGED
|
@@ -19,7 +19,6 @@ from functools import cached_property
|
|
|
19
19
|
import cftime
|
|
20
20
|
import numpy as np
|
|
21
21
|
import tqdm
|
|
22
|
-
from anemoi.utils.config import DotDict as DotDict
|
|
23
22
|
from anemoi.utils.dates import as_datetime
|
|
24
23
|
from anemoi.utils.dates import frequency_to_string
|
|
25
24
|
from anemoi.utils.dates import frequency_to_timedelta
|
|
@@ -327,7 +326,7 @@ class HasElementForDataMixin:
|
|
|
327
326
|
self.output = build_output(config.output, parent=self)
|
|
328
327
|
|
|
329
328
|
self.input = build_input_(main_config=config, output_config=self.output)
|
|
330
|
-
LOG.info(self.input)
|
|
329
|
+
LOG.info("%s", self.input)
|
|
331
330
|
|
|
332
331
|
|
|
333
332
|
def build_input_(main_config, output_config):
|
|
@@ -9,11 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
import glob
|
|
12
|
+
import logging
|
|
12
13
|
|
|
13
14
|
from earthkit.data import from_source
|
|
14
15
|
from earthkit.data.indexing.fieldlist import FieldArray
|
|
15
16
|
from earthkit.data.utils.patterns import Pattern
|
|
16
17
|
|
|
18
|
+
LOG = logging.getLogger(__name__)
|
|
19
|
+
|
|
17
20
|
|
|
18
21
|
def _load(context, name, record):
|
|
19
22
|
ds = None
|
|
@@ -141,4 +144,7 @@ def execute(context, dates, path, latitudes=None, longitudes=None, *args, **kwar
|
|
|
141
144
|
if geography is not None:
|
|
142
145
|
ds = FieldArray([AddGrid(_, geography) for _ in ds])
|
|
143
146
|
|
|
147
|
+
if len(ds) == 0:
|
|
148
|
+
LOG.warning(f"No fields found for {dates} in {given_paths} (kwargs={kwargs})")
|
|
149
|
+
|
|
144
150
|
return ds
|
|
@@ -12,7 +12,6 @@ import logging
|
|
|
12
12
|
from earthkit.data.core.fieldlist import MultiFieldList
|
|
13
13
|
|
|
14
14
|
from anemoi.datasets.data.stores import name_to_zarr_store
|
|
15
|
-
from anemoi.datasets.utils.fields import NewMetadataField as NewMetadataField
|
|
16
15
|
|
|
17
16
|
from .. import iterate_patterns
|
|
18
17
|
from .fieldlist import XarrayFieldList
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import datetime
|
|
12
12
|
import logging
|
|
13
|
+
from functools import cached_property
|
|
13
14
|
|
|
14
15
|
from earthkit.data.core.fieldlist import Field
|
|
15
16
|
from earthkit.data.core.fieldlist import math
|
|
@@ -46,8 +47,6 @@ class XArrayField(Field):
|
|
|
46
47
|
This is actually a nD object, but the first dimensions are always 1.
|
|
47
48
|
The other two dimensions are latitude and longitude.
|
|
48
49
|
"""
|
|
49
|
-
super().__init__(owner.array_backend)
|
|
50
|
-
|
|
51
50
|
self.owner = owner
|
|
52
51
|
self.selection = selection
|
|
53
52
|
|
|
@@ -86,7 +85,8 @@ class XArrayField(Field):
|
|
|
86
85
|
|
|
87
86
|
return values # .reshape(self.shape)
|
|
88
87
|
|
|
89
|
-
|
|
88
|
+
@cached_property
|
|
89
|
+
def _metadata(self):
|
|
90
90
|
return XArrayMetadata(self)
|
|
91
91
|
|
|
92
92
|
def grid_points(self):
|
|
@@ -14,10 +14,8 @@ import logging
|
|
|
14
14
|
import yaml
|
|
15
15
|
from earthkit.data.core.fieldlist import FieldList
|
|
16
16
|
|
|
17
|
-
from .coordinates import is_scalar as is_scalar
|
|
18
17
|
from .field import EmptyFieldList
|
|
19
18
|
from .flavour import CoordinateGuesser
|
|
20
|
-
from .metadata import XArrayMetadata as XArrayMetadata
|
|
21
19
|
from .time import Time
|
|
22
20
|
from .variable import FilteredVariable
|
|
23
21
|
from .variable import Variable
|
|
@@ -13,7 +13,6 @@ import math
|
|
|
13
13
|
from functools import cached_property
|
|
14
14
|
|
|
15
15
|
import numpy as np
|
|
16
|
-
from earthkit.data.utils.array import ensure_backend
|
|
17
16
|
|
|
18
17
|
from .field import XArrayField
|
|
19
18
|
|
|
@@ -30,7 +29,6 @@ class Variable:
|
|
|
30
29
|
grid,
|
|
31
30
|
time,
|
|
32
31
|
metadata,
|
|
33
|
-
array_backend=None,
|
|
34
32
|
):
|
|
35
33
|
self.ds = ds
|
|
36
34
|
self.variable = variable
|
|
@@ -48,7 +46,6 @@ class Variable:
|
|
|
48
46
|
self.by_name = {c.variable.name: c for c in coordinates}
|
|
49
47
|
|
|
50
48
|
self.length = math.prod(self.shape)
|
|
51
|
-
self.array_backend = ensure_backend(array_backend)
|
|
52
49
|
|
|
53
50
|
@property
|
|
54
51
|
def name(self):
|
|
@@ -10,14 +10,8 @@
|
|
|
10
10
|
import logging
|
|
11
11
|
from copy import deepcopy
|
|
12
12
|
|
|
13
|
-
from anemoi.utils.dates import as_datetime as as_datetime
|
|
14
|
-
from anemoi.utils.dates import frequency_to_timedelta as frequency_to_timedelta
|
|
15
13
|
from earthkit.data.core.order import build_remapping
|
|
16
14
|
|
|
17
|
-
from anemoi.datasets.dates import DatesProvider as DatesProvider
|
|
18
|
-
from anemoi.datasets.fields import FieldArray as FieldArray
|
|
19
|
-
from anemoi.datasets.fields import NewValidDateTimeField as NewValidDateTimeField
|
|
20
|
-
|
|
21
15
|
from .context import Context
|
|
22
16
|
from .misc import is_function
|
|
23
17
|
|
|
@@ -10,14 +10,8 @@
|
|
|
10
10
|
import logging
|
|
11
11
|
import textwrap
|
|
12
12
|
|
|
13
|
-
from anemoi.utils.dates import as_datetime as as_datetime
|
|
14
|
-
from anemoi.utils.dates import frequency_to_timedelta as frequency_to_timedelta
|
|
15
13
|
from anemoi.utils.humanize import plural
|
|
16
14
|
|
|
17
|
-
from anemoi.datasets.dates import DatesProvider as DatesProvider
|
|
18
|
-
from anemoi.datasets.fields import FieldArray as FieldArray
|
|
19
|
-
from anemoi.datasets.fields import NewValidDateTimeField as NewValidDateTimeField
|
|
20
|
-
|
|
21
15
|
from .trace import step
|
|
22
16
|
from .trace import trace
|
|
23
17
|
|
|
@@ -10,13 +10,6 @@
|
|
|
10
10
|
import logging
|
|
11
11
|
from functools import cached_property
|
|
12
12
|
|
|
13
|
-
from anemoi.utils.dates import as_datetime as as_datetime
|
|
14
|
-
from anemoi.utils.dates import frequency_to_timedelta as frequency_to_timedelta
|
|
15
|
-
|
|
16
|
-
from anemoi.datasets.dates import DatesProvider as DatesProvider
|
|
17
|
-
from anemoi.datasets.fields import FieldArray as FieldArray
|
|
18
|
-
from anemoi.datasets.fields import NewValidDateTimeField as NewValidDateTimeField
|
|
19
|
-
|
|
20
13
|
from .action import Action
|
|
21
14
|
from .action import action_factory
|
|
22
15
|
from .misc import _tidy
|
|
@@ -10,13 +10,6 @@
|
|
|
10
10
|
import logging
|
|
11
11
|
from functools import cached_property
|
|
12
12
|
|
|
13
|
-
from anemoi.utils.dates import as_datetime as as_datetime
|
|
14
|
-
from anemoi.utils.dates import frequency_to_timedelta as frequency_to_timedelta
|
|
15
|
-
|
|
16
|
-
from anemoi.datasets.dates import DatesProvider as DatesProvider
|
|
17
|
-
from anemoi.datasets.fields import FieldArray as FieldArray
|
|
18
|
-
from anemoi.datasets.fields import NewValidDateTimeField as NewValidDateTimeField
|
|
19
|
-
|
|
20
13
|
from .misc import assert_fieldlist
|
|
21
14
|
from .result import Result
|
|
22
15
|
from .trace import trace_datasource
|
|
@@ -10,13 +10,6 @@
|
|
|
10
10
|
import logging
|
|
11
11
|
from functools import cached_property
|
|
12
12
|
|
|
13
|
-
from anemoi.utils.dates import as_datetime as as_datetime
|
|
14
|
-
from anemoi.utils.dates import frequency_to_timedelta as frequency_to_timedelta
|
|
15
|
-
|
|
16
|
-
from anemoi.datasets.dates import DatesProvider as DatesProvider
|
|
17
|
-
from anemoi.datasets.fields import FieldArray as FieldArray
|
|
18
|
-
from anemoi.datasets.fields import NewValidDateTimeField as NewValidDateTimeField
|
|
19
|
-
|
|
20
13
|
from ..functions import import_function
|
|
21
14
|
from .function import FunctionContext
|
|
22
15
|
from .misc import _tidy
|
|
@@ -10,13 +10,6 @@
|
|
|
10
10
|
import logging
|
|
11
11
|
from functools import cached_property
|
|
12
12
|
|
|
13
|
-
from anemoi.utils.dates import as_datetime as as_datetime
|
|
14
|
-
from anemoi.utils.dates import frequency_to_timedelta as frequency_to_timedelta
|
|
15
|
-
|
|
16
|
-
from anemoi.datasets.dates import DatesProvider as DatesProvider
|
|
17
|
-
from anemoi.datasets.fields import FieldArray as FieldArray
|
|
18
|
-
from anemoi.datasets.fields import NewValidDateTimeField as NewValidDateTimeField
|
|
19
|
-
|
|
20
13
|
from ..functions import import_function
|
|
21
14
|
from .action import Action
|
|
22
15
|
from .misc import _tidy
|
|
@@ -10,15 +10,9 @@
|
|
|
10
10
|
import logging
|
|
11
11
|
from functools import wraps
|
|
12
12
|
|
|
13
|
-
from anemoi.utils.dates import as_datetime as as_datetime
|
|
14
|
-
from anemoi.utils.dates import frequency_to_timedelta as frequency_to_timedelta
|
|
15
13
|
from earthkit.data.core.fieldlist import MultiFieldList
|
|
16
14
|
from earthkit.data.indexing.fieldlist import FieldList
|
|
17
15
|
|
|
18
|
-
from anemoi.datasets.dates import DatesProvider as DatesProvider
|
|
19
|
-
from anemoi.datasets.fields import FieldArray as FieldArray
|
|
20
|
-
from anemoi.datasets.fields import NewValidDateTimeField as NewValidDateTimeField
|
|
21
|
-
|
|
22
16
|
from ..functions import import_function
|
|
23
17
|
|
|
24
18
|
LOG = logging.getLogger(__name__)
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
8
8
|
# nor does it submit to any jurisdiction.
|
|
9
9
|
|
|
10
|
+
import json
|
|
10
11
|
import logging
|
|
11
12
|
|
|
12
13
|
from .action import Action
|
|
@@ -20,7 +21,11 @@ LOG = logging.getLogger(__name__)
|
|
|
20
21
|
class PipeAction(Action):
|
|
21
22
|
def __init__(self, context, action_path, *configs):
|
|
22
23
|
super().__init__(context, action_path, *configs)
|
|
23
|
-
|
|
24
|
+
if len(configs) <= 1:
|
|
25
|
+
raise ValueError(
|
|
26
|
+
f"PipeAction requires at least two actions, got {len(configs)}\n{json.dumps(configs, indent=2)}"
|
|
27
|
+
)
|
|
28
|
+
|
|
24
29
|
current = action_factory(configs[0], context, action_path + ["0"])
|
|
25
30
|
for i, c in enumerate(configs[1:]):
|
|
26
31
|
current = step_factory(c, context, action_path + [str(i + 1)], previous_step=current)
|
|
@@ -12,12 +12,11 @@ import logging
|
|
|
12
12
|
from collections import defaultdict
|
|
13
13
|
|
|
14
14
|
import numpy as np
|
|
15
|
+
from anemoi.transform.fields import new_field_with_valid_datetime
|
|
16
|
+
from anemoi.transform.fields import new_fieldlist_from_list
|
|
15
17
|
from anemoi.utils.dates import as_datetime
|
|
16
18
|
from anemoi.utils.dates import frequency_to_timedelta
|
|
17
19
|
|
|
18
|
-
from anemoi.datasets.fields import FieldArray
|
|
19
|
-
from anemoi.datasets.fields import NewValidDateTimeField
|
|
20
|
-
|
|
21
20
|
from .action import Action
|
|
22
21
|
from .action import action_factory
|
|
23
22
|
from .join import JoinResult
|
|
@@ -116,9 +115,10 @@ class DateMapperClosest(DateMapper):
|
|
|
116
115
|
|
|
117
116
|
|
|
118
117
|
class DateMapperClimatology(DateMapper):
|
|
119
|
-
def __init__(self, source, year, day):
|
|
118
|
+
def __init__(self, source, year, day, hour=None):
|
|
120
119
|
self.year = year
|
|
121
120
|
self.day = day
|
|
121
|
+
self.hour = hour
|
|
122
122
|
|
|
123
123
|
def transform(self, group_of_dates):
|
|
124
124
|
from anemoi.datasets.dates.groups import GroupOfDates
|
|
@@ -130,6 +130,8 @@ class DateMapperClimatology(DateMapper):
|
|
|
130
130
|
new_dates = defaultdict(list)
|
|
131
131
|
for date in dates:
|
|
132
132
|
new_date = date.replace(year=self.year, day=self.day)
|
|
133
|
+
if self.hour is not None:
|
|
134
|
+
new_date = new_date.replace(hour=self.hour, minute=0, second=0)
|
|
133
135
|
new_dates[new_date].append(date)
|
|
134
136
|
|
|
135
137
|
for date, dates in new_dates.items():
|
|
@@ -185,9 +187,12 @@ class DateMapperResult(Result):
|
|
|
185
187
|
|
|
186
188
|
for field in self.source_results.datasource:
|
|
187
189
|
for date in self.original_group_of_dates:
|
|
188
|
-
result.append(
|
|
190
|
+
result.append(new_field_with_valid_datetime(field, date))
|
|
191
|
+
|
|
192
|
+
if not result:
|
|
193
|
+
raise ValueError("repeated_dates: no input data found")
|
|
189
194
|
|
|
190
|
-
return
|
|
195
|
+
return new_fieldlist_from_list(result)
|
|
191
196
|
|
|
192
197
|
|
|
193
198
|
class RepeatedDatesAction(Action):
|
|
@@ -15,16 +15,10 @@ from collections import defaultdict
|
|
|
15
15
|
from functools import cached_property
|
|
16
16
|
|
|
17
17
|
import numpy as np
|
|
18
|
-
from anemoi.utils.dates import as_datetime as as_datetime
|
|
19
|
-
from anemoi.utils.dates import frequency_to_timedelta as frequency_to_timedelta
|
|
20
18
|
from anemoi.utils.humanize import seconds_to_human
|
|
21
19
|
from anemoi.utils.humanize import shorten_list
|
|
22
20
|
from earthkit.data.core.order import build_remapping
|
|
23
21
|
|
|
24
|
-
from anemoi.datasets.dates import DatesProvider as DatesProvider
|
|
25
|
-
from anemoi.datasets.fields import FieldArray as FieldArray
|
|
26
|
-
from anemoi.datasets.fields import NewValidDateTimeField as NewValidDateTimeField
|
|
27
|
-
|
|
28
22
|
from .trace import trace
|
|
29
23
|
from .trace import trace_datasource
|
|
30
24
|
|
|
@@ -10,13 +10,6 @@
|
|
|
10
10
|
import logging
|
|
11
11
|
from copy import deepcopy
|
|
12
12
|
|
|
13
|
-
from anemoi.utils.dates import as_datetime as as_datetime
|
|
14
|
-
from anemoi.utils.dates import frequency_to_timedelta as frequency_to_timedelta
|
|
15
|
-
|
|
16
|
-
from anemoi.datasets.dates import DatesProvider as DatesProvider
|
|
17
|
-
from anemoi.datasets.fields import FieldArray as FieldArray
|
|
18
|
-
from anemoi.datasets.fields import NewValidDateTimeField as NewValidDateTimeField
|
|
19
|
-
|
|
20
13
|
from .action import Action
|
|
21
14
|
from .context import Context
|
|
22
15
|
from .misc import is_function
|
anemoi/datasets/data/dataset.py
CHANGED
|
@@ -15,6 +15,7 @@ import pprint
|
|
|
15
15
|
import warnings
|
|
16
16
|
from functools import cached_property
|
|
17
17
|
|
|
18
|
+
import numpy as np
|
|
18
19
|
from anemoi.utils.dates import frequency_to_seconds
|
|
19
20
|
from anemoi.utils.dates import frequency_to_string
|
|
20
21
|
from anemoi.utils.dates import frequency_to_timedelta
|
|
@@ -42,6 +43,9 @@ def _tidy(v):
|
|
|
42
43
|
if isinstance(v, slice):
|
|
43
44
|
return (v.start, v.stop, v.step)
|
|
44
45
|
|
|
46
|
+
if isinstance(v, np.integer):
|
|
47
|
+
return int(v)
|
|
48
|
+
|
|
45
49
|
return v
|
|
46
50
|
|
|
47
51
|
|
|
@@ -241,7 +245,8 @@ class Dataset:
|
|
|
241
245
|
if not isinstance(vars, (list, tuple, set)):
|
|
242
246
|
vars = [vars]
|
|
243
247
|
|
|
244
|
-
|
|
248
|
+
if not set(vars) <= set(self.name_to_index):
|
|
249
|
+
raise ValueError(f"drop: unknown variables: {set(vars) - set(self.name_to_index)}")
|
|
245
250
|
|
|
246
251
|
return sorted([v for k, v in self.name_to_index.items() if k not in vars])
|
|
247
252
|
|
anemoi/datasets/data/grids.py
CHANGED
|
@@ -289,14 +289,15 @@ class Cutout(GridsBase):
|
|
|
289
289
|
"""
|
|
290
290
|
index, changes = index_to_slices(index, self.shape)
|
|
291
291
|
# Select data from each LAM
|
|
292
|
-
lam_data = [lam[index] for lam in self.lams]
|
|
292
|
+
lam_data = [lam[index[:3]] for lam in self.lams]
|
|
293
293
|
|
|
294
294
|
# First apply spatial indexing on `self.globe` and then apply the mask
|
|
295
295
|
globe_data_sliced = self.globe[index[:3]]
|
|
296
296
|
globe_data = globe_data_sliced[..., self.global_mask]
|
|
297
297
|
|
|
298
|
-
# Concatenate LAM data with global data
|
|
299
|
-
result = np.concatenate(lam_data + [globe_data], axis=self.axis)
|
|
298
|
+
# Concatenate LAM data with global data, apply the grid slicing
|
|
299
|
+
result = np.concatenate(lam_data + [globe_data], axis=self.axis)[..., index[3]]
|
|
300
|
+
|
|
300
301
|
return apply_index_to_slices_changes(result, changes)
|
|
301
302
|
|
|
302
303
|
def collect_supporting_arrays(self, collected, *path):
|
|
@@ -324,7 +325,8 @@ class Cutout(GridsBase):
|
|
|
324
325
|
"""
|
|
325
326
|
shapes = [np.sum(mask) for mask in self.masks]
|
|
326
327
|
global_shape = np.sum(self.global_mask)
|
|
327
|
-
|
|
328
|
+
total_shape = sum(shapes) + global_shape
|
|
329
|
+
return tuple(self.lams[0].shape[:-1] + (int(total_shape),))
|
|
328
330
|
|
|
329
331
|
def check_same_resolution(self, d1, d2):
|
|
330
332
|
# Turned off because we are combining different resolutions
|
anemoi/datasets/data/join.py
CHANGED
|
@@ -124,7 +124,14 @@ class Join(Combined):
|
|
|
124
124
|
if v in md:
|
|
125
125
|
result[v] = md[v]
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
if len(result) != len(variables):
|
|
128
|
+
LOG.error("Some variables are missing metadata.")
|
|
129
|
+
for v in variables:
|
|
130
|
+
if v not in result:
|
|
131
|
+
LOG.error("Missing metadata for %r.", v)
|
|
132
|
+
|
|
133
|
+
raise ValueError("Some variables are missing metadata.")
|
|
134
|
+
|
|
128
135
|
return result
|
|
129
136
|
|
|
130
137
|
@cached_property
|
anemoi/datasets/dates/groups.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: anemoi-datasets
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.12
|
|
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
|
-
License:
|
|
6
|
+
License: Apache License
|
|
7
7
|
Version 2.0, January 2004
|
|
8
8
|
http://www.apache.org/licenses/
|
|
9
9
|
|
|
@@ -224,40 +224,39 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
224
224
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
225
225
|
Requires-Python: >=3.9
|
|
226
226
|
License-File: LICENSE
|
|
227
|
-
Requires-Dist: anemoi-transform
|
|
228
|
-
Requires-Dist: anemoi-utils[provenance]
|
|
227
|
+
Requires-Dist: anemoi-transform>=0.1
|
|
228
|
+
Requires-Dist: anemoi-utils[provenance]>=0.4.9
|
|
229
229
|
Requires-Dist: cfunits
|
|
230
230
|
Requires-Dist: numpy
|
|
231
231
|
Requires-Dist: pyyaml
|
|
232
232
|
Requires-Dist: semantic-version
|
|
233
233
|
Requires-Dist: tqdm
|
|
234
|
-
Requires-Dist: zarr
|
|
234
|
+
Requires-Dist: zarr<=2.17
|
|
235
235
|
Provides-Extra: all
|
|
236
|
-
Requires-Dist: anemoi-datasets[create,remote,xarray]
|
|
236
|
+
Requires-Dist: anemoi-datasets[create,remote,xarray]; extra == "all"
|
|
237
237
|
Provides-Extra: create
|
|
238
|
-
Requires-Dist: earthkit-data[mars]
|
|
239
|
-
Requires-Dist: earthkit-geo
|
|
240
|
-
Requires-Dist: earthkit-meteo
|
|
241
|
-
Requires-Dist: eccodes
|
|
242
|
-
Requires-Dist: entrypoints
|
|
243
|
-
Requires-Dist: pyproj
|
|
238
|
+
Requires-Dist: earthkit-data[mars]>=0.10.7; extra == "create"
|
|
239
|
+
Requires-Dist: earthkit-geo>=0.2; extra == "create"
|
|
240
|
+
Requires-Dist: earthkit-meteo; extra == "create"
|
|
241
|
+
Requires-Dist: eccodes>=2.38.1; extra == "create"
|
|
242
|
+
Requires-Dist: entrypoints; extra == "create"
|
|
243
|
+
Requires-Dist: pyproj; extra == "create"
|
|
244
244
|
Provides-Extra: dev
|
|
245
|
-
Requires-Dist: anemoi-datasets[all,docs,tests]
|
|
245
|
+
Requires-Dist: anemoi-datasets[all,docs,tests]; extra == "dev"
|
|
246
246
|
Provides-Extra: docs
|
|
247
|
-
Requires-Dist: nbsphinx
|
|
248
|
-
Requires-Dist: pandoc
|
|
249
|
-
Requires-Dist: sphinx
|
|
250
|
-
Requires-Dist: sphinx-argparse
|
|
251
|
-
Requires-Dist: sphinx-rtd-theme
|
|
247
|
+
Requires-Dist: nbsphinx; extra == "docs"
|
|
248
|
+
Requires-Dist: pandoc; extra == "docs"
|
|
249
|
+
Requires-Dist: sphinx; extra == "docs"
|
|
250
|
+
Requires-Dist: sphinx-argparse; extra == "docs"
|
|
251
|
+
Requires-Dist: sphinx-rtd-theme; extra == "docs"
|
|
252
252
|
Provides-Extra: remote
|
|
253
|
-
Requires-Dist: boto3
|
|
254
|
-
Requires-Dist: requests
|
|
253
|
+
Requires-Dist: boto3; extra == "remote"
|
|
254
|
+
Requires-Dist: requests; extra == "remote"
|
|
255
255
|
Provides-Extra: tests
|
|
256
|
-
Requires-Dist: pytest
|
|
256
|
+
Requires-Dist: pytest; extra == "tests"
|
|
257
257
|
Provides-Extra: xarray
|
|
258
|
-
Requires-Dist: gcsfs
|
|
259
|
-
Requires-Dist: kerchunk
|
|
260
|
-
Requires-Dist: pandas
|
|
261
|
-
Requires-Dist: planetary-computer
|
|
262
|
-
Requires-Dist: pystac-client
|
|
263
|
-
|
|
258
|
+
Requires-Dist: gcsfs; extra == "xarray"
|
|
259
|
+
Requires-Dist: kerchunk; extra == "xarray"
|
|
260
|
+
Requires-Dist: pandas; extra == "xarray"
|
|
261
|
+
Requires-Dist: planetary-computer; extra == "xarray"
|
|
262
|
+
Requires-Dist: pystac-client; extra == "xarray"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
anemoi/datasets/__init__.py,sha256=0GOHATiKgkUqLRgAVQhNP1aPO7ULfSr8DqUf2ANPEv8,1010
|
|
2
2
|
anemoi/datasets/__main__.py,sha256=5NW2A3OgTimB4ptwYThivIRSeCrvabMuvnr8mmnVx0E,715
|
|
3
|
-
anemoi/datasets/_version.py,sha256=
|
|
4
|
-
anemoi/datasets/fields.py,sha256=OCOu4i3UFjI_EqOm3gW5_8yEnM3EhNMb3MzbCki0piI,1941
|
|
3
|
+
anemoi/datasets/_version.py,sha256=ZArwdbjC4yDqbe9dEwhZVS693DGl1K3jnRxJy_dutjo,413
|
|
5
4
|
anemoi/datasets/grids.py,sha256=bq7pB_6uswILT3t8C8SeUpUrBww31dw5au_USrped6c,10919
|
|
6
5
|
anemoi/datasets/testing.py,sha256=7HGOz5_V9MbkHTDJ4KbklGRndBMrFfVrBBu6a9k0_qY,1825
|
|
7
6
|
anemoi/datasets/commands/__init__.py,sha256=O5W3yHZywRoAqmRUioAr3zMCh0hGVV18wZYGvc00ioM,698
|
|
@@ -21,7 +20,7 @@ anemoi/datasets/commands/publish.py,sha256=z1MV9_1BsEnw81Y_17fHkKGYe8_ZJo9eeQ1kG
|
|
|
21
20
|
anemoi/datasets/commands/scan.py,sha256=mXzYEcYsncxC7ItyL_TlVRiWji6OFYfVxO5OMD9mbEI,3304
|
|
22
21
|
anemoi/datasets/compute/__init__.py,sha256=hCW0QcLHJmE-C1r38P27_ZOvCLNewex5iQEtZqx2ckI,393
|
|
23
22
|
anemoi/datasets/compute/recentre.py,sha256=tKs-YZLhqsMRBNEUF41hcuMmyvbRuFX07xJq-Cqg2_w,4954
|
|
24
|
-
anemoi/datasets/create/__init__.py,sha256=
|
|
23
|
+
anemoi/datasets/create/__init__.py,sha256=q8JIS6mcfJhMD8-uJN-EMkaG4DwKNTIJy53iGKHhiXw,36259
|
|
25
24
|
anemoi/datasets/create/check.py,sha256=1fT1au1LmSGKTQYhnmMK9ImSZnLLevkKX1a0jUtEuVc,6148
|
|
26
25
|
anemoi/datasets/create/chunks.py,sha256=c7ufk-EamAGqxOI4ScTFlBzdEiH6V1R0f0SPavtZ2Xw,2457
|
|
27
26
|
anemoi/datasets/create/config.py,sha256=Tq9kJ-bKhYSTWCXNa8lZIJpO3RteZfCr5hQVM12IgD0,8892
|
|
@@ -37,7 +36,7 @@ anemoi/datasets/create/functions/filters/empty.py,sha256=EGLufFcNFoqIXTZj7jQFjtF
|
|
|
37
36
|
anemoi/datasets/create/functions/filters/noop.py,sha256=5YqumPxlGDOZOrYWayLr8PTycVWG2X_0PmoFi3Hj584,458
|
|
38
37
|
anemoi/datasets/create/functions/filters/pressure_level_relative_humidity_to_specific_humidity.py,sha256=jjmocA4WDKCAL49QUFk_3S0JRiPMmeVM7Wlxmfr1v6c,1857
|
|
39
38
|
anemoi/datasets/create/functions/filters/pressure_level_specific_humidity_to_relative_humidity.py,sha256=e8LvXUq-qNKJrcjb1DSUXaPeFfxcWxFjGAkm47cOnE8,1855
|
|
40
|
-
anemoi/datasets/create/functions/filters/rename.py,sha256=
|
|
39
|
+
anemoi/datasets/create/functions/filters/rename.py,sha256=cDF3xmdhwzIZn_nwaO3hxG4fb2vpKtJtmy0ZdLGXyHI,2481
|
|
41
40
|
anemoi/datasets/create/functions/filters/rotate_winds.py,sha256=GZq8DFbwOxeROvPS5qVKlYuXq8xKbCAwlZprS6I04Hc,2429
|
|
42
41
|
anemoi/datasets/create/functions/filters/single_level_dewpoint_to_relative_humidity.py,sha256=X5HbuMHFQoC2v_SYH4S7ocWFqV4JQUUGybvtyP-twaA,1719
|
|
43
42
|
anemoi/datasets/create/functions/filters/single_level_relative_humidity_to_dewpoint.py,sha256=pTM5Hwsi9yeuBmz66m3Zlmr554USoLzgzMMGSMh4BmM,1908
|
|
@@ -51,7 +50,7 @@ anemoi/datasets/create/functions/sources/accumulations.py,sha256=tI5Aga1aLDp8Dqf
|
|
|
51
50
|
anemoi/datasets/create/functions/sources/constants.py,sha256=GaiUpJPYupiLWl8O9GEZ9KmlD88pH6dlBiUVrhNl_uA,918
|
|
52
51
|
anemoi/datasets/create/functions/sources/empty.py,sha256=YTpOJ3rcb_eS9CbnpwPWBR9r1APIAaG6a_N803YFZFE,500
|
|
53
52
|
anemoi/datasets/create/functions/sources/forcings.py,sha256=p442lCOXm8TJFRlP0mgwZujveo9gCtdAGLS4KSIqYfk,661
|
|
54
|
-
anemoi/datasets/create/functions/sources/grib.py,sha256=
|
|
53
|
+
anemoi/datasets/create/functions/sources/grib.py,sha256=BSieYEnoG92-8lPlrK7CIaGX7qozpkixqHarucDZtLk,4543
|
|
55
54
|
anemoi/datasets/create/functions/sources/hindcasts.py,sha256=AWtSW_VoeWIjwjojyAL8FskKMq9fTUfnQ1OI30_J2qA,1677
|
|
56
55
|
anemoi/datasets/create/functions/sources/mars.py,sha256=_QDAhb1onZRBcH21jMdlhw8gp1taiQyt3bpkbQpGWRY,8736
|
|
57
56
|
anemoi/datasets/create/functions/sources/netcdf.py,sha256=GZvd8-d9lQFQ6sJL1usJPtnVqRz2UWqJOX3Fup1CAcI,547
|
|
@@ -62,45 +61,45 @@ anemoi/datasets/create/functions/sources/tendencies.py,sha256=z8iDelu0vvDE8S-Rus
|
|
|
62
61
|
anemoi/datasets/create/functions/sources/xarray_kerchunk.py,sha256=8evD6Sype3ffCbmQ0jMBpgR97UeNvkTB5rwchhy4YzY,1446
|
|
63
62
|
anemoi/datasets/create/functions/sources/xarray_zarr.py,sha256=3JvoGfQZ4NCUcfxDAbNZOL7z2VRNJzr1H3r8dsWbrgk,545
|
|
64
63
|
anemoi/datasets/create/functions/sources/zenodo.py,sha256=rPL9uNPeFTdI9XvVEahtHkxzE18MyrjNXZjpt_sNeH4,1251
|
|
65
|
-
anemoi/datasets/create/functions/sources/xarray/__init__.py,sha256=
|
|
64
|
+
anemoi/datasets/create/functions/sources/xarray/__init__.py,sha256=fEJI2OGOtk-CJqCzaege0uwPKGpqEkeKxgt2bN-W934,3136
|
|
66
65
|
anemoi/datasets/create/functions/sources/xarray/coordinates.py,sha256=-FkcAaio2KumOd20eb1hLv9rRhjnu-CyqtqzrMsZx18,6213
|
|
67
|
-
anemoi/datasets/create/functions/sources/xarray/field.py,sha256=
|
|
68
|
-
anemoi/datasets/create/functions/sources/xarray/fieldlist.py,sha256=
|
|
66
|
+
anemoi/datasets/create/functions/sources/xarray/field.py,sha256=70_3wxBE-flftWqyHAyBP7FhwZOHgrSW6WDmA8QGszs,3680
|
|
67
|
+
anemoi/datasets/create/functions/sources/xarray/fieldlist.py,sha256=wBHPQPm1oJnaVGO6p0opx9tEOIJkdINw_cCTG1y9GYk,5884
|
|
69
68
|
anemoi/datasets/create/functions/sources/xarray/flavour.py,sha256=6mqldGyx40Zgy4_VkuGWKgrSuPbWKe__nmEradQO5qg,14855
|
|
70
69
|
anemoi/datasets/create/functions/sources/xarray/grid.py,sha256=OuLBVv_CdgtLgGACpqhjX8fwtYzM7tfJiwUOXbG_ifw,3644
|
|
71
70
|
anemoi/datasets/create/functions/sources/xarray/metadata.py,sha256=GXHjPm8MsFU9fBfJCjllPWtKahBcKWtQwj0yA7zt4hU,4573
|
|
72
71
|
anemoi/datasets/create/functions/sources/xarray/time.py,sha256=RKODUhgGtApvee3C8SdcBpz2wlQ4zJhyov1UPvblsr4,5987
|
|
73
|
-
anemoi/datasets/create/functions/sources/xarray/variable.py,sha256=
|
|
72
|
+
anemoi/datasets/create/functions/sources/xarray/variable.py,sha256=j2NN-zx-yjprIJLcidxMxFC4QQZ7I8Dd0nKMrgRpsdM,4385
|
|
74
73
|
anemoi/datasets/create/input/__init__.py,sha256=cAwfW9AQiG2PfmZ2Irll7HX8HyiC0Nk1Q9OhoQ84ZAg,1625
|
|
75
|
-
anemoi/datasets/create/input/action.py,sha256=
|
|
74
|
+
anemoi/datasets/create/input/action.py,sha256=SApZApq-_mlOwk1NTERgQlPdPL8lBlIk6rxYX3JBw_E,3857
|
|
76
75
|
anemoi/datasets/create/input/concat.py,sha256=DwxgoTSTqNDsVcX5btUBAA7vXtX3G5m-zJ-jDrmAC-c,3279
|
|
77
|
-
anemoi/datasets/create/input/context.py,sha256=
|
|
78
|
-
anemoi/datasets/create/input/data_sources.py,sha256=
|
|
79
|
-
anemoi/datasets/create/input/empty.py,sha256=
|
|
80
|
-
anemoi/datasets/create/input/filter.py,sha256=
|
|
81
|
-
anemoi/datasets/create/input/function.py,sha256=
|
|
76
|
+
anemoi/datasets/create/input/context.py,sha256=ohpbdlX7HKVR9peaX_yhx089AeJdhKLPsvPDttcz-uE,1748
|
|
77
|
+
anemoi/datasets/create/input/data_sources.py,sha256=lXBD9gJ1EbInKElhUSY7HKz_9wnep9N2RzFJPDcoFbw,2493
|
|
78
|
+
anemoi/datasets/create/input/empty.py,sha256=1rWFpHiKIUa-YhlmSSSU0R8dlUVQ9qFVDyJH1NrMmtU,980
|
|
79
|
+
anemoi/datasets/create/input/filter.py,sha256=TmUEGFl4hkeXvUeVAwnowO0uEOQ0vn0DQZIhslc2C0Q,2068
|
|
80
|
+
anemoi/datasets/create/input/function.py,sha256=F5GQgbtFYmyqFAgNGoGDuWw-xqkcCLzuu20n1TT4GfA,3719
|
|
82
81
|
anemoi/datasets/create/input/join.py,sha256=wQP1-vVg4as-R5i3pstgK6HmTJAY7WyWYhCEF6FIU1c,1991
|
|
83
|
-
anemoi/datasets/create/input/misc.py,sha256=
|
|
84
|
-
anemoi/datasets/create/input/pipe.py,sha256=
|
|
85
|
-
anemoi/datasets/create/input/repeated_dates.py,sha256=
|
|
86
|
-
anemoi/datasets/create/input/result.py,sha256
|
|
87
|
-
anemoi/datasets/create/input/step.py,sha256=
|
|
82
|
+
anemoi/datasets/create/input/misc.py,sha256=r7NC_QRYA8iiJJbSFgQnNuixymATK0CPZknGxgYcLOk,1975
|
|
83
|
+
anemoi/datasets/create/input/pipe.py,sha256=KfPCtiqyfqkXbmC-2LTqHkCQ7bJY46XMvNDnp9QeHTQ,1344
|
|
84
|
+
anemoi/datasets/create/input/repeated_dates.py,sha256=biwnjgaRGzJiFk5fAY-YA4FotzdlwkY56GKUetzOulg,6840
|
|
85
|
+
anemoi/datasets/create/input/result.py,sha256=-pcVcaaj3G_xcNKWWTgzVH5Ds5-ETWmErN0KeQGitAw,20013
|
|
86
|
+
anemoi/datasets/create/input/step.py,sha256=CoowF9mc3kepT8XQ2ObxO750rnQEkYNTviIHQ1m-4UA,2886
|
|
88
87
|
anemoi/datasets/create/input/template.py,sha256=Vgi4wQ1aeswLbji0fIzshYhISmzdrt7b0BmgeJJjYGc,1859
|
|
89
88
|
anemoi/datasets/create/input/trace.py,sha256=DYXMSnwKqOIx0XWZTKNJojWz4EqaFLknTh6ysxsW9uY,2198
|
|
90
89
|
anemoi/datasets/create/statistics/__init__.py,sha256=l6VE00sfcfqBg6cDFJTian-DLnvwt1QYEYq0lCHZ0PY,12786
|
|
91
90
|
anemoi/datasets/create/statistics/summary.py,sha256=wmnz4fZkr6fomXgI8JlMutU8gakfrXTc5ixf3Np7gZA,3385
|
|
92
91
|
anemoi/datasets/data/__init__.py,sha256=AW1-Ycj77pWQsZcDGsp0pgTS5rFW6XC4CzuUEIUPAIk,1558
|
|
93
92
|
anemoi/datasets/data/concat.py,sha256=udtYINuoLOEYYKhi_VpG2-emv80pwZbFAZKwNwXJk3s,5244
|
|
94
|
-
anemoi/datasets/data/dataset.py,sha256=
|
|
93
|
+
anemoi/datasets/data/dataset.py,sha256=73NjQo7wUSWqfdpyVVZIpWgEmy1x9-beN-kVtgfhBJE,15587
|
|
95
94
|
anemoi/datasets/data/debug.css,sha256=z2X_ZDSnZ9C3pyZPWnQiEyAxuMxUaxJxET4oaCImTAQ,211
|
|
96
95
|
anemoi/datasets/data/debug.py,sha256=IjCMwtAvknF51PCl_YRYgMZB2iX_9DC5DKILNgl_UHQ,6300
|
|
97
96
|
anemoi/datasets/data/ensemble.py,sha256=KNIXDfjYSIo6JVn1bD9X92yffd4Gg83wn_2sGxqAnWU,1111
|
|
98
97
|
anemoi/datasets/data/fill_missing.py,sha256=4btLi-D-hFTsS_57_gIC1nK5AVifAO-V4M-fqMrtrxk,4636
|
|
99
98
|
anemoi/datasets/data/forwards.py,sha256=P9DfSY5B9w9gtkKfV6TIzXel_LY83g-2nEreJy2rYkU,8916
|
|
100
|
-
anemoi/datasets/data/grids.py,sha256=
|
|
99
|
+
anemoi/datasets/data/grids.py,sha256=p7_nT7RLH6uKcxeAzQiGYk9lFxU_OOikDrwlb2rdEqI,15765
|
|
101
100
|
anemoi/datasets/data/indexing.py,sha256=9lycQXSqUIbYj52JlFv0w_Gf6soVZnbVGswYMvGPpqs,4773
|
|
102
101
|
anemoi/datasets/data/interpolate.py,sha256=D27lSH8yNhm0aoO0U3UoRbr3kni7OWXSu_X4jCbIrA0,4137
|
|
103
|
-
anemoi/datasets/data/join.py,sha256=
|
|
102
|
+
anemoi/datasets/data/join.py,sha256=xl7SrjhggZdX_bdni5-cn8-BYGUYfEtogQeIqCgSL7U,5525
|
|
104
103
|
anemoi/datasets/data/masked.py,sha256=eAVGVmQR7tWsd3xXYGXGyq28uRLwL50vOXWTNNdHxl0,4530
|
|
105
104
|
anemoi/datasets/data/merge.py,sha256=6vYRy3-P4J9GgTPkdoPFs9CbZ5F0m8FAukS-P66BR_M,5448
|
|
106
105
|
anemoi/datasets/data/misc.py,sha256=IKqtvcU36nyB4z6dfu7W_gnCpaeX20fK2C5A2seWdCA,10061
|
|
@@ -113,12 +112,12 @@ anemoi/datasets/data/subset.py,sha256=M9oVdwjMdDEEtpri6qcGCTL9l6Xw2epA7DFusy9IOs
|
|
|
113
112
|
anemoi/datasets/data/unchecked.py,sha256=Vk9P3Y-JGgsWTcOhb878qV_dJv3lP4S-4I8rFWnRAJI,4278
|
|
114
113
|
anemoi/datasets/data/xy.py,sha256=YzAB12jq-IoCHcjbZlS4SJKLK8e2QvIIfPwHDgkH5vM,3568
|
|
115
114
|
anemoi/datasets/dates/__init__.py,sha256=wX2FvlmRfHV5HDmllIxwfrC1LuRlb7i6SguLLasP0l4,8042
|
|
116
|
-
anemoi/datasets/dates/groups.py,sha256=
|
|
115
|
+
anemoi/datasets/dates/groups.py,sha256=i7x8z0kv6E8qUfm1tMZR1aaOqNwQzEkV-VWpOvHjoX4,5390
|
|
117
116
|
anemoi/datasets/utils/__init__.py,sha256=hCW0QcLHJmE-C1r38P27_ZOvCLNewex5iQEtZqx2ckI,393
|
|
118
117
|
anemoi/datasets/utils/fields.py,sha256=l7xKOiRLgk9Eewykqu7xZP9xOajG2dx2CiDlGvBVejU,1411
|
|
119
|
-
anemoi_datasets-0.5.
|
|
120
|
-
anemoi_datasets-0.5.
|
|
121
|
-
anemoi_datasets-0.5.
|
|
122
|
-
anemoi_datasets-0.5.
|
|
123
|
-
anemoi_datasets-0.5.
|
|
124
|
-
anemoi_datasets-0.5.
|
|
118
|
+
anemoi_datasets-0.5.12.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
119
|
+
anemoi_datasets-0.5.12.dist-info/METADATA,sha256=x548Cd_PFUCse1QR5dj-8rNfUx94ZU45g__IjPaGLgY,15598
|
|
120
|
+
anemoi_datasets-0.5.12.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
121
|
+
anemoi_datasets-0.5.12.dist-info/entry_points.txt,sha256=yR-o-4uiPEA_GLBL81SkMYnUoxq3CAV3hHulQiRtGG0,66
|
|
122
|
+
anemoi_datasets-0.5.12.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
|
|
123
|
+
anemoi_datasets-0.5.12.dist-info/RECORD,,
|
anemoi/datasets/fields.py
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# (C) Copyright 2024 Anemoi contributors.
|
|
2
|
-
#
|
|
3
|
-
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
-
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
-
#
|
|
6
|
-
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
7
|
-
# granted to it by virtue of its status as an intergovernmental organisation
|
|
8
|
-
# nor does it submit to any jurisdiction.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
from earthkit.data.indexing.fieldlist import FieldArray
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def list_to_fieldlist(fields):
|
|
15
|
-
return FieldArray(fields)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def empty_fieldlist():
|
|
19
|
-
return FieldArray([])
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class WrappedField:
|
|
23
|
-
def __init__(self, field):
|
|
24
|
-
self._field = field
|
|
25
|
-
|
|
26
|
-
def __getattr__(self, name):
|
|
27
|
-
return getattr(self._field, name)
|
|
28
|
-
|
|
29
|
-
def __repr__(self) -> str:
|
|
30
|
-
return repr(self._field)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class NewDataField(WrappedField):
|
|
34
|
-
def __init__(self, field, data):
|
|
35
|
-
super().__init__(field)
|
|
36
|
-
self._data = data
|
|
37
|
-
self.shape = data.shape
|
|
38
|
-
|
|
39
|
-
def to_numpy(self, flatten=False, dtype=None, index=None):
|
|
40
|
-
data = self._data
|
|
41
|
-
if dtype is not None:
|
|
42
|
-
data = data.astype(dtype)
|
|
43
|
-
if flatten:
|
|
44
|
-
data = data.flatten()
|
|
45
|
-
if index is not None:
|
|
46
|
-
data = data[index]
|
|
47
|
-
return data
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class NewMetadataField(WrappedField):
|
|
51
|
-
def __init__(self, field, **kwargs):
|
|
52
|
-
super().__init__(field)
|
|
53
|
-
self._metadata = kwargs
|
|
54
|
-
|
|
55
|
-
def metadata(self, *args, **kwargs):
|
|
56
|
-
if len(args) == 1 and args[0] in self._metadata:
|
|
57
|
-
return self._metadata[args[0]]
|
|
58
|
-
return self._field.metadata(*args, **kwargs)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
class NewValidDateTimeField(NewMetadataField):
|
|
62
|
-
def __init__(self, field, valid_datetime):
|
|
63
|
-
date = valid_datetime.date().strftime("%Y%m%d")
|
|
64
|
-
time = valid_datetime.time().strftime("%H%M")
|
|
65
|
-
|
|
66
|
-
self.valid_datetime = valid_datetime
|
|
67
|
-
|
|
68
|
-
super().__init__(field, date=date, time=time, step=0, valid_datetime=valid_datetime.isoformat())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|