Repository navigation
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.
|
| >>> su.field_names | ||
| (['f0', ('f0', 'f1')], 'f1') | ||
| >>> su['f1'] | ||
| Unit("yr") | ||
| Unit('yr') |
There was a problem hiding this comment.
Notice that the quotes are now consistent with the quotes in field_names.
| "^Object with NFKC normalized name 'h' already exists in given namespace " | ||
| r'\(Unit\("h"\)\)\.$' | ||
| r"\(Unit\('h'\)\)\.$" |
There was a problem hiding this comment.
If this error message is ever shortened so that it would fit on one line then without this patch it would be necessary to explicitly escape the quotation marks within the string.
|
|
||
| >>> sc_gal.representation_component_units | ||
| {'l': Unit("deg"), 'b': Unit("deg")} | ||
| {'l': Unit('deg'), 'b': Unit('deg')} |
There was a problem hiding this comment.
No good reason for using both ' and " here.
The repr of Python strings uses `'`, not `"`, so for consistency the repr of `astropy` units should also use `'`. This change does not affect the representation of `Quantity` instances.
9a13d57 to
4485236
Compare
mhvk
left a comment
There was a problem hiding this comment.
Hmm, I think that original change is indeed a mistake, so from that perspective good to correct it. It is also is just that little bit cleaner repr, making it easier to parse (though inconsistent with ruff -- IMO, it would've been better if ruff preferred single quotes too).
It is more than a little churn, though, likely to break at least some doctests downstream as well, so I'd like agreement from the other reviewers that this is worth it.
Thankfully, in most cases (Quantity, Table, SkyCoord, etc.), the repr is not used; the corrections here are almost all just places where the docs explicitly look at a unit.
Overall, +0.5 myself.
|
Nobody has objected, so we can move forward with this.
I don't understand what you mean by that. |
Just grumpy me that ruff chose to use the quote for strings that is not the default in python |
mhvk
left a comment
There was a problem hiding this comment.
OK, happy to sign off on this for the units part.
Would like sign off for the other packages, though, so ping again @modelling, @cosmology, @taldcroft, @mwcraig, @bmorris3.
|
I would suggest to bump this up to an email to astropy-dev for consideration. This is a pretty good example of a PR that makes no functional improvement to astropy but has the potential to cause non-productive work downstream. |
|
So please DO NOT merge just yet. |
|
And my feedback is that we've lived this for 11 years and given the ruff precedent and significant potential for needless docstring breakage downstream, I'm 👎 on this PR. |
There was a problem hiding this comment.
Cosmology and units LGTM.
It is a move towards the PEP8 standards and general consistency with most other libraries.
While APE 2 does allow for __repr__ changes I do agree that Quantity and Unit are some of the most likely to show up in downstream doctests, so for that reason we should.
- Do this for a Major.0 release.
- Add to the what'snew a link to
pytest-doctestplus's instructions on how to restrict doctests to specific versions of Astropy.
|
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. |
|
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. |
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 6 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. |
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 1 year, 2 months. I plan to close this in a month 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. |
|
This was deferred to v8. That milestone has passed. @mhvk should we merge this? |
|
You cannot merge in this state. It has conflicts and failing CI. Someone has to take over if Eero is unresponsive. |
|
@nstarman - I'm still the same +0.5, and happy to get this in, but someone would need to clean it up and check against coordinated packages to have a sense of how much or little breakage this causes. Unfortunately, I don't see myself having time... |
|
Making this change so close to the end of the release cycle seems like the worst time for any downstream impacts. Having waited this long, what about planning to get this in shape to merge into main right after the 8.1 release and get it released in 9.0? |
|
If @eerovaher or someone else gets this rebased and passing CI again, then I expect it would be easy enough for me or @nstarman to use Claude to check all the coordinated packages with this branch. |
|
Agreed that we might as well wait for 9.0 now (above, we had said we'd do it in a major release). |
|
OK updated the milestone. Should still clean up the conflicts, which would also reset the stale timer and give you 5 more months. |
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 1 year, 3 months. I plan to close this in a month 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. 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. |
Description
The repr of Python strings uses
', not", so to be consistent with that the repr ofastropyunits should also use'. The reason why"is currently used is a change in bd684a0. From what I can tell the change was arbitrary and I couldn't find any discussion about it.There is no change in the repr of
Quantityand in any case APE 2 allows changing the output of__repr__()even in bugfix releases.