Skip to content

BUG: Fix astype for structured array fields of different byte order. #5480

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 1 commit into from
Jan 22, 2015

Conversation

charris
Copy link
Member

@charris charris commented Jan 22, 2015

The offending commit is c53b0e4, which introduced two regressions:

  • using astype to cast a structured array to one with a different byte
    order no longer works;
  • comparing structured-array dtypes can give incorrect results if the
    two dtypes have different byte orders.

This pull request should fix both.

One thing I wasn't sure about is reordering struct fields. In my
implementation, the equiv, same_kind, and safe rules are now
allowed to reorder fields. If that isn't desired, though, it's a pretty
easy change.

The offending commit is c53b0e4, which introduced two regressions:

- using astype to cast a structured array to one with a different byte
  order no longer works;
- comparing structured-array dtypes can give incorrect results if the
  two dtypes have different byte orders.

This pull request should fix both.

One thing I wasn't sure about is reordering struct fields.  In my
implementation, the `equiv`, `same_kind`, and `safe` rules are now
allowed to reorder fields.  If that isn't desired, though, it's a pretty
easy change.
@charris
Copy link
Member Author

charris commented Jan 22, 2015

Unfortunately, this does not rebase cleanly for backport, so will cherry-pick.

@charris
Copy link
Member Author

charris commented Jan 22, 2015

Cleanup of #5279.

charris added a commit that referenced this pull request Jan 22, 2015
BUG: Fix astype for structured array fields of different byte order.
@charris charris merged commit 723a1ee into numpy:master Jan 22, 2015
@charris charris deleted the cleanup-gh-5279 branch January 22, 2015 20:18
charris referenced this pull request Jan 22, 2015
BUG: Fix astype for structured array fields of different byte order.
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.

1 participant