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 Jul 4, 2023
1 parent d30e82f commit bd47974
Show file tree
Hide file tree
Showing 28 changed files with 224 additions and 252 deletions.
3 changes: 0 additions & 3 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@
"*particle*.*ml",
".constraints/*.txt",
".editorconfig",
".flake8*",
".gitignore",
".gitpod.*",
".mypy.ini",
".pre-commit-config.yaml",
".prettierignore",
".pydocstyle*",
".pylintrc",
".readthedocs.yml",
".vscode/*",
".vscode/.gitignore",
Expand Down
33 changes: 0 additions & 33 deletions .flake8

This file was deleted.

2 changes: 2 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ github:

vscode:
extensions:
- charliermarsh.ruff
- christian-kohler.path-intellisense
- eamodio.gitlens
- editorconfig.editorconfig
- esbenp.prettier-vscode
- executablebookproject.myst-highlight
- garaioag.garaio-vscode-unwanted-recommendations
- github.vscode-github-actions
- github.vscode-pull-request-github
- julialang.language-julia
Expand Down
20 changes: 11 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ repos:
- id: nbqa-black
additional_dependencies:
- black>=22.1.0
- id: nbqa-flake8
additional_dependencies:
- flake8-future-annotations
- id: nbqa-isort
- id: nbqa-pyupgrade
args:
- --py37-plus

