Skip to content

Ensure cenfunc and stdfunc scalars are np.float64 - #16431

Merged
pllim merged 2 commits into
astropy:mainfrom
larrybradley:stats-bottleneck
May 10, 2024
Merged

pllim merged 2 commits into
astropy:mainfrom
larrybradley:stats-bottleneck

Conversation

@larrybradley

Copy link
Copy Markdown
Member

Description

bottleneck returns float scalars -- this PR converts them to np.float64 scalars for consistency.
Addresses #15065 (comment)

Technically, this is a (minor) API change. Does it need a change log entry?

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

@larrybradley
larrybradley requested a review from mhvk May 9, 2024 20:56
@github-actions

github-actions Bot commented May 9, 2024

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@pllim pllim added this to the v6.1.1 milestone May 9, 2024
@pllim

pllim commented May 9, 2024

Copy link
Copy Markdown
Member

Does it need a change log entry?

Doesn't hurt? It is quite a subtle change. However, this will be backported (right?) and so the only option is "bug fix" and not "API change". 🤷‍♀️

@neutrinoceros neutrinoceros left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer we put the responsibility of the return type of SigmaClip._parse_(cen|std)func on the functions themselves, especially because in that context, bottleneck is already involved via HAS_BOTTLENECK so it's less likely to get out of sync somehow.

@neutrinoceros

Copy link
Copy Markdown
Contributor

And for what it's worth, I'd err on the side of classifying this as a bugfix: the fact that the return type of some function might depend on what I have installed is (I think) never expected.

@larrybradley

Copy link
Copy Markdown
Member Author

@neutrinoceros cenfunc and stdfunc can also be input as a user-defined callable function. So, I correct the return type after calling those functions to catch both bottleneck and any custom return functions.

I'll make this a bugfix and add a changelog entry.

@pllim pllim 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.

Thanks!

@pllim
pllim merged commit 5d6dce7 into astropy:main May 10, 2024
meeseeksmachine pushed a commit to meeseeksmachine/astropy that referenced this pull request May 10, 2024
pllim added a commit that referenced this pull request May 10, 2024
…431-on-v6.1.x

Backport PR #16431 on branch v6.1.x (Ensure cenfunc and stdfunc scalars are np.float64)
@larrybradley
larrybradley deleted the stats-bottleneck branch May 10, 2024 16:11
@mhvk

mhvk commented May 10, 2024

Copy link
Copy Markdown
Contributor

Belatedly (am travelling) - looks nice!

@mhvk mhvk mentioned this pull request May 11, 2024
5 tasks done
d-giles referenced this pull request in d-giles/astropy-abdufork Jul 26, 2024
* Ensure cenfunc and stdfunc scalars are np.float64

* Add changelog entry
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.

4 participants