Skip to content

types(cosmo): vectorize_redshift_method - #18801

Merged
nstarman merged 2 commits into
astropy:mainfrom
nstarman:cosmo/typing/vectorize_redshift_method
Jul 14, 2026
Merged

nstarman merged 2 commits into
astropy:mainfrom
nstarman:cosmo/typing/vectorize_redshift_method

Conversation

@nstarman

@nstarman nstarman commented Oct 30, 2025 •

Copy link
Copy Markdown
Member

Add type annotations to vectorize_redshift_method.

  • 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.

@github-actions

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.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@nstarman nstarman moved this from Triage to In Progress in Cosmology, the Expansion Oct 30, 2025
@nstarman nstarman changed the title types: vectorize_redshift_method types(cosmo): vectorize_redshift_method Nov 11, 2025
@nstarman
nstarman marked this pull request as ready for review November 11, 2025 01:22
@nstarman
nstarman requested a review from a team as a code owner November 11, 2025 01:22
@nstarman
nstarman requested a review from mhvk November 14, 2025 21:32
@nstarman
nstarman force-pushed the cosmo/typing/vectorize_redshift_method branch from f7439dc to f497e17 Compare November 16, 2025 17:23
@nstarman

Copy link
Copy Markdown
Member Author

CI failure appears to be unrelated.

@nstarman

Copy link
Copy Markdown
Member Author

Thanks @neutrinoceros for reviewing the preceding PR.

@nstarman
nstarman force-pushed the cosmo/typing/vectorize_redshift_method branch 2 times, most recently from ec893c8 to ace83eb Compare November 19, 2025 18:08

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

Interesting case. Since the function isn't public, would it make sense to refactor it into 2 more specialized functions to avoid having a union as the return type ?

@nstarman

nstarman commented Nov 20, 2025 •

Copy link
Copy Markdown
Member Author

Could do, but this is the standard way to build a decorator with keyword arguments (e.g. https://realpython.com/primer-on-python-decorators/#creating-decorators-with-optional-arguments tutorial), so this is a pretty standard type annotation pattern.
That being said, I think vectorize_redshift_method is only ever used as a decorator, so it could be refactored accordingly. Could be worth it. Small speedup to module load time 🤔

Refactoring changes application of vectorize_redshift_method from @vectorize_redshift_method to @ vectorize_redshift_method(), which is a little non-standard.

@nstarman

nstarman commented Dec 5, 2025

Copy link
Copy Markdown
Member Author

@neutrinoceros WDYT of the new decorator? Refactoring changes application of vectorize_redshift_method from @vectorize_redshift_method to @ vectorize_redshift_method(), which is a little non-standard.

@github-actions github-actions Bot added the Close? Tell stale bot that this issue/PR is stale label Apr 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then.

In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary.

If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock.

If you believe I commented on this pull request incorrectly, please report this here.

@nstarman

Copy link
Copy Markdown
Member Author

Ping @neutrinoceros. I'll rebase if it looks good.

@astrofrog astrofrog modified the milestones: v8.0.0, v8.1.0 May 5, 2026
@nstarman

Copy link
Copy Markdown
Member Author

Ping @neutrinoceros for thoughts. I'm still not sold on the @decorator() versus @decorator.

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

To me, having a slightly uglier decorator is worth avoiding a union in a return type. Also, it's private API so we can change it again later if we find a better way.
I can approve this in the current state, but can't merge yet because there's a conflict. Feel free to self-merge once it's resolved, though

@github-project-automation github-project-automation Bot moved this from In Progress to Reviewer approved in Cosmology, the Expansion May 27, 2026
@github-actions github-actions Bot added the closed-by-bot Closed by stale bot label May 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

I'm going to close this pull request as per my previous message. If you think what is being added/fixed here is still important, please remember to open an issue to keep track of it. Thanks!

If this is the first time I am commenting on this issue, or if you believe I closed this issue incorrectly, please report this here.

@github-actions github-actions Bot closed this May 29, 2026
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Cosmology, the Expansion May 29, 2026
@neutrinoceros

Copy link
Copy Markdown
Contributor

ah, well, feel free to re-open this

@nstarman nstarman reopened this Jul 14, 2026
@github-project-automation github-project-automation Bot moved this from Done to In Progress in Cosmology, the Expansion Jul 14, 2026
@nstarman
nstarman force-pushed the cosmo/typing/vectorize_redshift_method branch from 6883fe0 to 87a3229 Compare July 14, 2026 21:50
@nstarman

Copy link
Copy Markdown
Member Author

Re-opening and rebasing!

@nstarman
nstarman merged commit 494d524 into astropy:main Jul 14, 2026
37 of 39 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Cosmology, the Expansion Jul 14, 2026
@nstarman
nstarman deleted the cosmo/typing/vectorize_redshift_method branch July 14, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Close? Tell stale bot that this issue/PR is stale closed-by-bot Closed by stale bot cosmology no-changelog-entry-needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants