From f2934780883d1c3267b354f18afb94f050070eff Mon Sep 17 00:00:00 2001 From: rchan Date: Thu, 12 Oct 2023 13:36:54 +0100 Subject: [PATCH 1/3] change distribution release --- .github/workflows/cd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 5100345..1a4546f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -55,6 +55,6 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 if: github.event_name == 'release' && github.event.action == 'published' with: - # Remember to tell (test-)pypi about this repo before publishing - # Remove this line to publish to PyPI - repository-url: https://test.pypi.org/legacy/ + # Remember to generate this and set it in "GitHub Secrets" + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From 2bf515c0b4ad6137364c1435ba47c96ac85238c6 Mon Sep 17 00:00:00 2001 From: rchan Date: Thu, 12 Oct 2023 14:36:36 +0100 Subject: [PATCH 2/3] docs init --- docs/authors.rst | 6 ++++ docs/conf.py | 62 +++++++++++++++++++++++++++-------------- docs/index.md | 17 ----------- docs/index.rst | 32 +++++++++++++++++++++ docs/mahal_distance.rst | 7 +++++ docs/sig_mahal_knn.rst | 7 +++++ 6 files changed, 93 insertions(+), 38 deletions(-) create mode 100644 docs/authors.rst delete mode 100644 docs/index.md create mode 100644 docs/index.rst create mode 100644 docs/mahal_distance.rst create mode 100644 docs/sig_mahal_knn.rst diff --git a/docs/authors.rst b/docs/authors.rst new file mode 100644 index 0000000..f3cfa3f --- /dev/null +++ b/docs/authors.rst @@ -0,0 +1,6 @@ +Authors / collaborators +======================= + +``signature_mahalanobis_knn`` is a `DataSig `_ project and originally written by `Zhen Shao `_ and `Ryan Chan `_. + +For an up-to-date list of collaborators, please see the `GitHub repo `_ for this package. diff --git a/docs/conf.py b/docs/conf.py index 9951ff4..9dbce29 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,12 +1,28 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + from __future__ import annotations import importlib.metadata +# Warning: do not change the path here. To use autodoc, you need to install the +# package first. + +# -- Project information ----------------------------------------------------- + project = "signature_mahalanobis_knn" -copyright = "2023, Ryan Chan" -author = "Ryan Chan" +copyright = "2023, DataSig" +author = "DataSig" version = release = importlib.metadata.version("signature_mahalanobis_knn") +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. extensions = [ "myst_parser", "sphinx.ext.autodoc", @@ -17,29 +33,33 @@ "sphinx_copybutton", ] +# Add any paths that contain templates here, relative to this directory. +templates_path = [] + +# Include both markdown and rst files source_suffix = [".rst", ".md"] -exclude_patterns = [ - "_build", - "**.ipynb_checkpoints", - "Thumbs.db", - ".DS_Store", - ".env", - ".venv", -] +# 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 = ["_build", "**.ipynb_checkpoints", "Thumbs.db", ".DS_Store", ".env"] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# html_theme = "furo" -myst_enable_extensions = [ - "colon_fence", -] +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path: list[str] = [] -intersphinx_mapping = { - "python": ("https://docs.python.org/3", None), -} -nitpick_ignore = [ - ("py:class", "_io.StringIO"), - ("py:class", "_io.BytesIO"), +# -- Extension configuration ------------------------------------------------- +myst_enable_extensions = [ + "colon_fence", + "deflist", ] - -always_document_param_types = True diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 0fab686..0000000 --- a/docs/index.md +++ /dev/null @@ -1,17 +0,0 @@ -# signature_mahalanobis_knn - -```{toctree} -:maxdepth: 2 -:hidden: - -``` - -```{include} ../README.md -:start-after: -``` - -## Indices and tables - -- {ref}`genindex` -- {ref}`modindex` -- {ref}`search` diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..84f6888 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,32 @@ + +The ``signature_mahalanobis_knn`` Python package +================================================ + +``signature_mahalanobis_knn`` +----------------------------- + +.. toctree:: + :maxdepth: 2 + :titlesonly: + :caption: API + :glob: + + mahal_distance.rst + sig_mahal_knn.rst + +.. toctree:: + :maxdepth: 2 + :titlesonly: + :caption: About + :glob: + + authors.rst + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/mahal_distance.rst b/docs/mahal_distance.rst new file mode 100644 index 0000000..3ba8b80 --- /dev/null +++ b/docs/mahal_distance.rst @@ -0,0 +1,7 @@ +Mahalanobis distance +==================== + +.. automodule:: signature_mahalanobis_knn.Mahalanobis + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/sig_mahal_knn.rst b/docs/sig_mahal_knn.rst new file mode 100644 index 0000000..927f3d7 --- /dev/null +++ b/docs/sig_mahal_knn.rst @@ -0,0 +1,7 @@ +Signature Mahalanobis KNN method for anomaly detection +====================================================== + +.. automodule:: signature_mahalanobis_knn.SignatureMahalanobisKNN + :members: + :undoc-members: + :show-inheritance: From 53a1a5eef18baf625ecff6a22d5913d8bf048c3e Mon Sep 17 00:00:00 2001 From: rchan Date: Thu, 12 Oct 2023 14:42:31 +0100 Subject: [PATCH 3/3] make sktime dependency rather than point to github --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 83e3575..d1a9386 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,8 @@ classifiers = [ ] dynamic = ["version"] dependencies = [ - "sktime@git+https://github.com/sz85512678/sktime", + # "sktime@git+https://github.com/sz85512678/sktime", + "sktime", "numpy", "scikit-learn", "numba",