Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
uv sync --all-extras --quiet
source .venv/bin/activate
layout uv --all-extras --quiet
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ComPWA/maintainers
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: 2

multi-ecosystem-groups:
lock:
assignees: [redeboer]
commit-message: { prefix: MAINT }
schedule: { interval: quarterly }

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: Run pytest-benchmark
run: uvx --from poethepoet poe benchmark
- name: Warn on performance decrease
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ on:
jobs:
milestone:
if: startsWith(github.ref, 'refs/tags')
uses: ComPWA/actions/.github/workflows/close-milestone.yml@313866498eb92c341d7e6b905e09f33a5979dffb # v4.1.4
uses: ComPWA/actions/.github/workflows/close-milestone.yml@a024afbb9e182bea4924a73fc60ae59462849ebb # v4.2.0
package-name:
uses: ComPWA/actions/.github/workflows/get-pypi-name.yml@313866498eb92c341d7e6b905e09f33a5979dffb # v4.1.4
uses: ComPWA/actions/.github/workflows/get-pypi-name.yml@a024afbb9e182bea4924a73fc60ae59462849ebb # v4.2.0
pypi:
environment:
name: PyPI
Expand All @@ -24,10 +24,10 @@ jobs:
id-token: write
runs-on: ubuntu-24.04
steps:
- uses: ComPWA/actions/build-pypi-distribution@313866498eb92c341d7e6b905e09f33a5979dffb # v4.1.4
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
- uses: ComPWA/actions/build-pypi-distribution@a024afbb9e182bea4924a73fc60ae59462849ebb # v4.2.0
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
push:
if: startsWith(github.ref, 'refs/tags') && !github.event.release.prerelease
permissions:
contents: write
uses: ComPWA/actions/.github/workflows/push-to-version-branches.yml@313866498eb92c341d7e6b905e09f33a5979dffb # v4.1.4
uses: ComPWA/actions/.github/workflows/push-to-version-branches.yml@a024afbb9e182bea4924a73fc60ae59462849ebb # v4.2.0
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
doc:
uses: ComPWA/actions/.github/workflows/ci-docs.yml@313866498eb92c341d7e6b905e09f33a5979dffb # v4.1.4
uses: ComPWA/actions/.github/workflows/ci-docs.yml@a024afbb9e182bea4924a73fc60ae59462849ebb # v4.2.0
permissions:
pages: write
id-token: write
Expand All @@ -30,13 +30,11 @@ jobs:
style:
secrets:
token: ${{ secrets.PAT }}
uses: ComPWA/actions/.github/workflows/style.yml@313866498eb92c341d7e6b905e09f33a5979dffb # v4.1.4
uses: ComPWA/actions/.github/workflows/style.yml@a024afbb9e182bea4924a73fc60ae59462849ebb # v4.2.0
with:
python-version: "3.13"
test:
uses: ComPWA/actions/.github/workflows/test.yml@313866498eb92c341d7e6b905e09f33a5979dffb # v4.1.4
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
uses: ComPWA/actions/.github/workflows/test.yml@a024afbb9e182bea4924a73fc60ae59462849ebb # v4.2.0
with:
coverage-python-version: "3.13"
macos-python-version: "3.11"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clean-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Remove caches
runs-on: ubuntu-slim
steps:
- uses: ComPWA/actions/clean-caches@313866498eb92c341d7e6b905e09f33a5979dffb # v4.1.4
- uses: ComPWA/actions/clean-caches@a024afbb9e182bea4924a73fc60ae59462849ebb # v4.2.0
with:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.ref }}
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ on:

jobs:
lock:
uses: ComPWA/actions/.github/workflows/lock.yml@313866498eb92c341d7e6b905e09f33a5979dffb # v4.1.4
uses: ComPWA/actions/.github/workflows/lock.yml@a024afbb9e182bea4924a73fc60ae59462849ebb # v4.2.0
secrets:
token: ${{ secrets.PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:

jobs:
lint-pr:
uses: ComPWA/actions/.github/workflows/pr-linting.yml@313866498eb92c341d7e6b905e09f33a5979dffb # v4.1.4
uses: ComPWA/actions/.github/workflows/pr-linting.yml@a024afbb9e182bea4924a73fc60ae59462849ebb # v4.2.0
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ version.py
.coverage.*
.ipynb_checkpoints/
.jupyter_ystore.db
.lycheecache
.pytest_cache/
.virtual_documents/
__pycache__/
Expand Down Expand Up @@ -52,5 +53,4 @@ CLAUDE.md
!.pre-commit-config.yaml
!.readthedocs.yml
!.vscode/*.json
!.zenodo.json
!codecov.yml
25 changes: 15 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.10.1
rev: 0.10.5
hooks:
- id: check-dev-files
# Policy 0.10.4 imports TyperChoice from typer.main.
additional_dependencies: ["typer<0.29"]

- repo: https://github.com/kynan/nbstripout
rev: 0.9.1
Expand Down Expand Up @@ -60,13 +62,11 @@ repos:
- id: strip-nb-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.0
rev: v0.17.4
hooks:
- id: ruff-check
args: [--fix]
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
Expand Down Expand Up @@ -96,19 +96,19 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/tombi-toml/tombi-pre-commit
rev: v1.8.2
rev: v1.11.1
hooks:
- id: tombi-format
- id: tombi-lint
args: [--error-on-warnings]

- repo: https://github.com/ComPWA/prettier-pre-commit
rev: v3.8.1
rev: v3.9.10
hooks:
- id: prettier

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.38.2
rev: 0.39.0
hooks:
- id: check-jsonschema
name: Check CITATION.cff
Expand All @@ -121,10 +121,15 @@ repos:
pass_filenames: false

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v10.3.0
rev: v10.4.0
hooks:
- id: cspell

- repo: https://github.com/LilSpazJoekp/docstrfmt
rev: v2.2.1
hooks:
- id: docstrfmt

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 3.11.1
hooks:
Expand All @@ -137,12 +142,12 @@ repos:
)$

- repo: https://github.com/astral-sh/ty-pre-commit
rev: v0.0.86
rev: v0.0.100
hooks:
- id: ty
args: [--group=types, --no-default-groups]

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.13.0
rev: 0.13.7
hooks:
- id: uv-lock
20 changes: 9 additions & 11 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ build:
os: ubuntu-24.04
tools:
python: "3.13"
commands:
- |-
export PIXI_HOME=$READTHEDOCS_VIRTUALENV_PATH
curl -fsSL https://pixi.sh/install.sh | bash
pixi global install graphviz uv
- |-
export UV_LINK_MODE=copy
uvx --from poethepoet poe doc
mkdir -p $READTHEDOCS_OUTPUT
mv docs/_build/html $READTHEDOCS_OUTPUT

apt_packages:
- graphviz
sphinx:
configuration: docs/conf.py
fail_on_warning: true
python:
install:
- method: uv
command: sync
groups:
- doc
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-vscode.live-server",
"ms-vsliveshare.vsliveshare",
"redhat.vscode-yaml",
"soulcode.vscode-unwanted-extensions",
"stkb.rewrap",
Expand Down
18 changes: 3 additions & 15 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
"rewrap.wrappingColumn": 72
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.wordWrap": "on"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"[json][jsonc][markdown][yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[python]": {
Expand All @@ -26,9 +22,6 @@
"[toml]": {
"editor.defaultFormatter": "tombi-toml.tombi"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.enabled": true,
"diffEditor.experimental.showMoves": true,
"editor.formatOnSave": true,
Expand All @@ -43,11 +36,10 @@
},
{
"fileMatch": [".zenodo.json"],
"url": "https://zenodo.org/schemas/deposits/records/legacyrecord.json"
"url": "https://raw.githubusercontent.com/zenodo/zenodo/master/zenodo/modules/deposit/jsonschemas/deposits/records/legacyrecord.json"
}
],
"livePreview.defaultPreviewPath": "docs/_build/html",
"multiDiffEditor.experimental.enabled": true,
"notebook.codeActionsOnSave": {
"notebook.source.organizeImports": "explicit"
},
Expand All @@ -72,9 +64,5 @@
"testing.showCoverageInExplorer": true,
"ty.completions.autoImport": false,
"ty.diagnosticMode": "workspace",
"ty.importStrategy": "fromEnvironment",
"yaml.schemas": {
"https://citation-file-format.github.io/1.2.0/schema.json": "CITATION.cff",
"https://json.schemastore.org/github-workflow.json": "./.github/workflows/requirements.yml"
}
"ty.importStrategy": "fromEnvironment"
}
21 changes: 11 additions & 10 deletions benchmarks/ampform.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ def fit(
return optimizer.optimize(estimator, initial_parameters)


@pytest.fixture(scope="session")
def model() -> HelicityModel:
return formulate_amplitude_model(
formalism="canonical-helicity",
initial_state=("J/psi(1S)", [-1, +1]),
final_state=["gamma", "pi0", "pi0"],
intermediate_states=["f(0)(500)", "f(0)(980)"],
interaction_types=["EM", "strong"],
)


class TestJPsiToGammaPiPi:
expected_data = {
"p0": [
Expand All @@ -148,16 +159,6 @@ class TestJPsiToGammaPiPi:
],
}

@pytest.fixture(scope="session")
def model(self) -> HelicityModel:
return formulate_amplitude_model(
formalism="canonical-helicity",
initial_state=("J/psi(1S)", [-1, +1]),
final_state=["gamma", "pi0", "pi0"],
intermediate_states=["f(0)(500)", "f(0)(980)"],
interaction_types=["EM", "strong"],
)

@pytest.mark.benchmark(group="data", min_rounds=1)
@pytest.mark.parametrize("backend", ["jax", "numpy", "tf"])
@pytest.mark.parametrize("size", [10_000])
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _create_data(backend: Backend):

return {"x": jnp.linspace(0, 10, num=1_000_000).block_until_ready()}

import tensorflow.experimental.numpy as tnp # ty: ignore[unresolved-import]
import tensorflow.experimental.numpy as tnp # ty: ignore[import-not-found]

return {"x": tnp.linspace(0, 10, num=1_000_000)}

Expand All @@ -64,6 +64,6 @@ def _assert_precision(

assert jax.config.x64_enabled == (precision == "float64")
else:
import tensorflow.experimental.numpy as tnp # ty: ignore[unresolved-import]
import tensorflow.experimental.numpy as tnp # ty: ignore[import-not-found]

assert tnp.asarray(1.0).dtype.name == precision
10 changes: 5 additions & 5 deletions benchmarks/unbinned_nll.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numpy as np
import pytest
import tensorflow as tf
import tensorflow.experimental.numpy as tnp # ty: ignore[unresolved-import]
import tensorflow.experimental.numpy as tnp # ty: ignore[import-not-found]

from tensorwaves import configure
from tensorwaves.estimator import UnbinnedNLL
Expand Down Expand Up @@ -296,10 +296,10 @@ def _benchmark_estimator_jax(
parameters: dict[str, float],
) -> jax.Array:
estimator = _create_estimator("jax", data, phsp)
estimator(parameters).block_until_ready() # ty: ignore[unresolved-attribute]
estimator(parameters).block_until_ready() # ty: ignore[missing-attribute]

def run() -> jax.Array:
return estimator(parameters).block_until_ready() # ty: ignore[unresolved-attribute]
return estimator(parameters).block_until_ready() # ty: ignore[missing-attribute]

return benchmark(run)

Expand All @@ -311,10 +311,10 @@ def _benchmark_estimator_tensorflow(
parameters: dict[str, float],
) -> np.ndarray:
estimator = _create_estimator("tensorflow", data, phsp)
estimator(parameters).numpy() # ty: ignore[unresolved-attribute]
estimator(parameters).numpy() # ty: ignore[missing-attribute]

def run() -> np.ndarray:
return estimator(parameters).numpy() # ty: ignore[unresolved-attribute]
return estimator(parameters).numpy() # ty: ignore[missing-attribute]

return benchmark(run)

Expand Down
2 changes: 0 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ coverage:
status:
project:
default:
target: 85%
threshold: 3%
base: auto
if_no_uploads: error
if_not_found: success
Expand Down
Loading
Loading