Skip to content

Clean up private/public API#591

Merged
astrofrog merged 5 commits intoastropy:mainfrom
astrofrog:cleanup-api
Mar 27, 2026
Merged

Clean up private/public API#591
astrofrog merged 5 commits intoastropy:mainfrom
astrofrog:cleanup-api

Conversation

@astrofrog
Copy link
Copy Markdown
Member

This PR moves many of the submodules which should be private to include leading underscores, and adds backward compatibility imports with deprecation warnings.

GitHub is not doing a good job at showing the changes - things are much clearer if you look at each individual commit.

@Cadair @svank - could you check what you think about this and whether this impacts any of the code/packages you have already?

Rename array_utils, common, wcs_utils at the top level, and all
public subpackage modules (core, high_level, utils, etc.) to have
underscore prefixes, making them private implementation details.
Add deprecation shim files at the old module paths that emit
AstropyDeprecationWarning when imported, then re-export from
the private modules. Update all internal imports (within the
package and tests) to use the private module names directly.
@astrofrog astrofrog requested review from Cadair and svank March 24, 2026 12:22
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 87.95944% with 190 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.49%. Comparing base (64ffcea) to head (7d5a0d9).
⚠️ Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
reproject/hips/_high_level.py 86.68% 41 Missing ⚠️
reproject/mosaicking/_coadd.py 79.78% 38 Missing ⚠️
reproject/_common.py 92.54% 12 Missing ⚠️
reproject/_array_utils.py 93.12% 9 Missing ⚠️
reproject/hips/_utils.py 96.79% 5 Missing ⚠️
reproject/_wcs_utils.py 89.74% 4 Missing ⚠️
reproject/adaptive/core.py 0.00% 4 Missing ⚠️
reproject/adaptive/high_level.py 0.00% 4 Missing ⚠️
reproject/array_utils.py 0.00% 4 Missing ⚠️
reproject/common.py 0.00% 4 Missing ⚠️
... and 20 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #591      +/-   ##
==========================================
- Coverage   91.06%   87.49%   -3.58%     
==========================================
  Files          30       49      +19     
  Lines        1858     1935      +77     
==========================================
+ Hits         1692     1693       +1     
- Misses        166      242      +76     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@astrofrog astrofrog marked this pull request as ready for review March 26, 2026 15:08
Copy link
Copy Markdown
Contributor

@svank svank left a comment

Choose a reason for hiding this comment

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

No objection here!

@astrofrog astrofrog merged commit c3c56d8 into astropy:main Mar 27, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants