Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BUG: Make dtype.descr error for out-of-order fields.#10562

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
charris merged 3 commits intonumpy:maintenance/1.14.xfromcharris:backport-10391
Feb 9, 2018

Conversation

@charris
Copy link
Member

@charrischarris commentedFeb 9, 2018
edited
Loading

Backport of#10391.

cc@ahaldane since#6053 exposes this to user code more often.

Currently returns garbage, Now

>>> data = np.zeros(1, dtype=[('a', int), ('b', float)])>>> data = data[['b','a']]>>> data.dtype.descrValueError

@charrischarris added this to the1.14.1 release milestoneFeb 9, 2018
y=self.data[['col2','col1']]
assert_equal(y.dtype.names, ('col2','col1'))
assert_raises(ValueError,lambda:y.dtype.descr)

Copy link
Member

Choose a reason for hiding this comment

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

These tests aren't valid in 1.14.1. I would replace the entire function with

dt=dtype({'names': ['a','b'],'formats': ['i4','i4'],'offsets': [4,0]})y=np.rec.fromrecords([(1,2), (4,5)],dtype=dt)assert_raises(ValueError,lambda:y.dtype.descr)

@ahaldane
Copy link
Member

I am going to try out the online editor to put my fixup, let me know if it is annoying or doesn't work somehow.

@charrischarris merged commite651b50 intonumpy:maintenance/1.14.xFeb 9, 2018
@charrischarris deleted the backport-10391 branchFebruary 9, 2018 21:39
@charris
Copy link
MemberAuthor

Thanks for the fix, Allan.

@ahaldane
Copy link
Member

No, because master has the copy->view change. This is for the 1.14.x branch where that was reverted.

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

Reviewers

1 more reviewer

@ahaldaneahaldaneahaldane left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@charris@ahaldane@eric-wieser

[8]ページ先頭

©2009-2025 Movatter.jp