Skip to content

Conversation

@Julian-Harbeck
Copy link

Resolves issue with objects of a subclass of np.ndarray to be converted to float in item_from_zerodim

Not sure if there should be a test to cover this case. Could be created with a TestArray class as shown in #62981. Also should the docstring of the function be modified to reflect that now only objects of np.ndarray are converted? Current description is a bit ambigues:

If the value is a zerodim array, return the item it contains.

@Julian-Harbeck Julian-Harbeck changed the title Stop item_from_zerodim from converting subclasses of np.ndarray to float BUG: Stop item_from_zerodim from converting subclasses of np.ndarray to float Nov 5, 2025
@jbrockmendel
Copy link
Member

Not sure if there should be a test to cover this case. Could be created with a TestArray class as shown in #62981. Also should the docstring of the function be modified to reflect that now only objects of np.ndarray are converted? Current description is a bit ambigues:

Not a deal-breaker, but I'd feel better if there were a test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: item_from_zerodim converts objects of subclasses of ndarray to float

2 participants