From f461cf664dfe573464a617ef2300965e0bcfd587 Mon Sep 17 00:00:00 2001 From: Konstantin Malanchev Date: Wed, 31 May 2023 09:46:10 -0500 Subject: [PATCH 1/5] Initial Sphinx docs --- docs/Makefile | 20 ++ docs/conf.py | 58 +++++ docs/index.rst | 21 ++ docs/light_curve.light_curve_py.features.rst | 250 +++++++++++++++++++ docs/light_curve.light_curve_py.rst | 26 ++ docs/light_curve.rst | 34 +++ docs/make.bat | 35 +++ docs/modules.rst | 7 + 8 files changed, 451 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/light_curve.light_curve_py.features.rst create mode 100644 docs/light_curve.light_curve_py.rst create mode 100644 docs/light_curve.rst create mode 100644 docs/make.bat create mode 100644 docs/modules.rst diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d4bb2cbb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..3c4d5432 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,58 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "light-curve" +copyright = "2023, Konstantin Malanchev, Anastasia Lavrukhina" +author = "Konstantin Malanchev, Anastasia Lavrukhina" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.napoleon", + "sphinx.ext.viewcode", + "sphinxcontrib.katex", +] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "alabaster" +html_static_path = ["_static"] + + +# KaTeX +katex_inline = ["$", "$"] +katex_display = ["$$", "$$"] + + +# Convert docstrings from Markdown to reStructuredText +def docstring(app, what, name, obj, options, lines): + # import re + + import m2r2 + + md = "\n".join(lines) + + # Replace '$$' with '```math ... ```' + # md = re.sub(r'\$\$(.*?)\$\$', r'```math\n\1\n```', md) + + rst = m2r2.convert(md) + + lines.clear() + lines.extend(rst.splitlines()) + + +def setup(app): + app.connect("autodoc-process-docstring", docstring) diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..303abcbc --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,21 @@ +.. light-curve documentation master file, created by + sphinx-quickstart on Tue May 30 16:32:24 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to light-curve's documentation! +======================================= + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + modules.rst + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/light_curve.light_curve_py.features.rst b/docs/light_curve.light_curve_py.features.rst new file mode 100644 index 00000000..2af43f16 --- /dev/null +++ b/docs/light_curve.light_curve_py.features.rst @@ -0,0 +1,250 @@ +light\_curve.light\_curve\_py.features package +============================================== + +.. automodule:: light_curve.light_curve_py.features + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +light\_curve.light\_curve\_py.features.adnormal module +------------------------------------------------------ + +.. automodule:: light_curve.light_curve_py.features.adnormal + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.amplitude module +------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.amplitude + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.beyondnstd module +-------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.beyondnstd + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.bins module +-------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.bins + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.cusum module +--------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.cusum + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.eta module +------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.eta + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.etae module +-------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.etae + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.excvar module +---------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.excvar + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.extractor module +------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.extractor + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.flux\_n\_not\_det\_before\_fd module +--------------------------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.flux_n_not_det_before_fd + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.intpercrange module +---------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.intpercrange + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.kurtosis module +------------------------------------------------------ + +.. automodule:: light_curve.light_curve_py.features.kurtosis + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.linfit module +---------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.linfit + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.lintrend module +------------------------------------------------------ + +.. automodule:: light_curve.light_curve_py.features.lintrend + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.magnitude\_n\_not\_det\_before\_fd module +-------------------------------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.magnitude_n_not_det_before_fd + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.magnpratio module +-------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.magnpratio + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.maxslope module +------------------------------------------------------ + +.. automodule:: light_curve.light_curve_py.features.maxslope + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.mean module +-------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.mean + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.meanvar module +----------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.meanvar + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.medabsdev module +------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.medabsdev + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.medbufrperc module +--------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.medbufrperc + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.median module +---------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.median + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.otsusplit module +------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.otsusplit + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.pdiffmperc module +-------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.pdiffmperc + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.percampl module +------------------------------------------------------ + +.. automodule:: light_curve.light_curve_py.features.percampl + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.redchi2 module +----------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.redchi2 + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.skew module +-------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.skew + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.stdev module +--------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.stdev + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.stetsonk module +------------------------------------------------------ + +.. automodule:: light_curve.light_curve_py.features.stetsonk + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_py.features.weightmean module +-------------------------------------------------------- + +.. automodule:: light_curve.light_curve_py.features.weightmean + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/light_curve.light_curve_py.rst b/docs/light_curve.light_curve_py.rst new file mode 100644 index 00000000..98c6bba4 --- /dev/null +++ b/docs/light_curve.light_curve_py.rst @@ -0,0 +1,26 @@ +light\_curve.light\_curve\_py package +===================================== + +.. automodule:: light_curve.light_curve_py + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + light_curve.light_curve_py.features + +Submodules +---------- + +light\_curve.light\_curve\_py.warnings module +--------------------------------------------- + +.. automodule:: light_curve.light_curve_py.warnings + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/light_curve.rst b/docs/light_curve.rst new file mode 100644 index 00000000..f790beb4 --- /dev/null +++ b/docs/light_curve.rst @@ -0,0 +1,34 @@ +light\_curve package +==================== + +.. automodule:: light_curve + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + light_curve.light_curve_py + +Submodules +---------- + +light\_curve.light\_curve module +-------------------------------- + +.. automodule:: light_curve.light_curve + :members: + :undoc-members: + :show-inheritance: + +light\_curve.light\_curve\_ext module +------------------------------------- + +.. automodule:: light_curve.light_curve_ext + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..32bb2452 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/modules.rst b/docs/modules.rst new file mode 100644 index 00000000..e200bf2b --- /dev/null +++ b/docs/modules.rst @@ -0,0 +1,7 @@ +API documentation +================= + +.. toctree:: + :maxdepth: 4 + + light_curve From 402c5770cc599a639198c1861163365221ceb446 Mon Sep 17 00:00:00 2001 From: Konstantin Malanchev Date: Wed, 31 May 2023 09:46:32 -0500 Subject: [PATCH 2/5] Add .readthedocs.yaml --- .readthedocs.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..12dbb89a --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,6 @@ +version: 2 + +python: + install: + - method: pip + path: light-curve From 602b5a698bebcb1ef4eee5d3eb5d137315ba2d1e Mon Sep 17 00:00:00 2001 From: Konstantin Malanchev Date: Mon, 30 Sep 2024 15:07:20 -0400 Subject: [PATCH 3/5] Add docs/requirements.txt --- .readthedocs.yaml | 10 ++++++++++ docs/requirements.txt | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 docs/requirements.txt diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 12dbb89a..1d23b356 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,6 +1,16 @@ version: 2 +build: + os: ubuntu-lts-latest + tools: + python: latest + rust: latest + +sphinx: + configuration: docs/conf.py + python: install: + - requirements: docs/requirements.txt - method: pip path: light-curve diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..95bf25ca --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +m2r2 +setuptools +sphinxcontrib-katex From 5f23748fe4ebe2e3ed83e2c3c50d69b70ad0291b Mon Sep 17 00:00:00 2001 From: Konstantin Malanchev Date: Tue, 1 Oct 2024 09:39:30 -0400 Subject: [PATCH 4/5] RTD: apt install packages --- .readthedocs.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1d23b356..6a3c0a9d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,10 +1,14 @@ version: 2 build: - os: ubuntu-lts-latest + os: ubuntu-22.04 tools: python: latest rust: latest + apt_packages: + - libceres-dev + - libfftw3-dev + - libgsl-dev sphinx: configuration: docs/conf.py From a10a114721a0ade057e23ff703ea3fffff6e5fbc Mon Sep 17 00:00:00 2001 From: Konstantin Malanchev Date: Tue, 1 Oct 2024 09:44:28 -0400 Subject: [PATCH 5/5] FIX: add cmake --- .readthedocs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 6a3c0a9d..f3a82530 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,6 +6,7 @@ build: python: latest rust: latest apt_packages: + - cmake - libceres-dev - libfftw3-dev - libgsl-dev