diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..f3a82530 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,21 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: latest + rust: latest + apt_packages: + - cmake + - libceres-dev + - libfftw3-dev + - libgsl-dev + +sphinx: + configuration: docs/conf.py + +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: light-curve 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 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