Skip to content

Commit

Permalink
fix(wea): Reorder wea handler
Browse files Browse the repository at this point in the history
Otherwise the timestep and is_annual checks will not happen for wea files but only for Wea objects.
  • Loading branch information
mikkelkp committed Feb 26, 2025
1 parent 62a953e commit 4dc5dd1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pollination_handlers/inputs/wea.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ def wea_handler_timestep_annual_check(wea_obj):
Returns:
str -- Path to a wea file.
"""
if isinstance(wea_obj, Wea):
assert wea_obj.timestep == 1, 'Wea timestep must be 1 for this recipe.'
assert wea_obj.is_annual, 'Wea must be annual for this recipe.'
return wea_handler(wea_obj)
wea_file = wea_handler(wea_obj)
wea_obj = Wea.from_file(wea_file)
assert wea_obj.timestep == 1, 'Wea timestep must be 1 for this recipe.'
assert wea_obj.is_annual, 'Wea must be annual for this recipe.'
return wea_file


def _wea_file_name(wea_obj):
Expand Down

0 comments on commit 4dc5dd1

Please sign in to comment.