Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 7, 2024
1 parent fe05c99 commit cb45113
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 49 deletions.
83 changes: 41 additions & 42 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,31 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
args:
- --extra-keys
- |
cell.attachments
cell.metadata.code_folding
cell.metadata.id
cell.metadata.pycharm
cell.metadata.user_expressions
metadata.celltoolbar
metadata.colab.name
metadata.colab.provenance
metadata.interpreter
metadata.notify_time
metadata.toc
metadata.toc-autonumbering
metadata.toc-showcode
metadata.toc-showmarkdowntxt
metadata.toc-showtags
metadata.varInspector
metadata.vscode
- repo: https://github.com/ComPWA/policy
rev: 0.2.3
hooks:
Expand Down Expand Up @@ -70,6 +95,22 @@ repos:
hooks:
- id: blacken-docs

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.9.0
hooks:
- id: taplo

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort
args:
- --in-place
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
Expand Down Expand Up @@ -109,36 +150,6 @@ repos:
types:
- python

- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
args:
- --extra-keys
- |
cell.attachments
cell.metadata.code_folding
cell.metadata.id
cell.metadata.pycharm
cell.metadata.user_expressions
metadata.celltoolbar
metadata.colab.name
metadata.colab.provenance
metadata.interpreter
metadata.notify_time
metadata.toc
metadata.toc-autonumbering
metadata.toc-showcode
metadata.toc-showmarkdowntxt
metadata.toc-showtags
metadata.varInspector
metadata.vscode
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/ComPWA/mirrors-pyright
rev: v1.1.350
hooks:
Expand All @@ -150,15 +161,3 @@ repos:
- id: ruff
args: [--fix]
types_or: [python, pyi, jupyter]

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.9.0
hooks:
- id: taplo

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort
args:
- --in-place
1 change: 1 addition & 0 deletions docs/usage/amplitude.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"outputs": [],
"source": [
"%config InlineBackend.figure_formats = ['svg']\n",
"\n",
"import sympy as sp\n",
"from IPython.display import Math\n",
"\n",
Expand Down
1 change: 1 addition & 0 deletions docs/usage/dynamics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"outputs": [],
"source": [
"%config InlineBackend.figure_formats = ['svg']\n",
"\n",
"import logging\n",
"import warnings\n",
"\n",
Expand Down
1 change: 1 addition & 0 deletions docs/usage/dynamics/analytic-continuation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"outputs": [],
"source": [
"%config InlineBackend.figure_formats = ['svg']\n",
"\n",
"import warnings\n",
"\n",
"import sympy as sp\n",
Expand Down
1 change: 1 addition & 0 deletions docs/usage/dynamics/custom.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"outputs": [],
"source": [
"%config InlineBackend.figure_formats = ['svg']\n",
"\n",
"from __future__ import annotations\n",
"\n",
"import graphviz\n",
Expand Down
1 change: 1 addition & 0 deletions docs/usage/interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@
"outputs": [],
"source": [
"%config InlineBackend.figure_formats = ['svg']\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import mpl_interactions.ipyplot as iplt\n",
"\n",
Expand Down
1 change: 1 addition & 0 deletions docs/usage/symplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
"outputs": [],
"source": [
"%config InlineBackend.figure_formats = ['svg']\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import mpl_interactions.ipyplot as iplt\n",
"import numpy as np\n",
Expand Down
6 changes: 3 additions & 3 deletions src/ampform/helicity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@


def _order_component_mapping(
mapping: Mapping[str, sp.Expr]
mapping: Mapping[str, sp.Expr],
) -> OrderedDict[str, sp.Expr]:
return collections.OrderedDict(
[(key, mapping[key]) for key in sorted(mapping, key=natural_sorting)]
)


def _order_symbol_mapping(
mapping: Mapping[sp.Symbol, sp.Expr]
mapping: Mapping[sp.Symbol, sp.Expr],
) -> OrderedDict[sp.Symbol, sp.Expr]:
return collections.OrderedDict([
(symbol, mapping[symbol])
Expand All @@ -93,7 +93,7 @@ def _order_symbol_mapping(


def _order_amplitudes(
mapping: Mapping[sp.Indexed, sp.Expr]
mapping: Mapping[sp.Indexed, sp.Expr],
) -> OrderedDict[sp.Indexed, sp.Expr]:
return collections.OrderedDict([
(key, mapping[key])
Expand Down
2 changes: 1 addition & 1 deletion tests/kinematics/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@pytest.fixture(scope="session")
def topology_and_momentum_symbols(
data_sample: dict[int, np.ndarray]
data_sample: dict[int, np.ndarray],
) -> tuple[Topology, FourMomenta]:
n = len(data_sample)
assert n == 4
Expand Down
2 changes: 1 addition & 1 deletion tests/kinematics/test_angles.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

@pytest.fixture(scope="session")
def helicity_angles(
topology_and_momentum_symbols: tuple[Topology, FourMomenta]
topology_and_momentum_symbols: tuple[Topology, FourMomenta],
) -> dict[sp.Symbol, sp.Expr]:
topology, momentum_symbols = topology_and_momentum_symbols
return compute_helicity_angles(momentum_symbols, topology)
Expand Down
2 changes: 1 addition & 1 deletion tests/kinematics/test_lorentz.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def test_numpycode(self, array_type, shape):


def test_compute_invariant_masses_names(
topology_and_momentum_symbols: tuple[Topology, FourMomenta]
topology_and_momentum_symbols: tuple[Topology, FourMomenta],
):
topology, momentum_symbols = topology_and_momentum_symbols
invariant_masses = compute_invariant_masses(momentum_symbols, topology)
Expand Down
2 changes: 1 addition & 1 deletion tests/symplot/test_symplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_len(self, slider_kwargs: SliderKwargs) -> None:
def test_repr(
self, repr_function: Callable[[Any], str], slider_kwargs: SliderKwargs
) -> None:
from_repr: SliderKwargs = eval(repr_function(slider_kwargs)) # noqa: S307
from_repr: SliderKwargs = eval(repr_function(slider_kwargs))
assert set(from_repr) == set(slider_kwargs)
for slider_name in slider_kwargs:
slider = slider_kwargs[slider_name]
Expand Down

0 comments on commit cb45113

Please sign in to comment.