From 6e942a9754e076f9253cdc4591757021253ab406 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 11 Oct 2024 22:48:59 -0400 Subject: [PATCH 01/11] Refactor: Ensure params are numpy arrays in nll_func --- .github/workflows/ci.yml | 43 ++++++++-------------------------------- .pre-commit-config.yaml | 10 +++++----- requirements_dev.txt | 1 - setup.cfg | 2 +- setup.py | 4 +++- 5 files changed, 17 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad3c939..0ae22e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,14 +27,16 @@ defaults: jobs: tests_graph: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} timeout-minutes: 150 strategy: - max-parallel: 4 + max-parallel: 16 fail-fast: False matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] - name: JIT compiled tests for Python ${{ matrix.python-version }} + os: [ ubuntu-latest, macos-latest, windows-latest ] + python-version: [ "3.9", "3.12" ] + jit: [ "0", "1" ] + name: Tests for Python ${{ matrix.python-version }} with JIT=${{ matrix.jit }} steps: - uses: actions/checkout@v4 - uses: mamba-org/setup-micromamba@v1 @@ -42,43 +44,14 @@ jobs: with: environment-name: test-env create-args: >- - python=${{ matrix.python-version }} pip + python=${{ matrix.python-version }} pip uv root - name: Install Python dependencies run: | which python python -V - python -m pip install uv python -m uv pip install -e ".[dev]" - name: Test with pytest run: | + ZFIT_DO_JIT=${{ matrix.jit }} coverage run --source=. --omit=".tox/*" --branch -m pytest . coverage report - - tests_eager: - runs-on: ubuntu-latest - timeout-minutes: 150 - strategy: - max-parallel: 4 - fail-fast: False - matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] - name: Eager mode tests for Python ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v4 - - uses: mamba-org/setup-micromamba@v1 - name: Set up Micromamba environment - with: - environment-name: test-env - create-args: >- - python=${{ matrix.python-version }} pip - - name: Install Python dependencies - run: | - which python - python -V - python -m pip install uv - python -m uv pip install -e ".[dev]" - - name: Test with pytest - run: | - ZFIT_DO_JIT=0 - coverage run --source=. --omit=".tox/*,*/test*," --branch -m pytest . - coverage report diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1199eef..e93f576 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,11 +20,11 @@ repos: - id: fix-byte-order-marker - id: check-ast - - repo: https://github.com/PyCQA/docformatter - rev: v1.7.5 - hooks: - - id: docformatter - args: [ -r, --in-place, --wrap-descriptions, '120', --wrap-summaries, '120', -- ] +# - repo: https://github.com/PyCQA/docformatter +# rev: v1.7.5 +# hooks: +# - id: docformatter +# args: [ -r, --in-place, --wrap-descriptions, '120', --wrap-summaries, '120', -- ] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index de82233..423bec5 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -24,6 +24,5 @@ sphinxcontrib-images sphinxcontrib-youtube>=1.0.0,<1.2.0 tox>=2.9.1 twine>=1.10.0 -twine watchdog>=0.8.3 wheel>=0.29.0 diff --git a/setup.cfg b/setup.cfg index 0959518..c58c207 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,7 +11,7 @@ maintainer_email = zfit@physik.uzh.ch license = BSD-3-Clause license_files = LICENSE classifiers = - Development Status :: 3 - Alpha + Development Status :: 4 - Beta Intended Audience :: Science/Research License :: OSI Approved :: BSD License Natural Language :: English diff --git a/setup.py b/setup.py index 25d9a02..4b8b209 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,9 @@ install_requires=requirements, long_description=readme, include_package_data=True, - packages=find_packages(include=["zfit_physics", "zfit_physics.models", "zfit_physics.unstable"]), + packages=find_packages( + include=["zfit_physics", "zfit_physics.models", "zfit_physics.unstable", "zfit_physics.pyhf"] + ), test_suite="tests", extras_require={"dev": dev_requirements}, use_scm_version=True, From 98ae0f825bf731e4e3239bb87096c558049a9bd8 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 11 Oct 2024 22:51:59 -0400 Subject: [PATCH 02/11] ci: fix uv1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ae22e9..cc514b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: run: | which python python -V - python -m uv pip install -e ".[dev]" + uv pip install -e ".[dev]" - name: Test with pytest run: | ZFIT_DO_JIT=${{ matrix.jit }} From 09689d76d39876e851355bde683e49db02a1bae9 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 11 Oct 2024 22:52:41 -0400 Subject: [PATCH 03/11] ci: fix uv1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc514b0..a902c26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: os: [ ubuntu-latest, macos-latest, windows-latest ] python-version: [ "3.9", "3.12" ] jit: [ "0", "1" ] - name: Tests for Python ${{ matrix.python-version }} with JIT=${{ matrix.jit }} + name: Tests on OS ${{ matrix.os }} with Python ${{ matrix.python-version }} and JIT ${{ matrix.jit }} steps: - uses: actions/checkout@v4 - uses: mamba-org/setup-micromamba@v1 From c622e925c13a7a980dc87659f05c7b5cad4746f6 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 11 Oct 2024 23:01:42 -0400 Subject: [PATCH 04/11] ci: fix uv1 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a902c26..9126acd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,8 +43,8 @@ jobs: name: Set up Micromamba environment with: environment-name: test-env - create-args: >- - python=${{ matrix.python-version }} pip uv root + create-args: >- # install ROOT only on non-windows + python=${{ matrix.python-version }} pip uv {{ "root" if matrix.os != "windows-latest" else "" }} - name: Install Python dependencies run: | which python From 23ff48dd6b5b7d0e6ab673d07cace1e63e068e00 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 11 Oct 2024 23:03:12 -0400 Subject: [PATCH 05/11] ci: fix uv1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9126acd..0ecd539 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: with: environment-name: test-env create-args: >- # install ROOT only on non-windows - python=${{ matrix.python-version }} pip uv {{ "root" if matrix.os != "windows-latest" else "" }} + python=${{ matrix.python-version }} pip uv ${{ matrix.os != 'windows-latest' && 'root' || '' }} - name: Install Python dependencies run: | which python From eb5a3fbf7d19930274384031c872c6c90e2764c5 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 11 Oct 2024 23:05:36 -0400 Subject: [PATCH 06/11] ci: fix uv1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ecd539..797ec6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: with: environment-name: test-env create-args: >- # install ROOT only on non-windows - python=${{ matrix.python-version }} pip uv ${{ matrix.os != 'windows-latest' && 'root' || '' }} + python=${{ matrix.python-version }} pip uv ${{ matrix.os != 'windows-latest' && 'root=6.30' || '' }} - name: Install Python dependencies run: | which python From bacd965ec09ffd30afd822fc1d699ec7b22fcad9 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 11 Oct 2024 23:12:21 -0400 Subject: [PATCH 07/11] ci: fix uv1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 797ec6f..44b740f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: with: environment-name: test-env create-args: >- # install ROOT only on non-windows - python=${{ matrix.python-version }} pip uv ${{ matrix.os != 'windows-latest' && 'root=6.30' || '' }} + python=${{ matrix.python-version }} pip uv ${{ matrix.os != 'windows-latest' && matrix.python-version != '3.12' && 'root=6.30' || '' }} - name: Install Python dependencies run: | which python From c5c6affc60d7584ee4de4dc8c590f584512cf5ca Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 11 Oct 2024 23:14:20 -0400 Subject: [PATCH 08/11] ci: fix uv1 --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4b8b209..0572597 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,13 @@ long_description=readme, include_package_data=True, packages=find_packages( - include=["zfit_physics", "zfit_physics.models", "zfit_physics.unstable", "zfit_physics.pyhf"] + include=[ + "zfit_physics", + "zfit_physics.models", + "zfit_physics.unstable", + "zfit_physics.pyhf", + "zfit_physics.roofit", + ] ), test_suite="tests", extras_require={"dev": dev_requirements}, From 642dc65c729f729194b4942b937f5eae0332fce9 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 11 Oct 2024 23:18:27 -0400 Subject: [PATCH 09/11] ci: fix uv1 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44b740f..acb3f71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,7 @@ jobs: which python python -V uv pip install -e ".[dev]" + uv pip install zfit@https://github.com/zfit/zfit - name: Test with pytest run: | ZFIT_DO_JIT=${{ matrix.jit }} From e2624fea9d4bcfe4f3370d19a380e817d2c84e87 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 11 Oct 2024 23:45:28 -0400 Subject: [PATCH 10/11] ci: fix uv1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acb3f71..541b3b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: which python python -V uv pip install -e ".[dev]" - uv pip install zfit@https://github.com/zfit/zfit + uv pip install zfit@git+https://github.com/zfit/zfit - name: Test with pytest run: | ZFIT_DO_JIT=${{ matrix.jit }} From 9842d297c4693dbbf6a88ceed59cb7b80232ed67 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Sat, 12 Oct 2024 13:50:57 -0400 Subject: [PATCH 11/11] ci: fix uv1 --- .github/workflows/ci.yml | 2 +- zfit_physics/models/pdf_argus.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 541b3b4..ec87330 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: name: Set up Micromamba environment with: environment-name: test-env - create-args: >- # install ROOT only on non-windows + create-args: >- # install ROOT only on non-windows. ROOT > 6.30 fails currently, and 6.30 is not available for 3.12 python=${{ matrix.python-version }} pip uv ${{ matrix.os != 'windows-latest' && matrix.python-version != '3.12' && 'root=6.30' || '' }} - name: Install Python dependencies run: | diff --git a/zfit_physics/models/pdf_argus.py b/zfit_physics/models/pdf_argus.py index 827b79d..f08516a 100644 --- a/zfit_physics/models/pdf_argus.py +++ b/zfit_physics/models/pdf_argus.py @@ -49,9 +49,9 @@ class Argus(zfit.pdf.BasePDF): def __init__( self, *, - m0, - c, - p, + m0: ztyping.ParamTypeInput, + c: ztyping.ParamTypeInput, + p: ztyping.ParamTypeInput, obs: ztyping.ObsTypeInput, extended: ztyping.ParamTypeInput | None = None, norm: ztyping.NormTypeInput = None,