Skip to content

Commit

Permalink
tidy up code
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Jul 9, 2024
1 parent 3086431 commit 6e9bb2f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/anemoi/datasets/create/functions/filters/rotate_winds.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from collections import defaultdict

import tqdm
from anemoi.utils.humanize import plural
from earthkit.data.indexing.fieldlist import FieldArray
from earthkit.geo.rotate import rotate_vector
Expand Down Expand Up @@ -39,7 +40,7 @@ def execute(
):
from pyproj import CRS

context.trace("🔄", "Rotating", plural(len(x_wind), "wind"))
context.trace("🔄", "Rotating winds (extracting winds from ", plural(len(input), "field"))

result = FieldArray()

Expand All @@ -61,7 +62,9 @@ def execute(

wind_pairs[key][param] = f

for _, pairs in wind_pairs.items():
context.trace("🔄", "Rotating", plural(len(wind_pairs), "wind"), "(speed will likely include data download)")

for _, pairs in tqdm.tqdm(list(wind_pairs.items())):
if len(pairs) != 2:
raise ValueError("Missing wind component")

Expand Down

0 comments on commit 6e9bb2f

Please sign in to comment.