Skip to content

TYP: add type annotations to a couple utility functions in nddata - #16546

Merged
nstarman merged 1 commit into
astropy:mainfrom
neutrinoceros:nddata/typ/annotate_utils
Nov 19, 2025
Merged

nstarman merged 1 commit into
astropy:mainfrom
neutrinoceros:nddata/typ/annotate_utils

Conversation

@neutrinoceros

Copy link
Copy Markdown
Contributor

Description

A by-product of my reviewing #16544

  • 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 github-actions Bot added the nddata label Jun 7, 2024
@github-actions

github-actions Bot commented Jun 7, 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 v7.0.0 milestone Jun 7, 2024
@eerovaher eerovaher added the typing related to type annotations label Jun 7, 2024

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

Maybe it would be a good idea to introduce a type variable for the datatype of the arrays, like astropy/utils/shapes.py does.

Comment thread astropy/nddata/utils.py Resolved
Comment thread astropy/nddata/utils.py Resolved
Comment thread astropy/nddata/utils.py Resolved
Comment thread astropy/nddata/utils.py Resolved
@neutrinoceros
neutrinoceros force-pushed the nddata/typ/annotate_utils branch from c6f4f80 to 290a719 Compare June 8, 2024 09:26
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

Thanks for your feedback @eerovaher. I should have addressed all your comments

Comment thread astropy/nddata/utils.py Resolved
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

switching to draft while I figure out how to make sphinx happy

@neutrinoceros
neutrinoceros marked this pull request as draft June 11, 2024 12:36
@neutrinoceros
neutrinoceros force-pushed the nddata/typ/annotate_utils branch from 43de850 to 757646d Compare June 12, 2024 08:37
@neutrinoceros
neutrinoceros marked this pull request as ready for review June 12, 2024 09:19

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

I don't have any typing suggestions left, other than the one remark that requires more familiarity with nddata than I have. Sub-package maintainers should have the final say.

Comment thread astropy/nddata/utils.py Resolved
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

rebased to fix a trivial conflict

@neutrinoceros
neutrinoceros force-pushed the nddata/typ/annotate_utils branch from 31886ff to 41529ab Compare October 16, 2024 07:59
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

rebased again to refresh CI and fix conflicts. This shouldn't block 7.0 (obviously), so I'm going to move it to 7.1

@neutrinoceros neutrinoceros modified the milestones: v7.0.0, v7.1.0 Oct 16, 2024
@github-actions github-actions Bot added the Close? Tell stale bot that this issue/PR is stale label Mar 16, 2025
@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.

@neutrinoceros
neutrinoceros force-pushed the nddata/typ/annotate_utils branch from 41529ab to 9fb902a Compare March 17, 2025 08:34
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

@mwcraig @bmorris3 @larrybradley can I get eyes on this ?

@astrofrog astrofrog added this to the v7.2.0 milestone Apr 28, 2025
@github-actions github-actions Bot added the closed-by-bot Closed by stale bot label Aug 15, 2025
@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 Aug 15, 2025
@mwcraig mwcraig reopened this Aug 18, 2025

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

I'm really sorryy I had overlooked this earlier, @neutrinoceros! I think the only change is Complex → Real

Comment thread astropy/nddata/utils.py Resolved
Comment thread astropy/nddata/utils.py Resolved
Comment thread astropy/nddata/utils.py Resolved
Comment thread astropy/nddata/utils.py Resolved
Comment thread docs/nitpick-exceptions Resolved
@pllim pllim removed Close? Tell stale bot that this issue/PR is stale closed-by-bot Closed by stale bot labels Aug 18, 2025
@pllim

pllim commented Aug 18, 2025

Copy link
Copy Markdown
Member

There are conflicts now. Would need rebase, which will also give you a few more months.

@github-actions github-actions Bot added the Close? Tell stale bot that this issue/PR is stale label Aug 19, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Hi humans 👋 - this pull request hasn't had any new commits for approximately 5 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.

@neutrinoceros
neutrinoceros force-pushed the nddata/typ/annotate_utils branch from 9fb902a to 12fe6a4 Compare September 10, 2025 08:46
@neutrinoceros
neutrinoceros marked this pull request as draft September 10, 2025 08:46
@neutrinoceros
neutrinoceros force-pushed the nddata/typ/annotate_utils branch from 12fe6a4 to ea62e0e Compare September 10, 2025 08:47
@neutrinoceros neutrinoceros removed the Close? Tell stale bot that this issue/PR is stale label Sep 10, 2025
@neutrinoceros
neutrinoceros force-pushed the nddata/typ/annotate_utils branch 2 times, most recently from 7d6e196 to a39e0f6 Compare September 10, 2025 09:08
@neutrinoceros
neutrinoceros marked this pull request as ready for review September 10, 2025 09:16
@neutrinoceros

neutrinoceros commented Sep 10, 2025 •

Copy link
Copy Markdown
Contributor Author

sorry about the delay in my reply. I've updated the PR as suggested by @mwcraig but also replaced numbers protocols with simple float and complex annotations, which I find better suited in situations where numpy types are accepted. This should be ready for final review now 🤞🏻

@mwcraig mwcraig 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 @neutrinoceros!

@astrofrog astrofrog modified the milestones: v7.2.0, v8.0.0 Nov 3, 2025
@nstarman

Copy link
Copy Markdown
Member

@eerovaher this has approval from the sub-package maintainer. If you rebase, I think we can get this in.

@neutrinoceros
neutrinoceros force-pushed the nddata/typ/annotate_utils branch from 4cd7133 to fd0c0e5 Compare November 19, 2025 14:15
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

I just rebased, fwiw

@nstarman
nstarman merged commit 21810cf into astropy:main Nov 19, 2025
33 checks passed
@neutrinoceros
neutrinoceros deleted the nddata/typ/annotate_utils branch November 19, 2025 16:14
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.

6 participants