From df555e494c7f13c16c8a19b21762c74ab8ca138c Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 20:43:39 -0700 Subject: [PATCH 01/12] feat: coverage config in pyproject --- .coveragerc | 12 ------------ pyproject.toml | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 13 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 6c06118..0000000 --- a/.coveragerc +++ /dev/null @@ -1,12 +0,0 @@ -[run] -include = - ./ConditionalGMM/* -omit = - *tests* - *__init__* -[report] -show_missing = True -exclude_lines = - pragma: no cover - if __name__ == .__main__.: - @tf.function \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fd9d85a..46ecce3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,10 +22,24 @@ dependencies = [ [project.optional-dependencies] test = [ "pytest", - "coverage", + "coverage[toml]", ] [project.urls] Homepage = "https://github.com/tmcclintock/ConditionalGMM" Issues = "https://github.com/tmcclintock/ConditionalGMM/issues" +[tool.coverage.run] +include = ["./ConditionalGMM/*"] +omit = [ + "*tests*", + "*__init__*" +] + +[tool.coverage.report] +show_missing = true +exclude_lines = [ + "pragma: no cover", + "if __name__ == .__main__.:", + "@tf.function" +] From 509937df8ea6b6f586d39024859aa496925f9897 Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 20:45:15 -0700 Subject: [PATCH 02/12] fix: no more travis file --- .travis.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c887b6b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: python -python: - - '3.7' - - '3.6' - - '2.7' -#Install dependencies -install: - - pip install -r requirements.txt - - pip install pytest-cov - - pip install coveralls - - python setup.py install -#Run the tests -script: - - coverage run -m pytest - - coverage report -m -after_success: - - coveralls \ No newline at end of file From 8618c47e08ac1989f32399fd5df496a2290d82a7 Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 20:46:14 -0700 Subject: [PATCH 03/12] fix: no more travis or coveralls references --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a165dbc..e75a591 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ConditionalGMM [![Build Status](https://travis-ci.com/tmcclintock/ConditionalGMM.svg?branch=master)](https://travis-ci.com/tmcclintock/ConditionalGMM) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Coverage Status](https://coveralls.io/repos/github/tmcclintock/ConditionalGMM/badge.svg?branch=master&service=github)](https://coveralls.io/github/tmcclintock/CondigionalGMM?branch=master&service=github) +# ConditionalGMM [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) This repository contains helpful functions for computing conditional distributions of multivariate normal distributions and Gaussian mixture models (GMMs). It is able to return not only the conditional means (expectation values) but also the conditional covariances and conditional component weights (probabilities). From f97a27a3af610aa373b875fde90ec2f0fc3a20b9 Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 20:47:06 -0700 Subject: [PATCH 04/12] fix: no more git attributes file --- .gitattributes | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 201e650..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -notebooks/*.ipynb linguist-documentation \ No newline at end of file From 5a9ea5ea236cb4b814eec3fa1dc485b960fb7629 Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 21:08:37 -0700 Subject: [PATCH 05/12] feat: pytest CI --- .github/workflows/ci.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..fa4ff79 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,29 @@ +name: Continuous Integration + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + + steps: + - uses: actions/checkout@v4 + + - name: Install uv and set the python version + uses: astral-sh/setup-uv@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install the project + run: uv sync --locked --all-extras --dev + + - name: Run tests with coverage + run: uv run pytest tests + + # TODO: figure out how to use this + # - name: Produce coverage report + # run: uv run coverage report -m \ No newline at end of file From 593429cd57a77792590849a5d531e1e18cccd982 Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 21:10:28 -0700 Subject: [PATCH 06/12] fix: create the lock file in CI --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fa4ff79..e68539f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install the project - run: uv sync --locked --all-extras --dev + run: uv lock - name: Run tests with coverage run: uv run pytest tests From 955a13a9323887390e1aae8c478f6312748d03ed Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 21:13:51 -0700 Subject: [PATCH 07/12] fix: install --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e68539f..016da73 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install the project - run: uv lock + run: uv pip install -r pyproject.toml - name: Run tests with coverage run: uv run pytest tests From ce3b39165b47ac467d69b9a04cb92319a2f08f34 Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 21:14:47 -0700 Subject: [PATCH 08/12] fix: all extras --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 016da73..0a5c349 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install the project - run: uv pip install -r pyproject.toml + run: uv pip install -r pyproject.toml --all-extras - name: Run tests with coverage run: uv run pytest tests From 2dc3390b3bc37d15d677078f0d11e41a1b00621e Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 21:21:16 -0700 Subject: [PATCH 09/12] fix: run --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0a5c349..e92eda9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install the project - run: uv pip install -r pyproject.toml --all-extras + run: uv run pip install -r pyproject.toml --all-extras - name: Run tests with coverage run: uv run pytest tests From 1fde27d078245aaf316a8c06c689b4d032a04407 Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 21:22:09 -0700 Subject: [PATCH 10/12] fix: pip install --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e92eda9..0a5c349 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install the project - run: uv run pip install -r pyproject.toml --all-extras + run: uv pip install -r pyproject.toml --all-extras - name: Run tests with coverage run: uv run pytest tests From 94d40fdb16edb802b3fab721bf659b523af327a7 Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 21:29:21 -0700 Subject: [PATCH 11/12] fix: more classifiers --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 46ecce3..0a1a674 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,11 @@ readme = "README.md" requires-python = ">=3.9" classifiers = [ "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", ] license = "MIT" From 94f981e7f819109b84cf976df32837bc21f66621 Mon Sep 17 00:00:00 2001 From: tmcclintock Date: Fri, 9 May 2025 21:41:45 -0700 Subject: [PATCH 12/12] fix: src-layout and build system --- pyproject.toml | 4 ++++ {ConditionalGMM => src/ConditionalGMM}/MNorm.py | 0 {ConditionalGMM => src/ConditionalGMM}/UnivariateGMM.py | 0 {ConditionalGMM => src/ConditionalGMM}/__init__.py | 0 {ConditionalGMM => src/ConditionalGMM}/condGMM.py | 0 5 files changed, 4 insertions(+) rename {ConditionalGMM => src/ConditionalGMM}/MNorm.py (100%) rename {ConditionalGMM => src/ConditionalGMM}/UnivariateGMM.py (100%) rename {ConditionalGMM => src/ConditionalGMM}/__init__.py (100%) rename {ConditionalGMM => src/ConditionalGMM}/condGMM.py (100%) diff --git a/pyproject.toml b/pyproject.toml index 0a1a674..6123d37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,10 @@ test = [ "coverage[toml]", ] +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + [project.urls] Homepage = "https://github.com/tmcclintock/ConditionalGMM" Issues = "https://github.com/tmcclintock/ConditionalGMM/issues" diff --git a/ConditionalGMM/MNorm.py b/src/ConditionalGMM/MNorm.py similarity index 100% rename from ConditionalGMM/MNorm.py rename to src/ConditionalGMM/MNorm.py diff --git a/ConditionalGMM/UnivariateGMM.py b/src/ConditionalGMM/UnivariateGMM.py similarity index 100% rename from ConditionalGMM/UnivariateGMM.py rename to src/ConditionalGMM/UnivariateGMM.py diff --git a/ConditionalGMM/__init__.py b/src/ConditionalGMM/__init__.py similarity index 100% rename from ConditionalGMM/__init__.py rename to src/ConditionalGMM/__init__.py diff --git a/ConditionalGMM/condGMM.py b/src/ConditionalGMM/condGMM.py similarity index 100% rename from ConditionalGMM/condGMM.py rename to src/ConditionalGMM/condGMM.py