diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b6c9f9efbd86a89f53ce126b255d84009125cf69..70d6d617816e22cef31151e13c5768c229c821cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,3 +31,27 @@ publish_package: - docker only: - tags + +build_doc: + stage: build + script: + - pip install .[doc] + - make -C doc html + artifacts: + untracked: true + expire_in: 1 week + tags: + - docker + +pages: + stage: publish + script: + - rm -rf public/ + - cp -r doc/build/html public/ + artifacts: + paths: + - public + tags: + - docker + only: + - tags diff --git a/README.md b/README.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2b250c2e3bafac9831462b77eb3801bc88ff2c51 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,22 @@ +# Install + +```bash +pip install prob-dim-red --index-url https://forgemia.inra.fr/api/v4/projects/10272/packages/pypi/simple +``` + +# Contribute + +- clone the repo + ```bash + git clone THIS_REPO + ``` + +- local dev install + ```bash + pip install .[dev] + ``` + +- install pre-commit + ```bash + pre-commit install + ``` diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d0c3cbf1020d5c292abdedf27627c6abe25e2293 --- /dev/null +++ b/doc/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 = source +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/doc/source/_static/.keep b/doc/source/_static/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/doc/source/_templates/.keep b/doc/source/_templates/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/doc/source/cli.rst b/doc/source/cli.rst new file mode 100644 index 0000000000000000000000000000000000000000..fb360a654dd797205baf63c24ec5549c5c6bfd5e --- /dev/null +++ b/doc/source/cli.rst @@ -0,0 +1,7 @@ +Command line program +==================== + +.. argparse:: + :ref: prob_dim_red._cli._parser + :prog: prob_dim_red + :nodefault: diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..f1f2ab3264e6a115863c559fd5115d6ba8c52484 --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,32 @@ +# pylint: skip-file +# 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 + +from importlib.metadata import version + +project = "prob_dim_red" +copyright = "2024, INRAE, François Victor, Julien Chiquet; UTC, Jean-Benoist Leger" +author = "François Victor" + +release = version(project) +version = release + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ["sphinx.ext.napoleon", "sphinx_rtd_theme", "sphinxarg.ext"] + +templates_path = ["_templates"] +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "sphinx_rtd_theme" +html_static_path = ["_static"] diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..7e77edc599cd5bbe3d6b2be5631e13318919fa0e --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,21 @@ +.. prob_dim_red documentation master file, created by + sphinx-quickstart on Wed Feb 14 15:10:08 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to prob_dim_red's documentation! +======================================== + +.. toctree:: + :maxdepth: 1 + :caption: Contents: + + ./linear_gaussian_ppca.rst + ./cli.rst + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/source/linear_gaussian_ppca.rst b/doc/source/linear_gaussian_ppca.rst new file mode 100644 index 0000000000000000000000000000000000000000..44947b47ba00cf7f54907e149f87157da6cbbabb --- /dev/null +++ b/doc/source/linear_gaussian_ppca.rst @@ -0,0 +1,10 @@ +Linear Gaussian pPCA documentation +================================== + +.. automodule:: prob_dim_red.linear_gaussian_ppca + :members: + :imported-members: + :inherited-members: + :special-members: __init__ + :undoc-members: + :show-inheritance: diff --git a/pyproject.toml b/pyproject.toml index 89e23cb9806b8ab6af5f390daffa4e1685f96079..d12ad9dc89de24d26a36ee3a174e0d4281a10cd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,10 @@ classifiers = [ ] dependencies = ["numpy", "scipy", "matplotlib"] +[project.optional-dependencies] +dev = ["build",] +doc = ["sphinx", "sphinx_rtd_theme", "sphinx-argparse",] + [project.scripts] prob_dim_red = "prob_dim_red._cli:main"