Skip to content

feat: scale factor - #17151

Merged
neutrinoceros merged 2 commits into
astropy:mainfrom
nstarman:cosmo-api-sep-scale_factor
Oct 25, 2024
Merged

neutrinoceros merged 2 commits into
astropy:mainfrom
nstarman:cosmo-api-sep-scale_factor

Conversation

@nstarman

@nstarman nstarman commented Oct 9, 2024 •

Copy link
Copy Markdown
Member

Part of #17150

This one is just docstrings + minimal typing. The mixin was already separated out.

@nstarman nstarman added this to the v7.0.0 milestone Oct 9, 2024
@nstarman
nstarman requested a review from a team as a code owner October 9, 2024 21:34
@github-actions

github-actions Bot commented Oct 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 commented Oct 9, 2024

Copy link
Copy Markdown
Member

astropy/cosmology/flrw/base.py:docstring of astropy.cosmology.flrw.base._ScaleFactor.scale_factor:1: WARNING: py:class reference target not found: u.Quantity [ref.class]

Also, I don't think I am qualified to review typing stuff. I don't dabble with it much.

@nstarman
nstarman force-pushed the cosmo-api-sep-scale_factor branch from 5bb14a0 to a29c8df Compare October 10, 2024 02:36
@nstarman

Copy link
Copy Markdown
Member Author

astropy/cosmology/flrw/base.py:docstring of astropy.cosmology.flrw.base._ScaleFactor.scale_factor:1: WARNING: py:class > reference target not found: u.Quantity [ref.class]

Fixed the Sphinx warnings!

@nstarman nstarman mentioned this pull request Oct 10, 2024
1 task
Comment thread astropy/cosmology/flrw/base.py Outdated
Parameters
----------
z : Quantity-like ['redshift'], array-like
z : Quantity-like ['redshift'], array-like, positional-only

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.

Do you consider this an oversight from #16597 ? My understanding was that it was best to avoid this annotation over the deprecation period. If you disagree, I think it should be changed consistently.

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.

Hm. Yes. If the method raises a warning when passed by key word, it's probably best to tell users it's positional-only.
Let's change them all in a followup PR.

Comment thread astropy/cosmology/flrw/base.py Outdated
Returns
-------
a : ndarray or float
ndarray or float

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.

this doesn't seem consistent with the added annotation (no Quantity ?)

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.

It technically is (Q subclasses ndarray), but I agree Q should be added explicitly

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.

✅

@nstarman
nstarman force-pushed the cosmo-api-sep-scale_factor branch from a29c8df to c89c351 Compare October 10, 2024 13:40
@pllim

pllim commented Oct 10, 2024

Copy link
Copy Markdown
Member

Not quite.

astropy/cosmology/flrw/base.py:docstring of astropy.cosmology.flrw.base._ScaleFactor.scale_factor:18: WARNING: py:obj reference target not found: Quantity [ref.obj]

@nstarman

Copy link
Copy Markdown
Member Author

Fixed once more!

@nstarman

Copy link
Copy Markdown
Member Author

Yay! Thanks @neutrinoceros

@neutrinoceros

Copy link
Copy Markdown
Contributor

(My approval should turn green very soon 😀)

@neutrinoceros

Copy link
Copy Markdown
Contributor

It is green now. I'll rebase this for you and turn on auto-merge

Signed-off-by: nstarman <[email protected]>
Signed-off-by: nstarman <[email protected]>
@neutrinoceros
neutrinoceros force-pushed the cosmo-api-sep-scale_factor branch from d6e9fd1 to 64221e8 Compare October 25, 2024 13:08
@neutrinoceros
neutrinoceros merged commit 6fb0758 into astropy:main Oct 25, 2024
@nstarman
nstarman deleted the cosmo-api-sep-scale_factor branch October 25, 2024 15:43
@nstarman nstarman mentioned this pull request Dec 4, 2024
12 of 22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants