Repository navigation
Meta folder - #15166
Meta folder#15166
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 |
mhvk
left a comment
There was a problem hiding this comment.
It may indeed be time to make a new submodule, but I think a renaming exercise should really not do anything other than rename, i.e., not make MetaAttribute a dataclass, nor add any typing information.
It would also be good to have a more general discussion about whether we want to indicate things below the top level are private by prepending _ to file names. I know other projects are doing it, but we have a pretty clear system in place and with changes like here and in cosmology we're going to be in a mixed and hence unclear state for quite a while (a state where the sub-packages that do not rename will be the ones with increased risk of user mistakes). I feel quite strongly this change should not be made piece-wise so raised a separate issue about this -- see #15169. I think it would be best not to merge this as is until there has been some decision.
|
I'm fine to break up this PR into 2: one for re-org and another for improvements. Re the file names, any suggestion? |
|
Yes, I think it should be broken up; for the filenames, I think we should follow precedent and not use underscores. They can be added later if APE 22 is accepted. |
|
SGTM. @mhvk, done. |
1a3db7c to
e0e8170
Compare
|
Ok. #15237 is merged. This is ready! |
e0e8170 to
ab21e07
Compare
|
If there is some change, then need a change log. Thanks! |
Signed-off-by: nstarman <[email protected]>
ab21e07 to
541564b
Compare
|
Changelog added! |
|
Ping @mhvk. Hopefully an easy review now! |
mhvk
left a comment
There was a problem hiding this comment.
We could avoid changes to imports from test_meta (and thus the need for possible similar changes outside astropy) if we kept the test files in the same location. Unlike for astropy.coordinates.angles, I don't have a strong opinion on what is better. utils.iers and utils.masked have their tests inside and this is logical; that suggests to do what you have done for utils.metadata. On the other hand, for ies and (to a less extend) for masked there is a case that they don't belong in utils but should be on their own, while metadata is exactly in the right place. And clearly there are imports from the tests... Then again, utils.xml does have its own tests (though that has C code). Overall, what you have is probably best, but thought I would bring it up anyway.
Otherwise, my only remaining comment is about __all__ in lower-level files. Let's stick to current precedent for those, for now at least, i.e., fill them with those items that should be imported in __init__.py.
Signed-off-by: nstarman <[email protected]>
Signed-off-by: nstarman <[email protected]>
There's a lot of different ideas happening in
astropy/utils/metadata.py: new exceptions and warnings, metadata merging mechanics, a metadata attribute, and attributes stored in metadata. This PR separates these concerns into different files, collecting them in a new module --astropy/utils/metadata.There is no change in public API.There is change in semi-public API.
Plz squash & merge