Skip to content

BUG: Ensure correct loop order in sin, cos, and arctan2#22986

Merged
charris merged 1 commit intonumpy:mainfrom
seberg:issue-22984
Jan 10, 2023
Merged

BUG: Ensure correct loop order in sin, cos, and arctan2#22986
charris merged 1 commit intonumpy:mainfrom
seberg:issue-22984

Conversation

@seberg
Copy link
Copy Markdown
Member

@seberg seberg commented Jan 10, 2023

These were incorrect afer being vectorized. The commit additional tests these (not arctan2 admittedly) and adds a check to generate_umath to make it a bit less likely that future additions add this type of thing.

Note that the check allows duplicated loops so long they are correctly ordered the first time. This makes results correct, but duplicated loops are not nice anyways and it would be nice to remove them.

We could drop them manually in hindsight even? In any case, that should not be backported, so it is not includedhere.

Closes gh-22984

These were incorrect afer being vectorized.  The commit additional
tests these (not arctan2 admittedly) and adds a check to generate_umath
to make it a bit less likely that future additions add this type of thing.

Note that the check allows duplicated loops so long they are correctly
ordered the *first* time.  This makes results correct, but duplicated
loops are not nice anyways and it would be nice to remove them.

We could drop them manually in hindsight even?  In any case, that should
not be backported, so it is not includedhere.

Closes numpygh-22984
TD('f', dispatch=[('loops_trigonometric', 'f')]),
TD('ed', dispatch=[('loops_umath_fp', 'ed')]),
TD('fdg' + cmplx, f='cos'),
TD('d', dispatch=[('loops_umath_fp', 'd')]),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These can be written a single line, but since that is not used anywhere, decided not to...

@charris charris merged commit e1c368c into numpy:main Jan 10, 2023
@charris
Copy link
Copy Markdown
Member

charris commented Jan 10, 2023

Thanks Sebastian. Does this need a backport?

@seberg seberg added the 09 - Backport-Candidate PRs tagged should be backported label Jan 10, 2023
@seberg
Copy link
Copy Markdown
Member Author

seberg commented Jan 10, 2023

Yes, sorry, forgot to tag.

@seberg seberg deleted the issue-22984 branch January 10, 2023 20:04
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Incorrect type list for some ufunc loops (sin, cos, arctan2)

2 participants