Skip to content

BUG: Change dtype comparison in _view_is_safe to be independent of name fields. #13261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

lukas-braun
Copy link

I have changed the _view_is_safe in _internal.py such that the comparison of dtypes is independent of the name field in structured arrays. This fixes issue #13213

@eric-wieser
Copy link
Member

Haven't looked at this in detail, but I think it might relate to #8514

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this approach does not work for structured dtype with padding in them

@charris charris changed the title BUG: Changed dtype comparison in _view_is_safe to be independent of name fields #13213 BUG: Change dtype comparison in _view_is_safe to be independent of name fields #13213 Apr 16, 2019
@charris charris changed the title BUG: Change dtype comparison in _view_is_safe to be independent of name fields #13213 BUG: Change dtype comparison in _view_is_safe to be independent of name fields. Apr 16, 2019
@charris charris added 09 - Backport-Candidate PRs tagged should be backported component: numpy._core labels Apr 16, 2019
@mattip
Copy link
Member

mattip commented Apr 29, 2019

@lukasbrauncom do you wish to move forward with this? It needs tests that fail before this PR and now pass, and those tests should address the problem of padding.

@charris
Copy link
Member

charris commented Aug 24, 2019

@eric-wieser Is this impacted by your recent fixups?

return ndtype.type
return newdtype

if oldtype.names or oldtype.names:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, one of these should say newtype.

Should also use .names is not None here and above.

@charris
Copy link
Member

charris commented Sep 8, 2020

@eric-wieser Want to fix this up?

@charris charris added this to the 1.19.3 release milestone Sep 8, 2020
@eric-wieser eric-wieser self-requested a review September 8, 2020 17:28
@charris charris removed this from the 1.21.0 release milestone Feb 6, 2021
Base automatically changed from master to main March 4, 2021 02:04
@seberg seberg removed the 09 - Backport-Candidate PRs tagged should be backported label Apr 6, 2022
@seberg
Copy link
Member

seberg commented Apr 6, 2022

We discussed this briefly, and the backport candidate label seemed unnecessary. I am going to close this due to the fact that it stalled for a longer time and would at least need new tests. I also expect that the machinery/fixes from gh-19346 could be interesting to generalize this more, although they are only available in C and not quite aligned with this, I think checking view_offset == 0 may give a more generalized result than the version here. (And staying in C is probably even nice.)

@seberg seberg closed this Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants