GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — BUG: fix loadtxt crash with existing StringDType dtype by ngoldbaum · Pull Request #33266 · numpy/numpy Conversation
Member
PR summaryUse the output array’s finalized descriptor when packing values in On Add a regression test for reusing an array’s StringDType and extend existing loadtxt tests to cover StringDType with Unicode, converters, quoting, and AI DisclosureI worked on this with an AI model
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
ngoldbaum
commented
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might want to check if we can do this unconditionally but structured dtypes with subarrays might not work correctly with this.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
seberg
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems right (and I assume the models thought it through as well). Mainly that one question: the dtype can be replaced mainly for If that isn't a problem here, then I would be tempted to not have a branch that feels a little unnecessary.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
@seberg for structured dtypes, dt = np.dtype([ ("a", np.dtype("i2").newbyteorder()), ("b", "i2") ]) np.loadtxt(["1 2"]).item() Doing the replacement unconditionally means this outputs (256, 2). However if I make the condition |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I was actually worried about this: So this seems OK, although, long term this really should walk the fields or probably finalize the descriptor first (and then create the array forcing identical descriptor which we can). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
BUG: fix loadtxt crash with existing StringDType dtype (#33266)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.