-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Today I ran into this error:
UnboundLocalError: cannot access local variable 'endpoints' where it is not associated with a value
Sorry I don't have a minimal reproducible example yet. I'll try to make one ASAP.
Just posting in case others already know what's going on.
From what I can tell, this happens because the case where order not in ["ascending", "descending"]
isn't covered.
See:
cf-xarray/cf_xarray/helpers.py
Lines 335 to 340 in 70be853
if order == "ascending": | |
endpoints = np.minimum(bounds[..., :, 0], bounds[..., :, 1]) | |
last_endpoint = np.maximum(bounds[..., -1, 0], bounds[..., -1, 1]) | |
elif order == "descending": | |
endpoints = np.maximum(bounds[..., :, 0], bounds[..., :, 1]) | |
last_endpoint = np.minimum(bounds[..., -1, 0], bounds[..., -1, 1]) |
This seems to have been introduced with PR #579
Maybe @tomvothecoder has thoughts?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working