From d69f98ee1c7b89d9b320c505b0155bdfb94235cf Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Thu, 14 Aug 2025 22:45:59 -0800 Subject: [PATCH 01/17] remove setup.cfg and setup.py files --- setup.cfg | 24 ------------------------ setup.py | 4 ---- 2 files changed, 28 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6c02238..0000000 --- a/setup.cfg +++ /dev/null @@ -1,24 +0,0 @@ -[metadata] -name = dca -version = 1.0.0 -author = Jesse Livezey, David Clark -author_email = jesse.livezey@gmail.com -description = Dynamical Components Analysis -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/BouchardLab/DynamicalComponentsAnalysis -project_urls = - Bug Tracker = https://github.com/BouchardLab/DynamicalComponentsAnalysis/issues -classifiers = - Programming Language :: Python :: 3 - License :: OSI Approved :: BSD-3-Clause-LBNL - Operating System :: OS Independent - -[options] -package_dir = - = src -packages = find: -python_requires = >=3.6 - -[options.packages.find] -where = src diff --git a/setup.py b/setup.py deleted file mode 100644 index 4f75033..0000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -from setuptools import setup - - -setup() \ No newline at end of file From cd97880c72c80e0690c31b5cace34931acca7f28 Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Thu, 14 Aug 2025 22:46:12 -0800 Subject: [PATCH 02/17] refactor `setup.cfg` and `setup.py` package info into `pyproject.toml` --- pyproject.toml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b0f0765..5a41266 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,31 @@ [build-system] -requires = ["setuptools>=42"] +requires = ["setuptools>=61", "wheel"] # [CHANGE] upgraded setuptools to 61+ for full pyproject.toml metadata support build-backend = "setuptools.build_meta" + +[project] +name = "dca" +version = "1.0.0" +description = "Dynamical Components Analysis" +readme = "README.md" +requires-python = ">=3.6" +authors = [ + { name="Jesse Livezey", email="jesse.livezey@gmail.com" }, + { name="David Clark" } +] +license = "BSD-3-Clause-LBNL" # [CHANGE] refactored from classifiers +license-files = ["LICENSE.txt"] +classifiers = [ + "Programming Language :: Python :: 3", + # "License :: OSI Approved :: BSD-3-Clause-LBNL", + "Operating System :: OS Independent" +] + +[project.urls] +Homepage = "https://github.com/BouchardLab/DynamicalComponentsAnalysis" +"Bug Tracker" = "https://github.com/BouchardLab/DynamicalComponentsAnalysis/issues" + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools] +package-dir = {"" = "src"} From 06a6ccee3bbb6c848858851284215097f282ecb0 Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Thu, 14 Aug 2025 23:20:43 -0800 Subject: [PATCH 03/17] update requirement to remove url for pyproject dependency build --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 87db078..b1cacd0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ h5py pandas scikit-learn matplotlib ---extra-index-url https://download.pytorch.org/whl/cpu +# --extra-index-url https://download.pytorch.org/whl/cpu torch From 3721cd3072133f5701ec0c11cb69bb2a33c6e710 Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Thu, 14 Aug 2025 23:21:25 -0800 Subject: [PATCH 04/17] add dynamic dependencies to use `requirements.txt` --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 5a41266..21a0a77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ classifiers = [ # "License :: OSI Approved :: BSD-3-Clause-LBNL", "Operating System :: OS Independent" ] +dynamic = ["dependencies"] [project.urls] Homepage = "https://github.com/BouchardLab/DynamicalComponentsAnalysis" @@ -29,3 +30,6 @@ where = ["src"] [tool.setuptools] package-dir = {"" = "src"} + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} \ No newline at end of file From 9831935ed9a76e3920944ae6f06d3376cf70bcf1 Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Fri, 15 Aug 2025 13:04:45 -0800 Subject: [PATCH 05/17] restore requirements.txt to current dca --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b1cacd0..87db078 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ h5py pandas scikit-learn matplotlib -# --extra-index-url https://download.pytorch.org/whl/cpu +--extra-index-url https://download.pytorch.org/whl/cpu torch From 441ea6d70f2f8d56cd670f2b614c8da457b96233 Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Fri, 15 Aug 2025 13:40:50 -0800 Subject: [PATCH 06/17] remove torch CPU only url for `pip install -e .` so `pyproject.toml` can compile --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 87db078..7729219 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,4 @@ h5py pandas scikit-learn matplotlib ---extra-index-url https://download.pytorch.org/whl/cpu torch From d3b2fb23b89617692b635fb76f039f83644e3550 Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Fri, 15 Aug 2025 13:42:34 -0800 Subject: [PATCH 07/17] update `README.md` to reflect changes in `requirements.txt` on how to install CPU-only `pytorch` --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index fae1dc1..74eca04 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,15 @@ If you are installing with `pip` you can run $ pip install -e . -r requirements.txt ``` +Note: DCA only requires a CPU-only `pytorch`. If you wish to, **before** installing DCA as in the above instructions, +you can install a CPU-only `pytorch` by following the `pytorch` [installation guide](https://pytorch.org/get-started/locally/). + + +```bash +$ pip install torch --index-url https://download.pytorch.org/whl/cpu +``` + + ## Datasets The 4 datasets used in the DCA paper can be found in the following locations * [M1](https://zenodo.org/record/583331) - We used indy_20160627_01.mat From 32ad22b40ee8818829339f4dab34aeddc2c0d8ea Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Wed, 27 Aug 2025 13:51:14 -0700 Subject: [PATCH 08/17] change project name to match pypi release name --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 21a0a77..6f7ad4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=61", "wheel"] # [CHANGE] upgraded setuptools to 61+ fo build-backend = "setuptools.build_meta" [project] -name = "dca" +name = "DynamicalComponentsAnalysis" version = "1.0.0" description = "Dynamical Components Analysis" readme = "README.md" From d648f37acc5aa8cb3a72f3542183db5d3951221b Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Wed, 27 Aug 2025 14:05:53 -0700 Subject: [PATCH 09/17] update version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6f7ad4f..96aae09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "DynamicalComponentsAnalysis" -version = "1.0.0" +version = "1.1.0" description = "Dynamical Components Analysis" readme = "README.md" requires-python = ">=3.6" From 131643f58033ebf396f7f4ddb1408fa0b1b0eacf Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Wed, 27 Aug 2025 14:23:40 -0700 Subject: [PATCH 10/17] update pyproject --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 96aae09..b315349 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,10 +13,10 @@ authors = [ { name="David Clark" } ] license = "BSD-3-Clause-LBNL" # [CHANGE] refactored from classifiers -license-files = ["LICENSE.txt"] +# license-files = ["LICENSE.txt"] classifiers = [ "Programming Language :: Python :: 3", - # "License :: OSI Approved :: BSD-3-Clause-LBNL", + "License :: OSI Approved :: BSD-3-Clause-LBNL", "Operating System :: OS Independent" ] dynamic = ["dependencies"] From 0ce7253905205031c36594e5637db68dcbaa2a25 Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Wed, 27 Aug 2025 14:27:08 -0700 Subject: [PATCH 11/17] update pyproject --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b315349..97c4424 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,8 +12,7 @@ authors = [ { name="Jesse Livezey", email="jesse.livezey@gmail.com" }, { name="David Clark" } ] -license = "BSD-3-Clause-LBNL" # [CHANGE] refactored from classifiers -# license-files = ["LICENSE.txt"] +license = { file = "LICENSE.txt" } classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: BSD-3-Clause-LBNL", From a1793a106299073b9b80044e4d8b0542ea3add41 Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Wed, 27 Aug 2025 14:30:09 -0700 Subject: [PATCH 12/17] remove license in from classifiers https://peps.python.org/pep-0639/ --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 97c4424..c842577 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,6 @@ authors = [ license = { file = "LICENSE.txt" } classifiers = [ "Programming Language :: Python :: 3", - "License :: OSI Approved :: BSD-3-Clause-LBNL", "Operating System :: OS Independent" ] dynamic = ["dependencies"] From 866aff9a2799975be22ef1b97c15916498596534 Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Wed, 27 Aug 2025 15:03:53 -0700 Subject: [PATCH 13/17] replace `np.int` with `int` --- src/dca/cov_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dca/cov_util.py b/src/dca/cov_util.py index 4e5851e..7cf4305 100644 --- a/src/dca/cov_util.py +++ b/src/dca/cov_util.py @@ -812,8 +812,8 @@ def __get__(self, obj, objtype): @memoized def pv_permutation(T, N): - A = np.arange((T * N)**2, dtype=np.int).reshape((T * N, T * N)) - A_perm = np.zeros((T**2, N**2), dtype=np.int) + A = np.arange((T * N)**2, dtype=int).reshape((T * N, T * N)) + A_perm = np.zeros((T**2, N**2), dtype=int) for i in range(T): for j in range(T): row_idx = i * T + j From 0213bf2b65a50106d961d334a9774e26766ecede Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Wed, 27 Aug 2025 15:18:32 -0700 Subject: [PATCH 14/17] change sphinx `html_theme_path` --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 89799a4..96f7f6d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -68,7 +68,7 @@ # a list of builtin themes. # html_theme = 'sphinx_rtd_theme' -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +html_theme_path = [sphinx_rtd_theme.html_theme_path()] # 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, From 2a839875e4507a990cd95578debbbef795d96ace Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Wed, 27 Aug 2025 15:25:09 -0700 Subject: [PATCH 15/17] remove deprecated get_html_theme_path call from conf.py --- docs/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 96f7f6d..70f6944 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -68,7 +68,6 @@ # a list of builtin themes. # html_theme = 'sphinx_rtd_theme' -html_theme_path = [sphinx_rtd_theme.html_theme_path()] # 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, From 11a88452394d6b6fe3325c4f7b0ccaa4bcb07c6a Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Wed, 27 Aug 2025 15:37:50 -0700 Subject: [PATCH 16/17] add python 3.10 version --- .github/workflows/dca_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dca_tests.yml b/.github/workflows/dca_tests.yml index 367b807..d7e6b7a 100644 --- a/.github/workflows/dca_tests.yml +++ b/.github/workflows/dca_tests.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9"] + python-version: ["3.8", "3.9", "3.10"] steps: - name: Test DCA uses: actions/checkout@v4 From f7a483010e5afc8349377f48bacea50900e3ac3f Mon Sep 17 00:00:00 2001 From: kailinzhuang Date: Wed, 27 Aug 2025 16:09:39 -0700 Subject: [PATCH 17/17] remove sphinx_rtd_theme dependency --- docs/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 70f6944..748d8f2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,7 +12,6 @@ # import os import sys -import sphinx_rtd_theme # Get the project root dir, which is the parent parent dir of this project_root = os.path.dirname(os.path.dirname(os.getcwd()))