8000 BUG: fix incorrect output descriptor in fancy indexing by ngoldbaum · Pull Request #27715 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: fix incorrect output descriptor in fancy indexing #27715

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 3 commits into from
Nov 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TST: add segfaulting test
  • Loading branch information
ngoldbaum committed Nov 13, 2024
commit 72da79860760d0239a9c235b4c4014e3574da451
18 changes: 16 additions & 2 deletions numpy/_core/tests/test_stringdtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,23 @@ def test_fancy_indexing(string_list):
sarr = np.array(string_list, dtype="T")
assert_array_equal(sarr, sarr[np.arange(sarr.shape[0])])

inds = [
[True, True],
[0, 1],
...,
np.array([0, 1], dtype='uint8'),
]

lops = [
['a'*25, 'b'*25],
['', ''],
['hello', 'world'],
['hello', 'world'*25],
]

# see gh-27003 and gh-27053
for ind in [[True, True], [0, 1], ..., np.array([0, 1], dtype='uint8')]:
for lop in [['a'*25, 'b'*25], ['', '']]:
for ind in inds:
for lop in lops:
a = np.array(lop, dtype="T")
assert_array_equal(a[ind], a)
rop = ['d'*25, 'e'*25]
Expand Down
Loading
0