From 0862f6f64cff439e5a7e126ce40e27c1cfa5fb29 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Mon, 14 Aug 2023 09:04:38 -0500 Subject: [PATCH 01/29] Fix guide typos, acknowledgements in guide --- README.md | 4 ++-- docs/source/guide.rst | 30 ++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index af57abe..e142698 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ samples, labels = my_clustering_alg(some_data) > **NOTE**: > > The `cvi` package assumes the Numpy **row-major** convention where rows are individual samples and columns are features. -> A batch dataset is then `[n_samples, n_features]` large, and their corresponding labels are '[n_samples]` large. +> A batch dataset is then `[n_samples, n_features]` large, and their corresponding labels are `[n_samples]` large. You may compute the final criterion value with a batch update all at once with `CVI.get_cvi` @@ -192,7 +192,7 @@ The following CVIs have been implemented as of the latest version of `cvi`: ### Derivation -The incremental and batch CVI implementations in this package are largely derived from the following Julia language implementations: +The incremental and batch CVI implementations in this package are largely derived from the following Julia language implementations by the same authors of this package: - [ClusterValidityIndices.jl](https://github.com/AP6YC/ClusterValidityIndices.jl) diff --git a/docs/source/guide.rst b/docs/source/guide.rst index de3da73..3f6a36c 100644 --- a/docs/source/guide.rst +++ b/docs/source/guide.rst @@ -82,7 +82,7 @@ A batch of data is assumed to be a numpy array of samples and a numpy vector of .. note:: The `cvi` package assumes the Numpy **row-major** convention where rows are individual samples and columns are features. - A batch dataset is then `[n_samples, n_features]` large, and their corresponding labels are '[n_samples]` large. + A batch dataset is then `[n_samples, n_features]` large, and their corresponding labels are `[n_samples]` large. You may compute the final criterion value with a batch update all at once with `CVI.get_cvi` @@ -107,7 +107,7 @@ The incremental methods are used automatically based upon the dimensions of the criterion_values[ix] = my_cvi.get_cvi(sample, label) .. note:: - Currently only using _either_ batch _or_ incremental methods is supported; switching from batch to incremental updates with the same is not yet implemented. + Currently only using *either* batch *or* incremental methods is supported; switching from batch to incremental updates with the same is not yet implemented. Implemented CVIs ---------------- @@ -123,3 +123,29 @@ The following CVIs have been implemented as of the latest version of `cvi`: * **rCIP**: (Renyi's) representative Cross Information Potential. * **WB**: WB-index. * **XB**: Xie-Beni. + +Acknowledgements +---------------- + +Derivation +^^^^^^^^^^ + +The incremental and batch CVI implementations in this package are largely derived from the following Julia language implementations by the same authors of this package: + +* `ClusterValidityIndices.jl `_ + +Authors +^^^^^^^ + +The principal authors of the `cvi` pacakge are: + +* Sasha Petrenko - petrenkos@mst.edu +* Nik Melton - nmmz76@mst.edu + +Related Projects +^^^^^^^^^^^^^^^^ + +If this package is missing something that you need, feel free to check out some related Python cluster validity packages: + +* `validclust `_ +* `clusterval `_ From d3b04d3f245c5b85a0af01f9b1d6b8647bae2547 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Mon, 14 Aug 2023 09:45:35 -0500 Subject: [PATCH 02/29] Add initial docs github workflow --- .github/workflows/Documentation.yml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/Documentation.yml diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 0000000..cdd156f --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,35 @@ +name: Documentation + +on: + push: + branches: + - main + - develop + tags: '*' + pull_request: + +# sphinx-build doc _build +permissions: + contents: write +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - name: Install dependencies + run: | + pip install -r docs/requirements.txt + - name: Sphinx build + run: | + cd docs + make html + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build/ + # publish_dir: _build/ + # force_orphan: true From 7e3cf3667063e14f11212ecdf6a80348bf15fdfc Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Tue, 9 Jan 2024 10:04:19 -0600 Subject: [PATCH 03/29] Remove vscode settings, comment gitignore --- .gitignore | 8 ++++++++ .vscode/settings.json | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index b5aa448..8d506e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# ----------------------------------------------------------------------------- +# PROJECT IGNORES +# ----------------------------------------------------------------------------- + # IDE ignores .vscode/ @@ -5,6 +9,10 @@ _dev/ **/_autosummary/ +# ----------------------------------------------------------------------------- +# PYTHON IGNORES +# ----------------------------------------------------------------------------- + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 491b1a1..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "python.linting.enabled": true, - "python.linting.flake8Enabled": true -} \ No newline at end of file From f50c95d9eb77d99d237eb5c0b652996875172047 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Tue, 20 Feb 2024 10:46:52 -0600 Subject: [PATCH 04/29] Begin reworking requirements files --- dev-all-requirements.txt | 8 ++++++++ dev-requirements.txt | 16 +++++++--------- docs/requirements.txt | 6 ++++-- requirements.txt | 6 +----- tests/requirements.txt | 11 +++++++++++ 5 files changed, 31 insertions(+), 16 deletions(-) create mode 100644 dev-all-requirements.txt create mode 100644 tests/requirements.txt diff --git a/dev-all-requirements.txt b/dev-all-requirements.txt new file mode 100644 index 0000000..1bf5190 --- /dev/null +++ b/dev-all-requirements.txt @@ -0,0 +1,8 @@ +# The package requirements +-r requirements.txt + +# Development tools +-r dev-requirements.txt + +# Testing requirements +-r tests/requirements.txt diff --git a/dev-requirements.txt b/dev-requirements.txt index c8ccf96..5dc1a17 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,12 +1,10 @@ -pytest -pandas -twine +# Packaging tools build -sphinx -sphinx-rtd-theme setuptools -numpy -tqdm -scikit-learn +twine + +# Added tools for development jupyterlab -flake8 + +# The package itself +-e . diff --git a/docs/requirements.txt b/docs/requirements.txt index 8aec747..1a847dc 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,5 @@ +# Documentation tools sphinx -sphinx-rtd-theme -numpy +# sphinx-rtd-theme +furo +# numpy diff --git a/requirements.txt b/requirements.txt index 8e6edd3..24ce15a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1 @@ -tqdm -scikit-learn -pandas -coverage -pytest-cov +numpy diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 0000000..38fb1c1 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,11 @@ +pytest +pytest-cov +coverage +# pytest +pandas +# twine +# numpy +# tqdm +scikit-learn +# jupyterlab +flake8 From a800739e2f289136db21ca700a393f045a52e3f3 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Wed, 21 Feb 2024 08:05:51 -0600 Subject: [PATCH 05/29] Document dev-all-requirements, clean deps --- dev-all-requirements.txt | 14 ++++++++++++++ tests/requirements.txt | 6 ++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dev-all-requirements.txt b/dev-all-requirements.txt index 1bf5190..c7d7b51 100644 --- a/dev-all-requirements.txt +++ b/dev-all-requirements.txt @@ -1,3 +1,14 @@ +# ----------------------------------------------------------------------------- +# DEV-ALL-REQUIREMENTS.TXT +# +# NOTE: this file is for only package development and is not necessary for its +# usage. +# +# This file installs all of the requirements for each component of the project +# for development, including the package requirements, useful dev tools, +# testing requirements, and tools necessary for building the documentation. +# ----------------------------------------------------------------------------- + # The package requirements -r requirements.txt @@ -6,3 +17,6 @@ # Testing requirements -r tests/requirements.txt + +# Documentation requirements +-r docs/requirements.txt diff --git a/tests/requirements.txt b/tests/requirements.txt index 38fb1c1..97689cf 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,11 +1,9 @@ pytest pytest-cov coverage -# pytest pandas -# twine +scikit-learn +flake8 # numpy # tqdm -scikit-learn # jupyterlab -flake8 From b7bde1797230aa12e14101d7ece66afbcbaf7ca6 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 22 Feb 2024 17:14:47 -0600 Subject: [PATCH 06/29] Init transition to pyproject.toml --- pyproject.toml | 148 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 146 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 864c5d7..0b2b446 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,151 @@ requires = ["setuptools>=42"] build-backend = "setuptools.build_meta" +# dynamic = ["version", "description"] + [project] name = "cvi" -authors = [{name = "Sasha Petrenko", email = "sap625@mst.edu"}] -dynamic = ["version", "description"] +authors = [ + {name = "Sasha Petrenko", email = "petrenkos@mst.edu"} +] + +# Versions should comply with PEP 440: +# https://www.python.org/dev/peps/pep-0440/ +# +# For a discussion on single-sourcing the version, see +# https://packaging.python.org/guides/single-sourcing-package-version/ +version = "0.5.1" + +# This is a one-line description or tagline of what your project does. This +# corresponds to the "Summary" metadata field: +# https://packaging.python.org/specifications/core-metadata/#summary +description = "A sample Python project" # Optional + +# This is an optional longer description of your project that represents +# the body of text which users will see when they visit PyPI. +# +# Often, this is the same as your README, so you can just read it in from +# that file directly (as we have already done above) +# +# This field corresponds to the "Description" metadata field: +# https://packaging.python.org/specifications/core-metadata/#description-optional +readme = "README.md" # Optional + +# Specify which Python versions you support. In contrast to the +# 'Programming Language' classifiers above, 'pip install' will check this +# and refuse to install the project if the version does not match. See +# https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires +requires-python = ">=3.7" + +# This is either text indicating the license for the distribution, or a file +# that contains the license +# https://packaging.python.org/en/latest/specifications/core-metadata/#license +license = {file = "LICENSE.txt"} + +# This field adds keywords for your project which will appear on the +# project page. What does your project relate to? +# +# Note that this is a list of additional keywords, separated +# by commas, to be used to assist searching for the distribution in a +# larger catalog. +keywords = ["sample", "setuptools", "development"] # Optional + +# This should be your name or the name of the organization who originally +# authored the project, and a valid email address corresponding to the name +# listed. +# authors = [ +# {name = "A. Random Developer", email = "author@example.com" } # Optional +# ] + +# This should be your name or the names of the organization who currently +# maintains the project, and a valid email address corresponding to the name +# listed. +maintainers = [ + {name = "A. Great Maintainer", email = "maintainer@example.com" } # Optional +] + +# Classifiers help users find your project by categorizing it. +# +# For a list of valid classifiers, see https://pypi.org/classifiers/ +classifiers = [ # Optional + # How mature is this project? Common values are + # 3 - Alpha + # 4 - Beta + # 5 - Production/Stable + "Development Status :: 4 - Beta", + + # Indicate who your project is intended for + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + + # Pick your license as you wish + "License :: OSI Approved :: MIT License", + + # Specify the Python versions you support here. In particular, ensure + # that you indicate you support Python 3. These classifiers are *not* + # checked by "pip install". See instead "python_requires" below. + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", +] + +# This field lists other packages that your project depends on to run. +# Any package you put here will be installed by pip when your project is +# installed, so they must be valid existing projects. +# +# For an analysis of this field vs pip's requirements files see: +# https://packaging.python.org/discussions/install-requires-vs-requirements/ +dependencies = [ # Optional + "numpy" +] + +# List additional groups of dependencies here (e.g. development +# dependencies). Users will be able to install these using the "extras" +# syntax, for example: +# +# $ pip install sampleproject[dev] +# +# Similar to `dependencies` above, these must be valid existing +# projects. +[project.optional-dependencies] # Optional +dev = ["check-manifest"] +test = ["coverage"] + +# List URLs that are relevant to your project +# +# This field corresponds to the "Project-URL" and "Home-Page" metadata fields: +# https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use +# https://packaging.python.org/specifications/core-metadata/#home-page-optional +# +# Examples listed include a pattern for specifying where the package tracks +# issues, where the source is hosted, where to say thanks to the package +# maintainers, and where to support the project financially. The key is +# what's used to render the link text on PyPI. +[project.urls] # Optional +"Homepage" = "https://github.com/pypa/sampleproject" +"Bug Reports" = "https://github.com/pypa/sampleproject/issues" +"Funding" = "https://donate.pypi.org" +"Say Thanks!" = "http://saythanks.io/to/example" +"Source" = "https://github.com/pypa/sampleproject/" + +# The following would provide a command line executable called `sample` +# which executes the function `main` from this package when invoked. +[project.scripts] # Optional +sample = "sample:main" + +# This is configuration specific to the `setuptools` build backend. +# If you are using a different build backend, you will need to change this. +[tool.setuptools] +# If there are data files included in your packages that need to be +# installed, specify them here. +package-data = {"sample" = ["*.dat"]} + +[build-system] +# These are the assumed default build requirements from pip: +# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support +requires = ["setuptools>=43.0.0", "wheel"] +build-backend = "setuptools.build_meta" From d38a5b0b8ae9f09a7cdfa2661ad9d76728a5d884 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Fri, 23 Feb 2024 10:34:51 -0600 Subject: [PATCH 07/29] Update pyproject, remove setup.cfg and setup.py --- pyproject.toml | 54 +++++++++++++++++++++++++++----------------------- setup.cfg | 41 -------------------------------------- setup.py | 6 ------ 3 files changed, 29 insertions(+), 72 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 0b2b446..ef68c67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,9 @@ -[build-system] -requires = ["setuptools>=42"] -build-backend = "setuptools.build_meta" - -# dynamic = ["version", "description"] - [project] name = "cvi" + +# This should be your name or the name of the organization who originally +# authored the project, and a valid email address corresponding to the name +# listed. authors = [ {name = "Sasha Petrenko", email = "petrenkos@mst.edu"} ] @@ -20,7 +18,7 @@ version = "0.5.1" # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: # https://packaging.python.org/specifications/core-metadata/#summary -description = "A sample Python project" # Optional +description = "A Python package for both batch and incremental cluster validity indices." # Optional # This is an optional longer description of your project that represents # the body of text which users will see when they visit PyPI. @@ -36,12 +34,12 @@ readme = "README.md" # Optional # 'Programming Language' classifiers above, 'pip install' will check this # and refuse to install the project if the version does not match. See # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires -requires-python = ">=3.7" +requires-python = ">=3.6" # This is either text indicating the license for the distribution, or a file # that contains the license # https://packaging.python.org/en/latest/specifications/core-metadata/#license -license = {file = "LICENSE.txt"} +license = {file = "LICENSE"} # This field adds keywords for your project which will appear on the # project page. What does your project relate to? @@ -49,20 +47,22 @@ license = {file = "LICENSE.txt"} # Note that this is a list of additional keywords, separated # by commas, to be used to assist searching for the distribution in a # larger catalog. -keywords = ["sample", "setuptools", "development"] # Optional +keywords = [ + "cluster validity indices", + "cluster validity index", + "incremental cluster validity indices", + "incremental cluster validity index", + "cluster validation", + "cvi", + "icvi" +] # Optional -# This should be your name or the name of the organization who originally -# authored the project, and a valid email address corresponding to the name -# listed. -# authors = [ -# {name = "A. Random Developer", email = "author@example.com" } # Optional -# ] # This should be your name or the names of the organization who currently # maintains the project, and a valid email address corresponding to the name # listed. maintainers = [ - {name = "A. Great Maintainer", email = "maintainer@example.com" } # Optional + {name = "Sasha Petrenko", email = "petrenkos@mst.edu" } # Optional ] # Classifiers help users find your project by categorizing it. @@ -86,11 +86,13 @@ classifiers = [ # Optional # that you indicate you support Python 3. These classifiers are *not* # checked by "pip install". See instead "python_requires" below. "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", ] @@ -127,26 +129,28 @@ test = ["coverage"] # maintainers, and where to support the project financially. The key is # what's used to render the link text on PyPI. [project.urls] # Optional -"Homepage" = "https://github.com/pypa/sampleproject" -"Bug Reports" = "https://github.com/pypa/sampleproject/issues" -"Funding" = "https://donate.pypi.org" -"Say Thanks!" = "http://saythanks.io/to/example" -"Source" = "https://github.com/pypa/sampleproject/" +"Homepage" = "https://github.com/AP6YC/cvi" +"Bug Reports" = "https://github.com/AP6YC/cvi/issues" +"Documentation" = "https://cluster-validity-indices.readthedocs.io/" +"Source" = "https://github.com/AP6YC/cvi/" +# "Funding" = "https://donate.pypi.org" +# "Say Thanks!" = "http://saythanks.io/to/example" # The following would provide a command line executable called `sample` # which executes the function `main` from this package when invoked. -[project.scripts] # Optional -sample = "sample:main" +# [project.scripts] # Optional +# sample = "sample:main" # This is configuration specific to the `setuptools` build backend. # If you are using a different build backend, you will need to change this. [tool.setuptools] # If there are data files included in your packages that need to be # installed, specify them here. -package-data = {"sample" = ["*.dat"]} +# package-data = {"sample" = ["*.dat"]} [build-system] # These are the assumed default build requirements from pip: # https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support +# requires = ["setuptools>=42"] requires = ["setuptools>=43.0.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 20344b3..0000000 --- a/setup.cfg +++ /dev/null @@ -1,41 +0,0 @@ -[metadata] -name = cvi -version = 0.5.1 -author = Sasha Petrenko -author_email = petrenkos@mst.com -description = A Python package for both batch and incremental cluster validity indices. -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/AP6YC/cvi -project_urls = - Bug Tracker = https://github.com/AP6YC/cvi/issues - Documentation = https://cluster-validity-indices.readthedocs.io/ -classifiers = - Programming Language :: Python :: 3 - License :: OSI Approved :: MIT License - Operating System :: OS Independent - -[options] -package_dir = - = src -packages = find: -python_requires = >=3.6 -install_requires = - numpy - -[options.packages.find] -where = src - -[flake8] -# Docstrings and comments should be an exception to line length -max-doc-length = 300 -# TODO: Flake8 doesn't seem to respect docstring length -max-line-length = 300 -# Exclude these directories for linting -exclude = - .git, - __pycache__, - old, - build, - dist, - _dev diff --git a/setup.py b/setup.py deleted file mode 100644 index 2553605..0000000 --- a/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup - -if __name__ == "__main__": - setup() From c2dca63e1d50a615b531abc0deb9d9f80a870e25 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Fri, 31 May 2024 16:27:01 -0500 Subject: [PATCH 08/29] Add preliminary cvi header --- README.md | 19 +++++++++++++++++++ docs/source/conf.py | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e142698..6d17ff1 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,9 @@ A Python package implementing both batch and incremental cluster validity indice - [Derivation](#derivation) - [Authors](#authors) - [Related Projects](#related-projects) + - [Assets](#assets) + - [Fonts](#fonts) + - [Icons](#icons) ## Cluster Validity Indices @@ -187,6 +190,8 @@ The following CVIs have been implemented as of the latest version of `cvi`: - 8/18/2022: Initialize project. - 9/8/2022: First release on PyPi and initiate GitFlow. +- 8/10/2023: v0.5.1 released. +- 5/31/2024: Updated documentation. ## Acknowledgements @@ -209,3 +214,17 @@ If this package is missing something that you need, feel free to check out some - [validclust](https://github.com/crew102/validclust) - [clusterval](https://github.com/Nuno09/clusterval) + +### Assets + +#### Fonts + +The following font is used in the logo: + +- [Ethnocentric Font Family](https://www.1001fonts.com/ethnocentric-font.html) + +#### Icons + +The icon for the project is taken from: + +- [Cluster computing icons created by IconBaandar - Flaticon](https://www.flaticon.com/free-icons/cluster-computing) ([cluster-5464694](https://www.flaticon.com/free-icon/cluster_5464694)) diff --git a/docs/source/conf.py b/docs/source/conf.py index 86f2896..605a862 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -54,7 +54,8 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output # html_theme = 'alabaster' -html_theme = 'sphinx_rtd_theme' +# html_theme = 'sphinx_rtd_theme' +html_theme = 'furo' html_static_path = ['_static'] From 15bef4ff42cfe1beba87cfaf15167b17c60bb2fe Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Fri, 31 May 2024 16:33:49 -0500 Subject: [PATCH 09/29] Actually add header to readme and index --- README.md | 33 ++++++++++++++++----------------- docs/source/index.rst | 6 +++++- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6d17ff1..02161fc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# cvi +[![cvi-header](https://github.com/AP6YC/FileStorage/blob/main/cvi/header.png?raw=true)][docs-dev-url] A Python package implementing both batch and incremental cluster validity indices (CVIs). @@ -34,22 +34,21 @@ A Python package implementing both batch and incremental cluster validity indice ## Table of Contents -- [cvi](#cvi) - - [Table of Contents](#table-of-contents) - - [Cluster Validity Indices](#cluster-validity-indices) - - [Installation](#installation) - - [Usage](#usage) - - [Quickstart](#quickstart) - - [Detailed Usage](#detailed-usage) - - [Implemented CVIs](#implemented-cvis) - - [History](#history) - - [Acknowledgements](#acknowledgements) - - [Derivation](#derivation) - - [Authors](#authors) - - [Related Projects](#related-projects) - - [Assets](#assets) - - [Fonts](#fonts) - - [Icons](#icons) +- [Table of Contents](#table-of-contents) +- [Cluster Validity Indices](#cluster-validity-indices) +- [Installation](#installation) +- [Usage](#usage) + - [Quickstart](#quickstart) + - [Detailed Usage](#detailed-usage) +- [Implemented CVIs](#implemented-cvis) +- [History](#history) +- [Acknowledgements](#acknowledgements) + - [Derivation](#derivation) + - [Authors](#authors) + - [Related Projects](#related-projects) + - [Assets](#assets) + - [Fonts](#fonts) + - [Icons](#icons) ## Cluster Validity Indices diff --git a/docs/source/index.rst b/docs/source/index.rst index 7b4f84b..e898d2a 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,7 +3,11 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to cvi's documentation! +.. image:: https://github.com/AP6YC/FileStorage/blob/main/cvi/header.png?raw=true + :alt: Cluster Validity Indices + :align: center + +`cvi`: Cluster Validity Indices in Python ==================================================== From c5e92a98f1c6d5fef236d395db15e6431901e5cf Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Fri, 31 May 2024 16:39:00 -0500 Subject: [PATCH 10/29] Update LTS testing matrix, remove macOS tests --- .github/workflows/Test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 4e6a94e..a321652 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -13,18 +13,18 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] os: - ubuntu-latest - - macOS-latest + # - macOS-latest # - windows-latest arch: - x64 - x86 - exclude: - # Exclude 32-bit macOS due to Julia support - - os: macOS-latest - arch: x86 + # exclude: + # # Exclude 32-bit macOS due to Julia support + # - os: macOS-latest + # arch: x86 steps: - uses: actions/checkout@v3 From 92f8251617f202d07d7a5d5307465ae50c0c086e Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Sun, 2 Jun 2024 12:54:22 -0500 Subject: [PATCH 11/29] Rework requirements files into pyproject optional deps --- .github/workflows/Documentation.yml | 3 ++- .github/workflows/Test.yml | 5 +++-- dev-all-requirements.txt | 22 ---------------------- dev-requirements.txt | 10 ---------- docs/requirements.txt | 5 ----- pyproject.toml | 23 ++++++++++++++++++++--- requirements.txt | 1 - 7 files changed, 25 insertions(+), 44 deletions(-) delete mode 100644 dev-all-requirements.txt delete mode 100644 dev-requirements.txt delete mode 100644 docs/requirements.txt delete mode 100644 requirements.txt diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index cdd156f..e2cfd84 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -19,7 +19,8 @@ jobs: - uses: actions/setup-python@v3 - name: Install dependencies run: | - pip install -r docs/requirements.txt + # pip install -r docs/requirements.txt + pip install -e .[docs] - name: Sphinx build run: | cd docs diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index a321652..c4ba91d 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -35,8 +35,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - pip install -r requirements.txt + # pip install flake8 pytest + # pip install -r requirements.txt + pip install -e .[test] # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | diff --git a/dev-all-requirements.txt b/dev-all-requirements.txt deleted file mode 100644 index c7d7b51..0000000 --- a/dev-all-requirements.txt +++ /dev/null @@ -1,22 +0,0 @@ -# ----------------------------------------------------------------------------- -# DEV-ALL-REQUIREMENTS.TXT -# -# NOTE: this file is for only package development and is not necessary for its -# usage. -# -# This file installs all of the requirements for each component of the project -# for development, including the package requirements, useful dev tools, -# testing requirements, and tools necessary for building the documentation. -# ----------------------------------------------------------------------------- - -# The package requirements --r requirements.txt - -# Development tools --r dev-requirements.txt - -# Testing requirements --r tests/requirements.txt - -# Documentation requirements --r docs/requirements.txt diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index 5dc1a17..0000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Packaging tools -build -setuptools -twine - -# Added tools for development -jupyterlab - -# The package itself --e . diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 1a847dc..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Documentation tools -sphinx -# sphinx-rtd-theme -furo -# numpy diff --git a/pyproject.toml b/pyproject.toml index ef68c67..0380fe6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,7 +103,7 @@ classifiers = [ # Optional # For an analysis of this field vs pip's requirements files see: # https://packaging.python.org/discussions/install-requires-vs-requirements/ dependencies = [ # Optional - "numpy" + "numpy", ] # List additional groups of dependencies here (e.g. development @@ -115,8 +115,25 @@ dependencies = [ # Optional # Similar to `dependencies` above, these must be valid existing # projects. [project.optional-dependencies] # Optional -dev = ["check-manifest"] -test = ["coverage"] +dev = [ + "check-manifest", + "build", + "setuptools", + "twine", + "jupyterlab", +] +test = [ + "pytest", + "pytest-cov", + "coverage", + "pandas", + "scikit-learn", + "flake8", +] +docs = [ + "sphinx", + "furo", +] # List URLs that are relevant to your project # diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 24ce15a..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -numpy From f9be772c3e027a2af9c0a50b04a77b6537909901 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Mon, 3 Jun 2024 09:03:08 -0500 Subject: [PATCH 12/29] Deploy on dev branch as well --- .github/workflows/Documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index e2cfd84..7925e5c 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -27,7 +27,7 @@ jobs: make html - name: Deploy uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + if: ${{ github.event_name == 'push' && ((github.ref == 'refs/heads/main') || (github.ref == 'refs/heads/develop'))}} with: publish_branch: gh-pages github_token: ${{ secrets.GITHUB_TOKEN }} From a8a996316d2684c19aa82481aa717f55a788baf4 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Mon, 3 Jun 2024 13:15:56 -0500 Subject: [PATCH 13/29] Init sphinx_multiversion --- .github/workflows/Test.yml | 5 +--- docs/source/_templates/versioning.html | 8 ++++++ docs/source/conf.py | 37 ++++++++++++++++++++++++++ docs/source/index.rst | 1 + pyproject.toml | 1 + tests/requirements.txt | 9 ------- 6 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 docs/source/_templates/versioning.html delete mode 100644 tests/requirements.txt diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index c4ba91d..181e629 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -13,6 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: + # Test on current Python LTS versions python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] os: - ubuntu-latest @@ -21,10 +22,6 @@ jobs: arch: - x64 - x86 - # exclude: - # # Exclude 32-bit macOS due to Julia support - # - os: macOS-latest - # arch: x86 steps: - uses: actions/checkout@v3 diff --git a/docs/source/_templates/versioning.html b/docs/source/_templates/versioning.html new file mode 100644 index 0000000..5347ebb --- /dev/null +++ b/docs/source/_templates/versioning.html @@ -0,0 +1,8 @@ +{% if versions %} +

{{ _('Versions') }}

+ +{% endif %} \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 605a862..46f234e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -30,6 +30,7 @@ 'sphinx.ext.autosummary', 'sphinx.ext.intersphinx', 'sphinx.ext.napoleon', + "sphinx_multiversion", # 'sphinx.ext.autosectionlabel', # 'sphinx_autopackagesummary', ] @@ -59,9 +60,45 @@ html_static_path = ['_static'] +html_sidebars = { + "**": [ + "sidebar/scroll-start.html", + "sidebar/brand.html", + "sidebar/search.html", + "sidebar/navigation.html", + "sidebar/ethical-ads.html", + "versioning.html", + "sidebar/scroll-end.html", + ] +} + # -- Options for EPUB output epub_show_urls = 'footnote' + +# Whitelist pattern for tags (set to None to ignore all tags) +# smv_tag_whitelist = r'^.*$' +smv_tag_whitelist = None + +# Whitelist pattern for branches (set to None to ignore all branches) +# smv_branch_whitelist = r'^.*$ +# smv_branch_whitelist = None +# smv_branch_whitelist = r'^(main|develop)$' +smv_branch_whitelist = r'^self-host-docs$' + +# Whitelist pattern for remotes (set to None to use local branches only) +smv_remote_whitelist = None + +# Pattern for released versions +# smv_released_pattern = r'^tags/.*$' +smv_released_pattern = r'^v*$' + +# Format for versioned output directories inside the build directory +smv_outputdir_format = '{ref.name}' + +# Determines whether remote or local git branches/tags are preferred if their output dirs conflict +smv_prefer_remote_refs = False + # # Skip param objects because of their weird rendering in docs # def maybe_skip_member(app, what, name, obj, skip, options): # # print app, what, name, obj, skip, options diff --git a/docs/source/index.rst b/docs/source/index.rst index e898d2a..82b8dfe 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -10,6 +10,7 @@ `cvi`: Cluster Validity Indices in Python ==================================================== +**THIS IS A TEST OF THE DOCS BUILD** These pages serve as the official documentation for the `cvi` Python package, the Python implementation of the `ClusterValidityIndices.jl `_ Julia package. diff --git a/pyproject.toml b/pyproject.toml index 0380fe6..bed96ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,6 +133,7 @@ test = [ docs = [ "sphinx", "furo", + "sphinx-multiversion", ] # List URLs that are relevant to your project diff --git a/tests/requirements.txt b/tests/requirements.txt deleted file mode 100644 index 97689cf..0000000 --- a/tests/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -pytest -pytest-cov -coverage -pandas -scikit-learn -flake8 -# numpy -# tqdm -# jupyterlab From f1f756ffcdff4e763fb3ddaa484ecbf8590ecffc Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Mon, 3 Jun 2024 18:44:01 -0500 Subject: [PATCH 14/29] Rework whitelists, templates --- docs/source/_templates/page.html | 17 +++++++++++++ docs/source/_templates/versioning.html | 35 ++++++++++++++++++++------ docs/source/conf.py | 13 ++++++---- docs/source/index.rst | 2 -- 4 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 docs/source/_templates/page.html diff --git a/docs/source/_templates/page.html b/docs/source/_templates/page.html new file mode 100644 index 0000000..79bf95c --- /dev/null +++ b/docs/source/_templates/page.html @@ -0,0 +1,17 @@ +{% extends "!page.html" %} +{% block body %} +{% if current_version and latest_version and current_version != latest_version %} +

+ + {% if current_version.is_released %} + You're reading an old version of this documentation. + If you want up-to-date information, please have a look at {{latest_version.name}}. + {% else %} + You're reading the documentation for a development version. + For the latest released version, please have a look at {{latest_version.name}}. + {% endif %} + +

+{% endif %} +{{ super() }} +{% endblock %}% \ No newline at end of file diff --git a/docs/source/_templates/versioning.html b/docs/source/_templates/versioning.html index 5347ebb..476c8d1 100644 --- a/docs/source/_templates/versioning.html +++ b/docs/source/_templates/versioning.html @@ -1,8 +1,27 @@ -{% if versions %} -

{{ _('Versions') }}

- -{% endif %} \ No newline at end of file +{%- if current_version %} +
+ + Other Versions + v: {{ current_version.name }} + + +
+ {%- if versions.tags %} +
+
Tags
+ {%- for item in versions.tags %} +
{{ item.name }}
+ {%- endfor %} +
+ {%- endif %} + {%- if versions.branches %} +
+
Branches
+ {%- for item in versions.branches %} +
{{ item.name }}
+ {%- endfor %} +
+ {%- endif %} +
+
+{%- endif %} \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 46f234e..a15a8e4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,7 +14,7 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = 'cvi' -copyright = '2022, Sasha Petrenko' +copyright = '2024, Sasha Petrenko' author = 'Sasha Petrenko' release = '0.5.1' version = '0.5.1' @@ -67,8 +67,8 @@ "sidebar/search.html", "sidebar/navigation.html", "sidebar/ethical-ads.html", - "versioning.html", "sidebar/scroll-end.html", + "versioning.html", ] } @@ -78,20 +78,23 @@ # Whitelist pattern for tags (set to None to ignore all tags) # smv_tag_whitelist = r'^.*$' -smv_tag_whitelist = None +# smv_tag_whitelist = None +smv_tag_whitelist = r'^v*$' # Whitelist pattern for branches (set to None to ignore all branches) # smv_branch_whitelist = r'^.*$ # smv_branch_whitelist = None # smv_branch_whitelist = r'^(main|develop)$' -smv_branch_whitelist = r'^self-host-docs$' +# smv_branch_whitelist = r'^self-host-docs$' +smv_branch_whitelist = r'^(main|develop|self-host-docs)$' # Whitelist pattern for remotes (set to None to use local branches only) smv_remote_whitelist = None # Pattern for released versions # smv_released_pattern = r'^tags/.*$' -smv_released_pattern = r'^v*$' +smv_released_pattern = r'^tags/v*$' +# smv_released_pattern = None # Format for versioned output directories inside the build directory smv_outputdir_format = '{ref.name}' diff --git a/docs/source/index.rst b/docs/source/index.rst index 82b8dfe..4e00a0f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -10,8 +10,6 @@ `cvi`: Cluster Validity Indices in Python ==================================================== -**THIS IS A TEST OF THE DOCS BUILD** - These pages serve as the official documentation for the `cvi` Python package, the Python implementation of the `ClusterValidityIndices.jl `_ Julia package. Cluster Validity Indices (CVIs) tackle the problem of judging the performance of an unsupervised/clustering algorithm without the availability of truth or supervisory labels, resulting in metrics of under- or over-partitioning. From e49fbf3a14a4383acfaee1290e3eff77f909024c Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Tue, 4 Jun 2024 11:36:33 -0500 Subject: [PATCH 15/29] Reworking tag pattern --- docs/Makefile | 3 ++- docs/make.bat | 3 ++- docs/source/conf.py | 18 ++++++++++++------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index d0c3cbf..79e2a1a 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -4,7 +4,8 @@ # You can set these variables from the command line, and also # from the environment for the first two. SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build +# SPHINXBUILD ?= sphinx-build +SPHINXBUILD ?= sphinx-multiversion SOURCEDIR = source BUILDDIR = build diff --git a/docs/make.bat b/docs/make.bat index dc1312a..0229ce3 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -5,7 +5,8 @@ pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build + @REM set SPHINXBUILD=sphinx-build + set SPHINXBUILD=sphinx-multiversion ) set SOURCEDIR=source set BUILDDIR=build diff --git a/docs/source/conf.py b/docs/source/conf.py index a15a8e4..f64b157 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -69,17 +69,23 @@ "sidebar/ethical-ads.html", "sidebar/scroll-end.html", "versioning.html", - ] + ], } +# html_css_files = [ +# 'css/rtd.css', +# ] + # -- Options for EPUB output epub_show_urls = 'footnote' # Whitelist pattern for tags (set to None to ignore all tags) # smv_tag_whitelist = r'^.*$' -# smv_tag_whitelist = None -smv_tag_whitelist = r'^v*$' +# smv_tag_whitelist = r'v*' +smv_tag_whitelist = None +# smv_tag_pattern = r'^v\d*\.\d*\.\d*$' +# smv_tag_pattern = r'^.*(?!alpha)$' # Whitelist pattern for branches (set to None to ignore all branches) # smv_branch_whitelist = r'^.*$ @@ -92,9 +98,9 @@ smv_remote_whitelist = None # Pattern for released versions -# smv_released_pattern = r'^tags/.*$' -smv_released_pattern = r'^tags/v*$' -# smv_released_pattern = None +# smv_released_pattern = r'^v.*$' +# smv_released_pattern = r'v\d*\.\d*\.\d*' +smv_released_pattern = r'^tags/.*$' # Format for versioned output directories inside the build directory smv_outputdir_format = '{ref.name}' From 132a1771c707df83fa8e2240b2848d6b398c9774 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Wed, 5 Jun 2024 19:12:35 -0500 Subject: [PATCH 16/29] Use simple versions sidebar --- docs/source/_templates/versioning.html | 38 ++++++++------------------ docs/source/conf.py | 2 +- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/docs/source/_templates/versioning.html b/docs/source/_templates/versioning.html index 476c8d1..a185e57 100644 --- a/docs/source/_templates/versioning.html +++ b/docs/source/_templates/versioning.html @@ -1,27 +1,11 @@ -{%- if current_version %} -
- - Other Versions - v: {{ current_version.name }} - - -
- {%- if versions.tags %} -
-
Tags
- {%- for item in versions.tags %} -
{{ item.name }}
- {%- endfor %} -
- {%- endif %} - {%- if versions.branches %} -
-
Branches
- {%- for item in versions.branches %} -
{{ item.name }}
- {%- endfor %} -
- {%- endif %} -
-
-{%- endif %} \ No newline at end of file +{% if versions %} +
{{ _('Docs Versions') }}
+ + +{% endif %} \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index f64b157..8191a03 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -92,7 +92,7 @@ # smv_branch_whitelist = None # smv_branch_whitelist = r'^(main|develop)$' # smv_branch_whitelist = r'^self-host-docs$' -smv_branch_whitelist = r'^(main|develop|self-host-docs)$' +smv_branch_whitelist = r'^(main|develop)$' # Whitelist pattern for remotes (set to None to use local branches only) smv_remote_whitelist = None From f9997fd0d6ba15ec23f3de46b5048b0ba253a2fa Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 00:15:03 -0500 Subject: [PATCH 17/29] Match versions sidebar to furo theme --- docs/source/_templates/versioning.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/source/_templates/versioning.html b/docs/source/_templates/versioning.html index a185e57..045bdc9 100644 --- a/docs/source/_templates/versioning.html +++ b/docs/source/_templates/versioning.html @@ -1,11 +1,12 @@ {% if versions %} -
{{ _('Docs Versions') }}
- - + {% endif %} \ No newline at end of file From 48b277407fc2d1bf2eac4b24c867d05390f29259 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 00:33:38 -0500 Subject: [PATCH 18/29] Maybe fix docs build, symlinks, badges --- .github/workflows/Documentation.yml | 14 ++++++++++++-- README.md | 8 ++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 7925e5c..b04b339 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -17,20 +17,30 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 + - name: Install dependencies run: | # pip install -r docs/requirements.txt pip install -e .[docs] + - name: Sphinx build run: | cd docs - make html + # make html + sphinx-multiversion source build/html + + - name: Make symlinks + run: | + ln -s build/html/main stable + ln -s build/html/develop dev + - name: Deploy uses: peaceiris/actions-gh-pages@v3 if: ${{ github.event_name == 'push' && ((github.ref == 'refs/heads/main') || (github.ref == 'refs/heads/develop'))}} with: publish_branch: gh-pages github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/build/ + # publish_dir: docs/build/ + publish_dir: docs/build/html/ # publish_dir: _build/ # force_orphan: true diff --git a/README.md b/README.md index 02161fc..da46386 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ A Python package implementing both batch and incremental cluster validity indice [zenodo-img]: https://zenodo.org/badge/526280198.svg [zenodo-url]: https://zenodo.org/badge/latestdoi/526280198 -[docs-stable-img]: https://readthedocs.org/projects/cluster-validity-indices/badge/?version=latest -[docs-stable-url]: https://cluster-validity-indices.readthedocs.io/en/latest/?badge=latest +[docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg +[docs-stable-url]: https://AP6YC.github.io/cvi/stable -[docs-dev-img]: https://readthedocs.org/projects/cluster-validity-indices/badge/?version=develop -[docs-dev-url]: https://cluster-validity-indices.readthedocs.io/en/develop/?badge=develop +[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg +[docs-dev-url]: https://AP6YC.github.io/cvi/dev [ci-img]: https://github.com/AP6YC/cvi/actions/workflows/Test.yml/badge.svg [ci-url]: https://github.com/AP6YC/cvi/actions/workflows/Test.yml From 4378527bfb39739d316b45208cd5ab83c2b7a10a Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 00:36:16 -0500 Subject: [PATCH 19/29] Try git fetch before build --- .github/workflows/Documentation.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index b04b339..abe5189 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -27,12 +27,13 @@ jobs: run: | cd docs # make html + git fetch --all sphinx-multiversion source build/html - name: Make symlinks run: | - ln -s build/html/main stable - ln -s build/html/develop dev + ln -sf build/html/main stable + ln -sf build/html/develop dev - name: Deploy uses: peaceiris/actions-gh-pages@v3 From a394e0108fe6f5bd6bd368d042837ee4a811690e Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 00:47:45 -0500 Subject: [PATCH 20/29] Try new order of ops --- .github/workflows/Documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index abe5189..bf57bf2 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -25,9 +25,9 @@ jobs: - name: Sphinx build run: | + git fetch --all cd docs # make html - git fetch --all sphinx-multiversion source build/html - name: Make symlinks From 14cb5838efb7c481826758e4abbf19fba36e3f02 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 01:03:00 -0500 Subject: [PATCH 21/29] Maybe git pull --- .github/workflows/Documentation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index bf57bf2..b5f5c4d 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -26,6 +26,7 @@ jobs: - name: Sphinx build run: | git fetch --all + git pull --all cd docs # make html sphinx-multiversion source build/html From 4cbe22c917efaf8e8e381437e2586275c41f7f1a Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 01:05:47 -0500 Subject: [PATCH 22/29] Maybe checkout depth --- .github/workflows/Documentation.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index b5f5c4d..a497f69 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -15,7 +15,10 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + lfs: 'true' + fetch-depth: 0 - uses: actions/setup-python@v3 - name: Install dependencies @@ -26,7 +29,7 @@ jobs: - name: Sphinx build run: | git fetch --all - git pull --all + # git pull --all cd docs # make html sphinx-multiversion source build/html From 9e3772e4ac75b09f0131eb3da06df99cb247d5fc Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 01:10:09 -0500 Subject: [PATCH 23/29] Try manual checkout --- .github/workflows/Documentation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index a497f69..adc7b42 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -30,6 +30,7 @@ jobs: run: | git fetch --all # git pull --all + git checkout ${{ github.ref }} cd docs # make html sphinx-multiversion source build/html From 78ac8d13b112c96a04341ce021ec9041dd3b6774 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 01:11:28 -0500 Subject: [PATCH 24/29] Checkout develop in case of PR ref --- .github/workflows/Documentation.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index adc7b42..b07fe81 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -30,7 +30,8 @@ jobs: run: | git fetch --all # git pull --all - git checkout ${{ github.ref }} + # git checkout ${{ github.ref }} + git checkout develop cd docs # make html sphinx-multiversion source build/html From 50847f905c09e844446bd48071237252e60d0b79 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 01:27:55 -0500 Subject: [PATCH 25/29] Hotfix: not all docs branches being built --- .github/workflows/Documentation.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index b07fe81..5a7de6b 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -29,7 +29,7 @@ jobs: - name: Sphinx build run: | git fetch --all - # git pull --all + git pull --all # git checkout ${{ github.ref }} git checkout develop cd docs @@ -38,8 +38,8 @@ jobs: - name: Make symlinks run: | - ln -sf build/html/main stable - ln -sf build/html/develop dev + ln -sf build/html/main build/html/stable + ln -sf build/html/develop build/html/dev - name: Deploy uses: peaceiris/actions-gh-pages@v3 From 7f4972001ba8ee508cde0cb1243e57bdda8f217b Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 01:33:44 -0500 Subject: [PATCH 26/29] Hotfix: temp hack to force main build --- .github/workflows/Documentation.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 5a7de6b..51793f5 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -26,16 +26,25 @@ jobs: # pip install -r docs/requirements.txt pip install -e .[docs] - - name: Sphinx build + - name: Prep Sphinx Build run: | git fetch --all git pull --all - # git checkout ${{ github.ref }} git checkout develop cd docs + + - name: Sphinx Build Develop + run: | # make html sphinx-multiversion source build/html + - name: Sphinx Build Main + run: | + cd .. + git checkout main + cd docs + sphinx-multiversion source build/html + - name: Make symlinks run: | ln -sf build/html/main build/html/stable From 08e187572f038d1b97121a9070071c88be4f87ea Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 01:36:50 -0500 Subject: [PATCH 27/29] Hotfix: try workspace cd --- .github/workflows/Documentation.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 51793f5..a5d56c0 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -30,19 +30,19 @@ jobs: run: | git fetch --all git pull --all - git checkout develop - cd docs + - name: Sphinx Build Develop run: | + git checkout develop + cd ${{ github.workspace }}/docs # make html sphinx-multiversion source build/html - name: Sphinx Build Main run: | - cd .. git checkout main - cd docs + cd ${{ github.workspace }}/docs sphinx-multiversion source build/html - name: Make symlinks From f503c174dba017d8244fd032e8b2f7c0f8ec6c22 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 01:47:34 -0500 Subject: [PATCH 28/29] Bump to v0.6.0 --- README.md | 2 +- docs/source/conf.py | 4 ++-- pyproject.toml | 2 +- src/cvi/__init__.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index da46386..5913c37 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ pip install cvi You can also specify a version to install in the usual way with ```python -pip install cvi==v0.5.1 +pip install cvi==v0.6.0 ``` Alternatively, you can manually install a release from the [releases page](https://github.com/AP6YC/cvi/releases) on GitHub. diff --git a/docs/source/conf.py b/docs/source/conf.py index 8191a03..2f7d26a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,8 +16,8 @@ project = 'cvi' copyright = '2024, Sasha Petrenko' author = 'Sasha Petrenko' -release = '0.5.1' -version = '0.5.1' +release = '0.6.0' +version = '0.6.0' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index bed96ba..99789cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ authors = [ # # For a discussion on single-sourcing the version, see # https://packaging.python.org/guides/single-sourcing-package-version/ -version = "0.5.1" +version = "0.6.0" # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: diff --git a/src/cvi/__init__.py b/src/cvi/__init__.py index 3ade956..b78bc4f 100644 --- a/src/cvi/__init__.py +++ b/src/cvi/__init__.py @@ -3,7 +3,7 @@ """ # Set the version variable of the package -__version__ = "0.5.1" +__version__ = "0.6.0" # Import CVI modules to the top level from .modules import ( From 163622b2d56fdb5213318cd13a6bcf9f85ec43a0 Mon Sep 17 00:00:00 2001 From: Sasha Petrenko Date: Thu, 6 Jun 2024 01:49:43 -0500 Subject: [PATCH 29/29] Fix checkout then fetch order --- .github/workflows/Documentation.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index a5d56c0..bb5fa10 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -26,15 +26,11 @@ jobs: # pip install -r docs/requirements.txt pip install -e .[docs] - - name: Prep Sphinx Build - run: | - git fetch --all - git pull --all - - - name: Sphinx Build Develop run: | git checkout develop + git fetch --all + git pull --all cd ${{ github.workspace }}/docs # make html sphinx-multiversion source build/html