From aa52f784300ec9cbe0c628cc53eddeb1ca092480 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Wed, 5 Nov 2025 09:49:55 +0000 Subject: [PATCH 1/5] Try using sphinx-autoapi instead of sphinx-automodapi --- docs/conf.py | 6 ++++++ docs/index.rst | 12 ------------ reproject/hips/__init__.py | 2 ++ reproject/mosaicking/__init__.py | 2 ++ 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index e673683ed..79f8ab2f1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,6 +10,12 @@ print("ERROR: the documentation requires the sphinx-astropy package to be installed") sys.exit(1) +extensions.append('sphinx.ext.autodoc') +extensions.append('autoapi.extension') + +autoapi_dirs = ['../reproject'] +autoapi_options = ['members', 'imported-members', 'inherited-members', 'show-inheritance'] + # -- General configuration ---------------------------------------------------- # By default, highlight as Python 3. diff --git a/docs/index.rst b/docs/index.rst index 0ddf73e2f..e84d37e17 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -156,15 +156,3 @@ that you want to reproject. mosaicking performance performance_mosaicking - -Reference/API -============= - -.. automodapi:: reproject - :no-inheritance-diagram: - -.. automodapi:: reproject.hips - :no-inheritance-diagram: - -.. automodapi:: reproject.mosaicking - :no-inheritance-diagram: diff --git a/reproject/hips/__init__.py b/reproject/hips/__init__.py index ab029c63e..472a2005b 100644 --- a/reproject/hips/__init__.py +++ b/reproject/hips/__init__.py @@ -1,2 +1,4 @@ from .high_level import * # noqa from ._dask_array import hips_as_dask_array # noqa + +__all__ = ["reproject_from_hips", "reproject_to_hips", "coadd_hips", "hips_as_dask_array"] diff --git a/reproject/mosaicking/__init__.py b/reproject/mosaicking/__init__.py index 791df9b9f..695f15aca 100644 --- a/reproject/mosaicking/__init__.py +++ b/reproject/mosaicking/__init__.py @@ -1,2 +1,4 @@ from .coadd import * # noqa from .wcs_helpers import * # noqa + +__all__ = ["reproject_and_coadd", "find_optimal_celestial_wcs"] From e44ce4caa5351aa1ba213a91b8db562db46f68b5 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Wed, 5 Nov 2025 09:51:27 +0000 Subject: [PATCH 2/5] Add sphinx-autoapi to dependencies --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index a518c274b..bca83dab0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,7 @@ testall = [ ] docs = [ "sphinx-astropy", + "sphinx-autoapi", "pyvo", "matplotlib", "tqdm", From 6a8a6be208a58bbff5db14f90c4924bd33959bc7 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Wed, 5 Nov 2025 09:54:28 +0000 Subject: [PATCH 3/5] Fix pre-commit --- docs/conf.py | 8 ++++---- reproject/hips/__init__.py | 8 ++++++-- reproject/mosaicking/__init__.py | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 79f8ab2f1..c2e57828d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,11 +10,11 @@ print("ERROR: the documentation requires the sphinx-astropy package to be installed") sys.exit(1) -extensions.append('sphinx.ext.autodoc') -extensions.append('autoapi.extension') +extensions.append("sphinx.ext.autodoc") +extensions.append("autoapi.extension") -autoapi_dirs = ['../reproject'] -autoapi_options = ['members', 'imported-members', 'inherited-members', 'show-inheritance'] +autoapi_dirs = ["../reproject"] +autoapi_options = ["members", "imported-members", "inherited-members", "show-inheritance"] # -- General configuration ---------------------------------------------------- diff --git a/reproject/hips/__init__.py b/reproject/hips/__init__.py index 472a2005b..8d8c71859 100644 --- a/reproject/hips/__init__.py +++ b/reproject/hips/__init__.py @@ -1,4 +1,8 @@ -from .high_level import * # noqa -from ._dask_array import hips_as_dask_array # noqa +from ._dask_array import hips_as_dask_array +from .high_level import ( + coadd_hips, + reproject_from_hips, + reproject_to_hips, +) __all__ = ["reproject_from_hips", "reproject_to_hips", "coadd_hips", "hips_as_dask_array"] diff --git a/reproject/mosaicking/__init__.py b/reproject/mosaicking/__init__.py index 695f15aca..51cbbefcd 100644 --- a/reproject/mosaicking/__init__.py +++ b/reproject/mosaicking/__init__.py @@ -1,4 +1,4 @@ -from .coadd import * # noqa -from .wcs_helpers import * # noqa +from .coadd import reproject_and_coadd +from .wcs_helpers import find_optimal_celestial_wcs __all__ = ["reproject_and_coadd", "find_optimal_celestial_wcs"] From 783f45e94667b424f38803ac89d5f1840c10750f Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Wed, 5 Nov 2025 12:28:56 +0000 Subject: [PATCH 4/5] Fix configuration --- .gitignore | 1 + docs/conf.py | 4 +++- reproject/__init__.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 21fe7e3ae..3970500b8 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ MANIFEST # Sphinx docs/api +docs/autoapi docs/_build # Eclipse editor project files diff --git a/docs/conf.py b/docs/conf.py index c2e57828d..c6a32ae2e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,7 +14,9 @@ extensions.append("autoapi.extension") autoapi_dirs = ["../reproject"] -autoapi_options = ["members", "imported-members", "inherited-members", "show-inheritance"] +autoapi_options = ["members", "imported-members", "inherited-members", "show-inheritance", "undoc-members"] +autoapi_own_page_level = 'function' +autoapi_ignore = ["**/tests/**", "**/tests/", "**/conftest.py"] # -- General configuration ---------------------------------------------------- diff --git a/reproject/__init__.py b/reproject/__init__.py index 85e446232..1c3e8cc66 100644 --- a/reproject/__init__.py +++ b/reproject/__init__.py @@ -7,3 +7,6 @@ from .interpolation import reproject_interp # noqa from .spherical_intersect import reproject_exact # noqa from .version import __version__ # noqa + +from . import mosaicking +from . import hips From e26e47b010819f34a798bfe8622bdf0fe8713369 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Wed, 5 Nov 2025 13:20:55 +0000 Subject: [PATCH 5/5] Tidied up changes --- docs/Makefile | 1 + docs/conf.py | 14 +++++++++++--- reproject/__init__.py | 3 --- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index fb03f26e6..7519b4893 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -38,6 +38,7 @@ help: clean: -rm -rf $(BUILDDIR) -rm -rf api + -rm -r autoapi -rm -rf generated html: diff --git a/docs/conf.py b/docs/conf.py index c6a32ae2e..90074e107 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,9 +14,17 @@ extensions.append("autoapi.extension") autoapi_dirs = ["../reproject"] -autoapi_options = ["members", "imported-members", "inherited-members", "show-inheritance", "undoc-members"] -autoapi_own_page_level = 'function' -autoapi_ignore = ["**/tests/**", "**/tests/", "**/conftest.py"] +autoapi_options = [ + "members", + "imported-members", + "inherited-members", + "show-inheritance", + "undoc-members", +] +autoapi_own_page_level = "function" +autoapi_ignore = ["**/tests/**", "**/tests/", "**/conftest.py", "**/version.py"] + +suppress_warnings.append("autoapi.python_import_resolution") # -- General configuration ---------------------------------------------------- diff --git a/reproject/__init__.py b/reproject/__init__.py index 1c3e8cc66..85e446232 100644 --- a/reproject/__init__.py +++ b/reproject/__init__.py @@ -7,6 +7,3 @@ from .interpolation import reproject_interp # noqa from .spherical_intersect import reproject_exact # noqa from .version import __version__ # noqa - -from . import mosaicking -from . import hips