Skip to content

BUG: Fix PyArray_DescrAlignConverter2 on tuples - #15267

Merged
seberg merged 1 commit into
numpy:masterfrom
eric-wieser:fix-tuple-PyArray_DescrAlignConverter2
Jan 7, 2020
Merged

seberg merged 1 commit into
numpy:masterfrom
eric-wieser:fix-tuple-PyArray_DescrAlignConverter2

Conversation

@eric-wieser

@eric-wieser eric-wieser commented Jan 6, 2020 •

Copy link
Copy Markdown
Member

The previous implementation of PyArray_DescrAlignConverter2 did not match PyArray_DescrAlignConverter, and only the latter would actually apply the alignment flag to union subarray types.

What happened here is that ab9953b (#10923) fixed union types for PyArray_DescrAlignConverter but forgot to apply the same fix for PyArray_DescrAlignConverter2 .

Expressing one in terms of the other makes this problem go away.

Numpy has no internal callers of PyArray_DescrAlignConverter2.


Split from #15265, since that failed in a peculiar way in only non-windows CI, and submitting this commit separately will allow me to bisect.

The previous implementation of `PyArray_DescrAlignConverter2` did not match `PyArray_DescrAlignConverter`, and only the latter would actually apply the alignment flag to union types.

What happened here is that `ab9953baf29ace44ef1f014f3713f1ee919f79bb` fixed union types for `PyArray_DescrAlignConverter` but forgot to apply the same fix for `PyArray_DescrAlignConverter2` .

Expressing one in terms of the other makes this problem go away.

Numpy has no internal callers of PyArray_DescrAlignConverter2.
@seberg

seberg commented Jan 7, 2020

Copy link
Copy Markdown
Member

LGTM, can we use the test from gh-10923 to include a function that uses the NULL version?

@eric-wieser

Copy link
Copy Markdown
Member Author

to include a function that uses the NULL version

Are you suggesting I add a new function to test_multiarray? There are no existing callers of this converter to be tested, and I'd perhaps argue that the 5 or so lines of code left in this function aren't interesting enough to bother with writing a c-side test.

@seberg

seberg commented Jan 7, 2020

Copy link
Copy Markdown
Member

Yeah, I thought someone would be calling it indirectly, but I guess that is not possible, since you cannot pass the aligned flag to any of the functions except np.dtype. I am OK with this then, much simpler anyway.

@eric-wieser

Copy link
Copy Markdown
Member Author

Only 4 occurences of the symbol in our entire codebase, all only definitions:

https://github.com/numpy/numpy/search?q=PyArray_DescrAlignConverter2&unscoped_q=PyArray_DescrAlignConverter2

@seberg

seberg commented Jan 7, 2020

Copy link
Copy Markdown
Member

Thanks Eric.

@seberg
seberg merged commit 94f9307 into numpy:master Jan 7, 2020
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.

2 participants