Skip to content

Commit

Permalink
use dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed Jan 16, 2025
1 parent 5e61b0d commit f587698
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/anemoi/transform/filters/regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


import logging
from collections import defaultdict

from earthkit.data.core.fieldlist import Field

Expand Down Expand Up @@ -127,7 +128,6 @@ def __call__(self, field):


def interpolator(in_grid, out_grid, method):
if method.startswith("anemoi."):
method = method.split(".")[1]
return AnemoiInterpolator(in_grid, out_grid, method)
return EarthkitInterpolator(in_grid, out_grid, method)
INTERPOLATORS = defaultdict(lambda: EarthkitInterpolator)
INTERPOLATORS["nearest"] = AnemoiInterpolator
return INTERPOLATORS[method](in_grid, out_grid, method)

0 comments on commit f587698

Please sign in to comment.