Skip to content

Commit

Permalink
Merge pull request #429 from ecmwf/feature/remove-normalize-kwargs-names
Browse files Browse the repository at this point in the history
Do not normalise metadata key names for sel, isel and order_by calls
  • Loading branch information
sandorkertesz authored Aug 7, 2024
2 parents c83df35 + 16307e7 commit b22e2a1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
6 changes: 0 additions & 6 deletions src/earthkit/data/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ def new_mask_index(self, *args, **kwargs):
def __len__(self):
self._not_implemented()

def _normalize_kwargs_names(self, **kwargs):
return kwargs

def sel(self, *args, remapping=None, **kwargs):
"""Uses metadata values to select a subset of the elements from a fieldlist-like object.
Expand Down Expand Up @@ -287,7 +284,6 @@ def sel(self, *args, remapping=None, **kwargs):
GribField(t,850,20180801,1200,0,0)
"""
kwargs = normalize_selection(*args, **kwargs)
kwargs = self._normalize_kwargs_names(**kwargs)
if not kwargs:
return self

Expand Down Expand Up @@ -382,7 +378,6 @@ def isel(self, *args, **kwargs):
"""
kwargs = normalize_selection(*args, **kwargs)
kwargs = self._normalize_kwargs_names(**kwargs)
if not kwargs:
return self

Expand Down Expand Up @@ -487,7 +482,6 @@ def order_by(self, *args, remapping=None, patches=None, **kwargs):
GribField(u,850,20180801,1200,0,0)
"""
kwargs = normalize_order_by(*args, **kwargs)
kwargs = self._normalize_kwargs_names(**kwargs)

remapping = build_remapping(remapping, patches)

Expand Down
3 changes: 0 additions & 3 deletions src/earthkit/data/readers/grib/index/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def unique_values(self, *coords, remapping=None, progress_bar=None):
# print("Not using remapping here")

coords = {k: None for k in coords}
coords = self._normalize_kwargs_names(**coords)
coords = list(coords.keys())
# print("coords:", coords)
values = self.db.unique_values(*coords, remapping=remapping).values()
Expand All @@ -84,7 +83,6 @@ def filter(self, filter):

def sel(self, *args, remapping=None, **kwargs):
kwargs = normalize_selection(*args, **kwargs)
kwargs = self._normalize_kwargs_names(**kwargs)
if DATETIME in kwargs and kwargs[DATETIME] is not None:
kwargs = _normalize_grib_kwargs_values(**kwargs)

Expand All @@ -94,7 +92,6 @@ def sel(self, *args, remapping=None, **kwargs):

def order_by(self, *args, remapping=None, **kwargs):
kwargs = normalize_order_by(*args, **kwargs)
kwargs = self._normalize_kwargs_names(**kwargs)

out = self

Expand Down

0 comments on commit b22e2a1

Please sign in to comment.