Skip to content

Commit

Permalink
DX: allow C408 error
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Jul 6, 2023
1 parent 58127d6 commit 9f82a73
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 16 deletions.
6 changes: 3 additions & 3 deletions docs/comparison/d2kkk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@
"source": [
"def create_sliders() -> dict[str, ToggleButtons]:\n",
" all_parameters = dict(ampform_model.parameter_defaults.items())\n",
" all_parameters.update(dpd_model.parameter_defaults.items())\n",
" all_parameters.update(dpd_model.parameter_defaults)\n",
" sliders = {}\n",
" for symbol, value in all_parameters.items():\n",
" value = \"+1\"\n",
Expand Down Expand Up @@ -899,8 +899,8 @@
" )\n",
"\n",
" global lines\n",
" amp_kwargs = {\"color\": \"r\", \"label\": \"ampform\", \"linestyle\": \"solid\"}\n",
" dpd_kwargs = {\"color\": \"blue\", \"label\": \"dpd\", \"linestyle\": \"dotted\"}\n",
" amp_kwargs = dict(color=\"r\", label=\"ampform\", linestyle=\"solid\")\n",
" dpd_kwargs = dict(color=\"blue\", label=\"dpd\", linestyle=\"dotted\")\n",
" if lines is None:\n",
" sx = (s_edges[:-1] + s_edges[1:]) / 2\n",
" tx = (t_edges[:-1] + t_edges[1:]) / 2\n",
Expand Down
6 changes: 3 additions & 3 deletions docs/comparison/jpsi2phipipi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@
"source": [
"def create_sliders() -> dict[str, ToggleButtons]:\n",
" all_parameters = dict(ampform_model.parameter_defaults.items())\n",
" all_parameters.update(dpd_model.parameter_defaults.items())\n",
" all_parameters.update(dpd_model.parameter_defaults)\n",
" sliders = {}\n",
" for symbol, value in all_parameters.items():\n",
" value = \"+1\"\n",
Expand Down Expand Up @@ -883,8 +883,8 @@
" )\n",
"\n",
" global lines\n",
" amp_kwargs = {\"color\": \"r\", \"label\": \"ampform\", \"linestyle\": \"solid\"}\n",
" dpd_kwargs = {\"color\": \"blue\", \"label\": \"dpd\", \"linestyle\": \"dotted\"}\n",
" amp_kwargs = dict(color=\"r\", label=\"ampform\", linestyle=\"solid\")\n",
" dpd_kwargs = dict(color=\"blue\", label=\"dpd\", linestyle=\"dotted\")\n",
" if lines is None:\n",
" sx1 = (s1_edges[:-1] + s1_edges[1:]) / 2\n",
" sx23 = (s23_edges[:-1] + s23_edges[1:]) / 2\n",
Expand Down
6 changes: 3 additions & 3 deletions docs/comparison/jpsi2pipipi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@
"source": [
"def create_sliders() -> dict[str, ToggleButtons]:\n",
" all_parameters = dict(ampform_model.parameter_defaults.items())\n",
" all_parameters.update(dict(dpd_model.parameter_defaults.items()))\n",
" all_parameters.update(dpd_model.parameter_defaults)\n",
" sliders = {}\n",
" for symbol, value in all_parameters.items():\n",
" value = \"+1\"\n",
Expand Down Expand Up @@ -882,8 +882,8 @@
" )\n",
"\n",
" global lines\n",
" amp_kwargs = {\"color\": \"r\", \"label\": \"ampform\", \"linestyle\": \"solid\"}\n",
" dpd_kwargs = {\"color\": \"blue\", \"label\": \"dpd\", \"linestyle\": \"dotted\"}\n",
" amp_kwargs = dict(color=\"r\", label=\"ampform\", linestyle=\"solid\")\n",
" dpd_kwargs = dict(color=\"blue\", label=\"dpd\", linestyle=\"dotted\")\n",
" if lines is None:\n",
" sx = (s_edges[:-1] + s_edges[1:]) / 2\n",
" tx = (t_edges[:-1] + t_edges[1:]) / 2\n",
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def get_logo_path() -> str | None:
url="https://raw.githubusercontent.com/ComPWA/ComPWA/04e5199/doc/images/logo.svg",
output_path=path,
)

if os.path.exists(path):
return path
return None
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ extend-select = [
]
ignore = [
"B028", # missing explicit stacklevel keyword
"C408",
"D101",
"D102",
"D103",
Expand Down
3 changes: 1 addition & 2 deletions src/ampform_dpd/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ def _create_markdown_table_header(column_names: list[str]):


def _create_markdown_table_row(items: Iterable):
items = (f"{i}" for i in items)
return "| " + " | ".join(items) + " |\n"
return "| " + " | ".join(f"{i}" for i in items) + " |\n"

Check warning on line 216 in src/ampform_dpd/io.py

View check run for this annotation

Codecov / codecov/patch

src/ampform_dpd/io.py#L216

Added line #L216 was not covered by tests


def perform_cached_doit(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_decay.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ampform_dpd.decay import IsobarNode, Particle

# https://compwa-org--129.org.readthedocs.build/report/018.html#resonances-and-ls-scheme
dummy_args = {"mass": 0, "width": 0}
dummy_args = dict(mass=0, width=0)
Λc = Particle("Λc", latex=R"\Lambda_c^+", spin=0.5, parity=+1, **dummy_args)
p = Particle("p", latex="p", spin=0.5, parity=+1, **dummy_args)
π = Particle("π+", latex=R"\pi^+", spin=0, parity=-1, **dummy_args)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def test_aslatex_isobar_node():
@pytest.mark.parametrize(
("assumptions", "expected_hash"),
[
({}, "pythonhashseed-0+7459658071388516764"),
({"real": True}, "pythonhashseed-0+3665410414623666716"),
({"rational": True}, "pythonhashseed-0-7926839224244779605"),
(dict(), "pythonhashseed-0+7459658071388516764"),
(dict(real=True), "pythonhashseed-0+3665410414623666716"),
(dict(rational=True), "pythonhashseed-0-7926839224244779605"),
],
)
def test_get_readable_hash(assumptions, expected_hash, caplog: LogCaptureFixture):
Expand Down

0 comments on commit 9f82a73

Please sign in to comment.