Repository navigation
Conversation
InessaPawson
left a comment
There was a problem hiding this comment.
Thank you for working on this, @danggeun!
A couple of things to fix:
- With a signature, 0-dimensional byte-string array results come out too wide. Could you fix it and add a regression test?
- Could you also add a test for non-scalar string outputs?
@seberg, do you think the changes in behavior for chararray and size-0 string arrays are acceptable here?
|
Hmm, I'm not sure about this. For general Note that what I do find a bug is that I cannot pass in p.s. On subclasses, I did not check why they would not work in the present PR, but think that they should. |
I looked again at the two behaviour changes listed in the description, and both can be avoided. I updated the description. Size-0 results now keep their dtype, as on main. In a separate commit, @mhvk, without a signature, |
PR summary
With a
signature,vectorizecreates the output arrays from the first result, so longer strings that come later are silently truncated. With a string type inotypes, the length is dropped whenotypesis stored, so the array is created as<U1/S1and every result is cut to one character.String outputs are now collected in object arrays and converted at the end, when the longest result is known, as the path without a
signaturealready does.Outputs that are not strings are unchanged. A length given in
otypesis still not kept, as without asignature:otypes=["<U10"]gives<U2when the results are'64'and'7'.Testing: test_function_base.py gives 1438 passed. 11 of the 13 new tests fail without the fix; the other two check that behaviour from main is kept.
Closes #23442.
AI Disclosure
I used an AI assistant (Claude) to prototype the patch and the tests, and to put this description into English from my notes. I ran
test_function_base.pybefore and after the patch and a behaviour diff over string and non-string outputs myself.