Skip to content
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

Consolidate angle modules #15220

Merged
merged 12 commits into from Sep 22, 2023
Merged

Consolidate angle modules #15220

merged 12 commits into from Sep 22, 2023

Conversation

nstarman
Copy link
Member

@nstarman nstarman commented Aug 23, 2023

A new sub-module of coordinates that is a consolidation of all the various angle stuff.
IMO this should be a public module, but I could go either way! Everything can just be imported up to astropy/coordinates.

Use Squash and Merge!

  • 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
Copy link

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?
  • Is a milestone set? Milestone must be set but we cannot check for it on Actions; do not let the green checkmark fool you.
  • 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.

@github-actions
Copy link

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@nstarman
Copy link
Member Author

The angle_utilities should probably have a deprecation period...

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes a lot of sense to consolidate this. Just a few comments, of my typical don't-change-more-than-strictly-needed-for-renaming type.

astropy/coordinates/angles/angle_lextab.py Show resolved Hide resolved
astropy/coordinates/angles/core.py Outdated Show resolved Hide resolved
astropy/coordinates/angles/errors.py Show resolved Hide resolved
astropy/coordinates/angles/utils.py Outdated Show resolved Hide resolved
docs/coordinates/performance.inc.rst Show resolved Hide resolved
astropy/coordinates/angles/core.py Outdated Show resolved Hide resolved
astropy/coordinates/angles/utils.py Outdated Show resolved Hide resolved
@pllim
Copy link
Member

pllim commented Aug 23, 2023

This should wait. I am trying to remove some deprecated stuff in another PR. There will be conflicts.

@nstarman
Copy link
Member Author

Hmm. Regenerating lex and parse tab broke many things.

@nstarman nstarman force-pushed the coords-angles branch 2 times, most recently from 20ea40b to 1d3ac1c Compare September 1, 2023 17:40
@nstarman
Copy link
Member Author

nstarman commented Sep 2, 2023

@pllim @mhvk @eerovaher, I'm having trouble tracking which angles reference in RTD is making it fail. Additional eyes appreciated!

@eerovaher
Copy link
Member

RTD log contains the line <unknown>:80: WARNING: py:obj reference target not found: angles, so we should grep for `angles`.
main:

$ git grep '`angles`'
astropy/modeling/rotations.py:        axis of rotation and matching the order in ``angles``.
docs/coordinates/formatting.rst::meth:`~astropy.coordinates.Angle.to_string` method (see :doc:`angles` for

This pull request:

$ git grep '`angles`'
astropy/modeling/rotations.py:        axis of rotation and matching the order in ``angles``.
docs/changes/coordinates/15220.api.rst:Angle-related classes and functions have been consolidated into the module `angles`.
docs/coordinates/formatting.rst::meth:`~astropy.coordinates.Angle.to_string` method (see :doc:`angles` for

It looks like the change log entry is causing the problem.

@nstarman
Copy link
Member Author

nstarman commented Sep 4, 2023

It looks like the change log entry is causing the problem.

But how? I use double backticks so it shouldn't be linking.
Shoot. I didn't push that! I have that in my local, but not pushed to origin and then I was tearing my hair out looking at the RTD log. Thanks @eerovaher.

@nstarman
Copy link
Member Author

nstarman commented Sep 5, 2023

Failures are unrelated.

@nstarman nstarman marked this pull request as ready for review September 5, 2023 14:11
@larrybradley larrybradley removed their request for review September 5, 2023 14:27
@nstarman nstarman added this to the v6.0 milestone Sep 5, 2023
Copy link
Member

@eerovaher eerovaher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have enough code dealing with angles that creating a separate directory is a good idea, but I have a few questions and remarks about some details.

astropy/coordinates/angles/angle_parsetab.py Show resolved Hide resolved
astropy/coordinates/angles/formats.py Outdated Show resolved Hide resolved
astropy/coordinates/tests/accuracy/test_fk4_no_e_fk4.py Outdated Show resolved Hide resolved
astropy/table/serialize.py Show resolved Hide resolved
docs/coordinates/performance.inc.rst Outdated Show resolved Hide resolved
Comment on lines 1 to 4

Angle-related classes and functions have been consolidated into the module ``angles``.
In particular, ``angle_utilties`` have been moved to ``angles.util``,
and select errors have been moved to ``angles.errors``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the users are supposed to import everything from astropy.coordinates then I don't see why we would even want to mention angles, let alone angles.utils or angles.errors. We should just state that there has been some refactoring that might break some imports from some modules within astropy.coordinates, but everything that could be imported from astropy.coordinates itself still can be, and what cannot be imported from astropy.coordinates is and has been considered private.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, you're leaning towards "private" module (from opening comment). Happy to do that as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed with @eerovaher - let's stick with the current astropy scheme where users are supposed to import only from submodules, not below. Arguably, this is just a refactoring that does not even need a changelog entry. But I do think it is a good idea to have one anyway, if we phrase it along the lines @eerovaher suggested. It is also fine to be friendly and note that if people use stuff that is not exposed on top, they should feel welcome to submit a feature request to make it public -- since then obviously it is useful!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; agree with @eerovaher (and you) to import from astropy.coordinates wherever it is possible to do so. Otherwise, just nits.

astropy/coordinates/angles/utils.py Outdated Show resolved Hide resolved
astropy/table/serialize.py Show resolved Hide resolved
astropy/visualization/wcsaxes/grid_paths.py Outdated Show resolved Hide resolved
@pllim pllim reopened this Sep 11, 2023
@pllim

This comment was marked as resolved.

@nstarman
Copy link
Member Author

Resolved! It just required a rebase.

@pllim
Copy link
Member

pllim commented Sep 11, 2023

Linkcheck failure unrelated.

@eerovaher
Copy link
Member

It looks like the only reason this can't be merged is that there are merge conflicts.

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>

TST RTD

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
@pep8speaks

This comment was marked as off-topic.

@nstarman
Copy link
Member Author

@eerovaher, rebased!

@eerovaher eerovaher merged commit d56526b into astropy:main Sep 22, 2023
51 of 55 checks passed
@nstarman nstarman deleted the coords-angles branch September 22, 2023 16:49
braingram added a commit to braingram/asdf-astropy that referenced this pull request Sep 26, 2023
braingram added a commit to braingram/asdf-astropy that referenced this pull request Sep 26, 2023
braingram added a commit to braingram/asdf-astropy that referenced this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build all wheels Run all the wheel builds rather than just a selection coordinates Extra CI Run cron CI as part of PR visualization.wcsaxes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants