New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cosmo param dataclass #14874
Cosmo param dataclass #14874
Conversation
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.
|
👋 Thank you for your draft pull request! Do you know that you can use |
3d863c7
to
9a8f4cd
Compare
93b2346
to
03b0d96
Compare
04b9efe
to
7d985dd
Compare
a4ebe9c
to
527a039
Compare
Probably because you have no docstring for those attributes and Sphinx is trying to auto-generate something but then is choking because of private module? # Units
unit: UnitField = UnitField() # noqa: RUF009 fvalidate: FValidateField = FValidateField(default="default") # noqa: RUF009 |
I used to have docstrings, but removed them in |
Alas, I am not familiar with this particular error. You can try look in |
bbaa007
to
49d67b9
Compare
Thanks! figured it out. Sphinx doesn't like semi-public descriptors. |
@WilliamJamieson @mhvk @eerovaher, I got all the checks passing! |
99445f9
to
d91d796
Compare
aded5a3
to
0825681
Compare
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
0825681
to
03b6339
Compare
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
03b6339
to
cbf03b1
Compare
@eerovaher, RTD is rendering the attribute descriptions. https://astropy--14874.org.readthedocs.build/en/14874/api/astropy.cosmology.Parameter.html#astropy.cosmology.Parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e6e6e8f
to
2a2eec4
Compare
f1fce09
to
290404c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff on GitHub looks good enough to merge, but when I looked at the What's New page on RTD I noticed that the new entry is not under the right section. Other than that this looks good to go.
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com> Co-authored-by: Eero Vaher <eero.vaher@gmail.com> Signed-off-by: nstarman <nstarman@users.noreply.github.com>
The pains of rebasing! Thanks for noticing. |
290404c
to
898ad6f
Compare
Thank you @eerovaher for the many valuable reviews! |
Description
Cosmology Parameters are now dataclass.
Why? b/c dataclasses are nice:
dataclasses
module.dataclasses
's functionsIn this PR:
_registry_validators
had to be factored off of the class._init_arguments
because dataclasses havereplace
!Changedfvalidate
from the processed value to the original one. This is a breaking change.Future note: in py3.13+ https://peps.python.org/pep-0712/ will allow the
UnitField
class to be replaced with theconverter
argument tofield()
. In the meantime, it's a private dataclass field descriptor.