Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: Fix for #10533 np.dtype(ctype) does not respect endianness #12380

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

Merged
merged 7 commits into from
Nov 15, 2018
Merged

BUG: Fix for #10533 np.dtype(ctype) does not respect endianness #12380

merged 7 commits into from
Nov 15, 2018

Conversation

bmakos
Copy link
Contributor

@bmakos bmakos commented Nov 13, 2018

See: #10533
Added some code that uses the name of the ctypes type. Also
added some new test to make sure we'll know if the ctypes data
that allows this workaround breaks in the future.

See: #10533
Added some code that uses the __name__ of the ctypes type. Also
added some new test to make sure we'll know if the ctypes data
that allows this workaround breaks in the future.
Solved the recursiveness issue that failed the automated test.
Also did some of Eric's requested changes.
'if t.__ctypes_be__ is t' on Eric's suggestion.
@eric-wieser eric-wieser added this to the 1.16.0 release milestone Nov 14, 2018
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.

Looks great, thanks! I plan to squash together all the commits when I merge

@bmakos
Copy link
Contributor Author

bmakos commented Nov 15, 2018

Thank you for the review Eric! I enjoyed working on this. I'll go choose some other bug today to check out.

@eric-wieser
Copy link
Member

If @euler16 doesn't pick it back up, I'm sure you'd have an easy time of #12273. On the one hand, it'd be great to leave them a chance to contribute - but on the other hand, I'd really like to be able to say that 1.16 has full ctypes support. Let's give them a few more days to reply...

@bmakos
Copy link
Contributor Author

bmakos commented Nov 15, 2018

I was thinking the same. I will wait a few days and if he won't reply I will send a PR. I was also looking at #11304 to work on.

@charris charris merged commit 1fccdcc into numpy:master Nov 15, 2018
@charris
Copy link
Member

charris commented Nov 15, 2018

Thanks @bmakos and Eric.

@bmakos bmakos deleted the fix#10533 branch November 15, 2018 14:52
liwt31 pushed a commit to liwt31/numpy that referenced this pull request Nov 19, 2018
…umpy#12380)

* BUG: Fix for numpy#10533 np.dtype(ctype) does not respect endianness

See: numpy#10533
Added some code that uses the __name__ of the ctypes type. Also
added some new test to make sure we'll know if the ctypes data
that allows this workaround breaks in the future.

* Fix for numpy#10533 np.dtype(ctype) does not respect endianness

Removed the TODO for this bug.

* Fix for numpy#10533 np.dtype(ctype) does not respect endianness

Solved the recursiveness issue that failed the automated test.
Also did some of Eric's requested changes.

* Small mistake in the new function fixed.

* Changed 'if t.__name__.endswith('_be') ' with
'if t.__ctypes_be__ is t' on Eric's suggestion.

* Code cleanup on Eric's recommendations.

* Cleaned up the tests on Eric's suggestions.
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.

3 participants