From af3671bb7c2201170fc869a602d0de006f2e2cba Mon Sep 17 00:00:00 2001 From: Stefan Heid Date: Tue, 8 Aug 2023 14:30:57 +0200 Subject: [PATCH] documentation partially done --- .gitignore | 3 ++- {doc => docs}/Makefile | 0 docs/_static/.gitkeep | 0 docs/_templates/.gitkeep | 0 docs/api.rst | 12 ++++++++++++ {doc => docs}/conf.py | 16 +++++++++------- {doc => docs}/index.rst | 4 ++-- {doc => docs}/make.bat | 0 pyproject.toml | 11 ++++++++--- skpsl/probabilistic_scoring_list.py | 3 ++- 10 files changed, 35 insertions(+), 14 deletions(-) rename {doc => docs}/Makefile (100%) create mode 100644 docs/_static/.gitkeep create mode 100644 docs/_templates/.gitkeep create mode 100644 docs/api.rst rename {doc => docs}/conf.py (66%) rename {doc => docs}/index.rst (88%) rename {doc => docs}/make.bat (100%) diff --git a/.gitignore b/.gitignore index 4f06f1c..6a27c39 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.idea /dist -poetry.lock \ No newline at end of file +poetry.lock +/docs/_build/ diff --git a/doc/Makefile b/docs/Makefile similarity index 100% rename from doc/Makefile rename to docs/Makefile diff --git a/docs/_static/.gitkeep b/docs/_static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/_templates/.gitkeep b/docs/_templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/api.rst b/docs/api.rst new file mode 100644 index 0000000..cc43d01 --- /dev/null +++ b/docs/api.rst @@ -0,0 +1,12 @@ + + +API +=== + +.. automodule:: skpsl + :members: + :undoc-members: + +.. autoclass:: skpsl.ProbabilisticScoringList + :members: + :undoc-members: diff --git a/doc/conf.py b/docs/conf.py similarity index 66% rename from doc/conf.py rename to docs/conf.py index a6d6b8c..d44edd7 100644 --- a/doc/conf.py +++ b/docs/conf.py @@ -7,22 +7,24 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = 'Probabilistic Scoring List classifier' -copyright = '2023, Jonas Hanselle, Stefan Heid' -author = 'Jonas Hanselle, Stefan Heid' +copyright = '2023, "Stefan Heid ", "Jonas Hanselle "' +author = '"Stefan Heid ", "Jonas Hanselle "' release = '0.1.0' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration -extensions = [] +extensions = ['sphinx_rtd_theme', + 'sphinx.ext.todo', + 'sphinx.ext.viewcode', + 'sphinx.ext.autodoc'] 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 = 'sphinx_rtd_theme' -html_static_path = ['_static'] +html_theme = "sphinx_rtd_theme" +html_theme_path = ["_themes", ] +html_static_path = ['_static'] \ No newline at end of file diff --git a/doc/index.rst b/docs/index.rst similarity index 88% rename from doc/index.rst rename to docs/index.rst index a74a58f..20562d9 100644 --- a/doc/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ .. Probabilistic Scoring List classifier documentation master file, created by - sphinx-quickstart on Tue Aug 8 10:24:11 2023. + sphinx-quickstart on Tue Aug 8 13:43:26 2023. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. @@ -10,7 +10,7 @@ Welcome to Probabilistic Scoring List classifier's documentation! :maxdepth: 2 :caption: Contents: - + api.rst Indices and tables ================== diff --git a/doc/make.bat b/docs/make.bat similarity index 100% rename from doc/make.bat rename to docs/make.bat diff --git a/pyproject.toml b/pyproject.toml index 30eb89f..67888c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,13 +14,18 @@ python = ">=3.9,<3.13" scikit-learn = "^1.3.0" numpy = "^1.25.2" scipy = "^1.11.1" + sphinx = { version = "^7.1", optional = true } -sphinx_rtd_theme = { version = "^0.4.3", optional = true } +sphinx_rtd_theme = { version = "^1.2", optional = true } + +pytest = { version = "^7.4", optional = true } + [tool.poetry.extras] -docs = ["sphinx", "sphinx_rtd_theme"] +doc = ["sphinx", "sphinx_rtd_theme"] +test = ["pytest"] [build-system] requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" +build-backend = "poetry.core.masonry.api" \ No newline at end of file diff --git a/skpsl/probabilistic_scoring_list.py b/skpsl/probabilistic_scoring_list.py index 6aba723..402f11a 100644 --- a/skpsl/probabilistic_scoring_list.py +++ b/skpsl/probabilistic_scoring_list.py @@ -67,7 +67,8 @@ def _relevant_scores(self, X): class ProbabilisticScoringList(BaseEstimator, ClassifierMixin): """ - Probabilistic scoring list classifier. A probabilistic classifier that greedily creates a PSL selecting one feature at a time + Probabilistic scoring list classifier. + A probabilistic classifier that greedily creates a PSL selecting one feature at a time """ def __init__(self, score_set, entropy_threshold=-1):