Skip to content

interval_where_one logic fails when using an (xr.DataArray, float) tuple #947

@aaTman

Description

@aaTman

When running tw_squared_error I ran into a bug that causes the code to fail out if the first object in the tuple for interval_where_one is an xr.DataArray and the second is a float, e.g. np.inf.

I think I pinpointed the issue:

a, b = interval_where_one
if isinstance(a, (float, int)):
a = xr.DataArray(a)
b = xr.DataArray(b)

Where b in this case will not be converted into a xr.DataArray, resulting in any methods, e.g. .min() failing.

I'll get a PR set up ASAP for y'all!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions