Skip to content

BUG: Fix incorrectly passed size in masked processing#17828

Merged
charris merged 1 commit intonumpy:masterfrom
seberg:incorrect-size-in-masked-transfer
Nov 23, 2020
Merged

BUG: Fix incorrectly passed size in masked processing#17828
charris merged 1 commit intonumpy:masterfrom
seberg:incorrect-size-in-masked-transfer

Conversation

@seberg
Copy link
Copy Markdown
Member

@seberg seberg commented Nov 23, 2020

As noted in gh-17198 this was introduced when adding the error
return due to a bad copy or similar. Bad commit is
37dc69c

Closes gh-17198

As noted in numpygh-17198 this was introduced when adding the error
return due to a bad copy or similar. Bad commit is
37dc69c

Closes numpygh-17198
@charris
Copy link
Copy Markdown
Member

charris commented Nov 23, 2020

I'm curious why only some of the returns from stransfer are checked for errors. The documentation doesn't say what return values the stransfer functions have except that it is integer.

@seberg
Copy link
Copy Markdown
Member Author

seberg commented Nov 23, 2020

There are a few masked ones that I missed, I was going to make a PR tomorrow for them. Almost all should be checked, there may be some that just can never error, but those should be pretty deep, e.g. in dtype_transfer.c.

@seberg
Copy link
Copy Markdown
Member Author

seberg commented Nov 23, 2020

@charris to be clear, the stransfer had no return value at all until recently. Right now the only valid return values are 0 and -1 for error. We could think about more complex schemes, such as returning the unprocessed number of items.

The function here actually is supposed to return the number of processed elements (as per documentation), but... That fact is not even used (I presume it was used in some initial version, or just done with potential improvement in mind).

There is some reason for doing that, but it is one of those things that is reaching my limit of playing it out without having a clear, simple, use.

@charris
Copy link
Copy Markdown
Member

charris commented Nov 23, 2020

The function here actually is supposed to return the number of processed elements

Probably copied from similar C library functions (read/write).

@charris charris merged commit a0f9f50 into numpy:master Nov 23, 2020
@charris
Copy link
Copy Markdown
Member

charris commented Nov 23, 2020

Thanks Sebastian.

@seberg seberg deleted the incorrect-size-in-masked-transfer branch November 23, 2020 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: np.less segfault regression

2 participants