- id: nbqa-ruff
args:
- --fix

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
Expand Down Expand Up @@ -99,11 +99,6 @@ repos:
docs/_static/favicon.ico
)$
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
Expand Down Expand Up @@ -145,6 +140,13 @@ repos:
args:
- --py37-plus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: ""
hooks:
- id: ruff
args:
- --fix

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.0
hooks:
Expand Down
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"recommendations": [
"charliermarsh.ruff",
"christian-kohler.path-intellisense",
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"executablebookproject.myst-highlight",
"garaioag.garaio-vscode-unwanted-recommendations",
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"julialang.language-julia",
Expand All @@ -19,5 +21,12 @@
"tamasfe.even-better-toml",
"tyriar.sort-lines",
"yzhang.markdown-all-in-one"
],
"unwantedRecommendations": [
"bungcip.better-toml",
"ms-python.flake8",
"ms-python.isort",
"ms-python.pylint",
"travisillig.vscode-json-stable-stringify"
]
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
],
"livePreview.defaultPreviewPath": "docs/_build/html",
"python.analysis.autoImportCompletions": false,
"python.analysis.diagnosticMode": "workspace",
"python.analysis.typeCheckingMode": "strict",
"python.formatting.provider": "black",
"python.linting.banditEnabled": false,
Expand All @@ -52,6 +51,8 @@
"python.linting.pylintEnabled": false,
"python.testing.pytestEnabled": false,
"rewrap.wrappingColumn": 88,
"ruff.enable": true,
"ruff.organizeImports": true,
"search.exclude": {
"**/tests/**/__init__.py": true,
"*/.pydocstyle": true,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ComPWA Organization Documentation

[![Ruff](https://img.shields.io/endpoint?url=https://github.com/raw/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![10.5281/zenodo.6908149](https://zenodo.org/badge/DOI/10.5281/zenodo.6908149.svg)](https://doi.org/10.5281/zenodo.6908149)
[![GPLv3+ license](https://img.shields.io/badge/License-GPLv3+-blue.svg)](https://www.gnu.org/licenses/gpl-3.0-standalone.html)

Expand All @@ -12,7 +13,6 @@
[![Spelling checked](https://img.shields.io/badge/cspell-checked-brightgreen.svg)](https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort)

This repository contains the source code for the
[compwa-org.rtfd.io](https://compwa-org.readthedocs.io) pages.
Expand Down
8 changes: 2 additions & 6 deletions docs/adr/002/composition.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,8 @@
"\n",
"import sympy as sp\n",
"from attrs import frozen\n",
"from helpers import (\n",
" StateTransitionGraph,\n",
" blatt_weisskopf,\n",
" determine_attached_final_state,\n",
" two_body_momentum_squared,\n",
")\n",
"from helpers import (StateTransitionGraph, blatt_weisskopf,\n",
" determine_attached_final_state, two_body_momentum_squared)\n",
"\n",
"try:\n",
" from typing import Protocol\n",
Expand Down
8 changes: 2 additions & 6 deletions docs/adr/002/expr.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@
"from typing import Callable\n",
"\n",
"import sympy as sp\n",
"from helpers import (\n",
" StateTransitionGraph,\n",
" blatt_weisskopf,\n",
" determine_attached_final_state,\n",
" two_body_momentum_squared,\n",
")"
"from helpers import (StateTransitionGraph, blatt_weisskopf,\n",
" determine_attached_final_state, two_body_momentum_squared)"
]
},
{
Expand Down
8 changes: 2 additions & 6 deletions docs/adr/002/function.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,8 @@
"from abc import abstractmethod\n",
"\n",
"import sympy as sp\n",
"from helpers import (\n",
" StateTransitionGraph,\n",
" blatt_weisskopf,\n",
" determine_attached_final_state,\n",
" two_body_momentum_squared,\n",
")"
"from helpers import (StateTransitionGraph, blatt_weisskopf,\n",
" determine_attached_final_state, two_body_momentum_squared)"
]
},
{
Expand Down
16 changes: 4 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,16 @@
from functools import lru_cache

import requests

# pyright: reportMissingImports=false
# pyright: reportMissingTypeStubs=false
from pybtex.database import Entry
from pybtex.plugin import register_plugin
from pybtex.richtext import Tag, Text
from pybtex.style.formatting.unsrt import Style as UnsrtStyle
from pybtex.style.template import _format_list # pyright: ignore[reportPrivateUsage]
from pybtex.style.template import (
FieldIsMissing,
Node,
field,
href,
join,
node,
sentence,
words,
)
from pybtex.style.template import \
_format_list # pyright: ignore[reportPrivateUsage]
from pybtex.style.template import (FieldIsMissing, Node, field, href, join,
node, sentence, words)

# -- Project information -----------------------------------------------------
project = "ComPWA Organization"
Expand Down
10 changes: 3 additions & 7 deletions docs/report/003.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,9 @@
"import quadpy\n",
"import symplot\n",
"import sympy as sp\n",
"from ampform.dynamics import (\n",
" BlattWeisskopfSquared,\n",
" BreakupMomentumSquared,\n",
" ComplexSqrt,\n",
" PhaseSpaceFactor,\n",
" PhaseSpaceFactorComplex,\n",
")\n",
"from ampform.dynamics import (BlattWeisskopfSquared, BreakupMomentumSquared,\n",
" ComplexSqrt, PhaseSpaceFactor,\n",
" PhaseSpaceFactorComplex)\n",
"from IPython.display import Math\n",
"\n",
"warnings.filterwarnings(\"ignore\")\n",
Expand Down
3 changes: 2 additions & 1 deletion docs/report/004.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import sympy as sp\n",
"from ampform.dynamics import PhaseSpaceFactor, relativistic_breit_wigner_with_ff\n",
"from ampform.dynamics import (PhaseSpaceFactor,\n",
" relativistic_breit_wigner_with_ff)\n",
"from IPython.display import Math\n",
"from ipywidgets import widgets\n",
"from matplotlib import cm\n",
Expand Down
8 changes: 3 additions & 5 deletions docs/report/009.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,9 @@
"import symplot\n",
"import sympy as sp\n",
"from ampform.dynamics import coupled_width, phase_space_factor_complex\n",
"from ampform.dynamics.decorator import (\n",
" UnevaluatedExpression,\n",
" create_expression,\n",
" implement_doit_method,\n",
")\n",
"from ampform.dynamics.decorator import (UnevaluatedExpression,\n",
" create_expression,\n",
" implement_doit_method)\n",
"from IPython.display import Math\n",
"from ipywidgets import widgets as ipywidgets\n",
"from matplotlib import cm\n",
Expand Down
16 changes: 5 additions & 11 deletions docs/report/010.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,11 @@
"import numpy as np\n",
"import symplot\n",
"import sympy as sp\n",
"from ampform.dynamics import (\n",
" BlattWeisskopfSquared,\n",
" breakup_momentum_squared,\n",
" coupled_width,\n",
" phase_space_factor_complex,\n",
")\n",
"from ampform.dynamics.decorator import (\n",
" UnevaluatedExpression,\n",
" create_expression,\n",
" implement_doit_method,\n",
")\n",
"from ampform.dynamics import (BlattWeisskopfSquared, breakup_momentum_squared,\n",
" coupled_width, phase_space_factor_complex)\n",
"from ampform.dynamics.decorator import (UnevaluatedExpression,\n",
" create_expression,\n",
" implement_doit_method)\n",
"from ipywidgets import widgets as ipywidgets\n",
"from matplotlib import cm\n",
"from mpl_interactions.controller import Controls\n",
Expand Down
20 changes: 9 additions & 11 deletions docs/report/011.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,17 @@
"import qrules\n",
"import sympy as sp\n",
"from ampform.data import EventCollection\n",
"from ampform.kinematics import (\n",
" _compute_helicity_angles,\n",
" determine_attached_final_state,\n",
" get_helicity_angle_label,\n",
")\n",
"from ampform.sympy import (\n",
" UnevaluatedExpression,\n",
" create_expression,\n",
" implement_doit_method,\n",
")\n",
"from ampform.kinematics import (_compute_helicity_angles,\n",
" determine_attached_final_state,\n",
" get_helicity_angle_label)\n",
"from ampform.sympy import (UnevaluatedExpression, create_expression,\n",
" implement_doit_method)\n",
"from IPython.display import Math\n",
"from qrules.topology import Topology, create_isobar_topologies\n",
"from sympy.printing.numpy import NumPyPrinter\n",
"from sympy.printing.printer import Printer\n",
"from sympy.tensor.array.expressions.array_expressions import ArraySlice, ArraySymbol"
"from sympy.tensor.array.expressions.array_expressions import (ArraySlice,\n",
" ArraySymbol)"
]
},
{
Expand Down Expand Up @@ -493,6 +489,8 @@
"outputs": [],
"source": [
"# small helper function\n",
"\n",
"\n",
"def print_lambdify(symbols, expr):\n",
" np_expr = sp.lambdify(symbols, expr)\n",
" src = inspect.getsource(np_expr)\n",
Expand Down
15 changes: 5 additions & 10 deletions docs/report/012.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,11 @@
"import ampform\n",
"import numpy as np\n",
"import qrules\n",
"from ampform.dynamics.builder import (\n",
" create_non_dynamic_with_ff,\n",
" create_relativistic_breit_wigner_with_ff,\n",
")\n",
"from tensorwaves.data import (\n",
" IntensityDistributionGenerator,\n",
" SympyDataTransformer,\n",
" TFPhaseSpaceGenerator,\n",
" TFUniformRealNumberGenerator,\n",
")\n",
"from ampform.dynamics.builder import (create_non_dynamic_with_ff,\n",
" create_relativistic_breit_wigner_with_ff)\n",
"from tensorwaves.data import (IntensityDistributionGenerator,\n",
" SympyDataTransformer, TFPhaseSpaceGenerator,\n",
" TFUniformRealNumberGenerator)\n",
"from tensorwaves.function.sympy import create_parametrized_function\n",
"\n",
"LOGGER = logging.getLogger(\"absl\")\n",
Expand Down
3 changes: 2 additions & 1 deletion docs/report/013.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@
},
"outputs": [],
"source": [
"from tensorwaves.data import TFPhaseSpaceGenerator, TFUniformRealNumberGenerator\n",
"from tensorwaves.data import (TFPhaseSpaceGenerator,\n",
" TFUniformRealNumberGenerator)\n",
"\n",
"phsp_generator = TFPhaseSpaceGenerator(\n",
" initial_state_mass=PDG[\"Lambda(c)+\"].mass,\n",
Expand Down
Loading

0 comments on commit bd47974

Please sign in to comment.