Skip to content

Commit

Permalink
added a finally to assume extrapolation flag is reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBarker-NOAA committed Jul 17, 2024
1 parent d3c0ab9 commit 5dd2f17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion py_gnome/gnome/environment/wind.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ def at(self, points, time, *, units=None, extrapolate=None, coord_sys='uv',_auto
# CyTimeseries is raising an IndexError
raise ValueError(f'time specified ({time}) is not within the bounds of the time: '
f'({self.data_start} to {self.data_stop})')
self.extrapolation_is_allowed = original_extrapolation # put it back the way it was
finally: # make sure it gets restored even if there's an error
self.extrapolation_is_allowed = original_extrapolation # put it back the way it was

if idx is None:
ret_data[:, 0] = data[0]
Expand Down

0 comments on commit 5dd2f17

Please sign in to comment.