diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 4c480de..85125ff 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -15,4 +15,4 @@ python: - method: pip path: . extra_requirements: - - docs + - docs \ No newline at end of file diff --git a/docs/_templates/module.rst b/docs/_templates/module.rst new file mode 100644 index 0000000..6090b5e --- /dev/null +++ b/docs/_templates/module.rst @@ -0,0 +1,5 @@ +{{ fullname }} +{{ underline }} + +.. automodule:: {{ fullname }} + :members: diff --git a/docs/api.rst b/docs/api.rst deleted file mode 100644 index 3450f76..0000000 --- a/docs/api.rst +++ /dev/null @@ -1,17 +0,0 @@ -API -==== - -.. currentmodule:: flip - -.. autosummary:: - :toctree: generated - :recursive: - - flip.covariance - flip.likelihood - flip.fitter - flip.gridding - flip.model_evaluation - flip.power_spectra - flip.utils - diff --git a/docs/conf.py b/docs/conf.py index 393c955..6682004 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -45,6 +45,8 @@ extensions = ['myst_parser', 'sphinx.ext.napoleon', 'sphinx_markdown_tables', 'sphinx.ext.autosectionlabel', 'sphinx.ext.linkcode', 'sphinx.ext.intersphinx', 'sphinx.ext.autodoc', 'sphinx.ext.autosummary'] +extensions.append('autoapi.extension') +autoapi_dirs = ['', '../flip'] napoleon_google_docstring = True myst_enable_extensions = ["dollarmath"] @@ -52,12 +54,12 @@ autosectionlabel_prefix_document = True # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +autosummary_generate = True # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] +exclude_patterns = ['_build', '_templates'] source_suffix = { '.rst': 'restructuredtext', diff --git a/flip/__init__.py b/flip/__init__.py index 5086a2f..466843f 100644 --- a/flip/__init__.py +++ b/flip/__init__.py @@ -1,4 +1,5 @@ """Init file of the flip package.""" +import os from . import covariance from . import fitter from . import gridding @@ -6,4 +7,5 @@ from . import model_evaluation from . import utils -__version__ = "1.0.0" \ No newline at end of file +__version__ = "1.0.0" +__flip_dir_path__ = os.path.dirname(__file__) diff --git a/setup.cfg b/setup.cfg index 1f2de68..5955d31 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,3 +33,4 @@ docs = sphinx-design sphinx-inline-tabs sphinx-tabs + sphinx-autoapi