Skip to content

Commit

Permalink
MAINT: address linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Apr 3, 2024
1 parent b55a609 commit 9993445
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
"parametrizations",
"permutate",
"pydocstyle",
"PyPA",
"pyplot",
"pytest",
"qrules",
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ branch = true
source = ["src"]

[tool.mypy]
enable_incomplete_feature = "Unpack"
exclude = "_build"
show_error_codes = true
warn_unused_configs = true
Expand Down
13 changes: 4 additions & 9 deletions src/ampform/helicity/decay.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,10 @@ def _is_qrules_state_transition(obj) -> TypeGuard[StateTransition]:
if isinstance(obj, FrozenTransition):
if any(not isinstance(s, State) for s in obj.states.values()):
return False
if any(
not isinstance(i, InteractionProperties)
for i in obj.interactions.values()
):
return False
return True
if get_qrules_version() < (0, 10) and isinstance(obj, StateTransition): # type: ignore[misc]
return True
return False
return all(
isinstance(i, InteractionProperties) for i in obj.interactions.values()
)
return get_qrules_version() < (0, 10) and isinstance(obj, StateTransition) # type: ignore[misc]


@lru_cache(maxsize=None)
Expand Down
8 changes: 2 additions & 6 deletions src/symplot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,13 @@ def set_ranges(
def _is_min_max(
range_def: RangeDefinition,
) -> TypeGuard[tuple[float, float]]:
if len(range_def) == 2: # noqa: PLR2004
return True
return False
return len(range_def) == 2 # noqa: PLR2004


def _is_min_max_step(
range_def: RangeDefinition,
) -> TypeGuard[tuple[float, float, float | int]]:
if len(range_def) == 3: # noqa: PLR2004
return True
return False
return len(range_def) == 3 # noqa: PLR2004


ValueType = TypeVar("ValueType")
Expand Down

0 comments on commit 9993445

Please sign in to comment.