Skip to content

MAINT cleanup isfinite cython implementation - #23849

Merged
glemaitre merged 8 commits into
scikit-learn:mainfrom
jakirkham:tidy_isfinite
Jul 7, 2022
Merged

glemaitre merged 8 commits into
scikit-learn:mainfrom
jakirkham:tidy_isfinite

Conversation

@jakirkham

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Follow up to PR ( #23197 )

What does this implement/fix? Explain your changes.

Some minor tidying/cleanup of the Cython code.

Any other comments?

NA

cc @Micky774

jakirkham added 6 commits July 6, 2022 16:35
These already return `bint`, which Cython will treat as `True`/`False`
and check accordingly. So drop the `!= 0` comparison.
The `FiniteStatus` enum can be used directly in Python & C code. So use
it directly instead of an `int` for clarity and simplicity.
Avoids repeated indexing in cases where it is reused.

@thomasjpfan thomasjpfan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the follow up PR!

LGTM

@glemaitre glemaitre changed the title [MNT] Tidy isfinite MAINT cleanup isfinite cython implementation Jul 7, 2022
@glemaitre
glemaitre merged commit 426d1ab into scikit-learn:main Jul 7, 2022
@glemaitre

Copy link
Copy Markdown
Member

Thanks @jakirkham LGTM

@jakirkham

Copy link
Copy Markdown
Contributor Author

Thanks you both! 🙏

@jakirkham
jakirkham deleted the tidy_isfinite branch July 7, 2022 23:06
ogrisel pushed a commit to ogrisel/scikit-learn that referenced this pull request Jul 11, 2022
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.

3 participants