Skip to content
Merged
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
14 changes: 4 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,8 @@ per-file-ignores."src/ttsim/typing.py" = [
"PYI051", # Redundant literal union
]
per-file-ignores."src_mettsim/mettsim/middle_earth/**/*.py" = [
"E721", # Type comparison using ==
"PLR1714", # Repeated equality comparison
"PLR1716", # Boolean chained comparison
"PLR2004", # Magic value comparison
"RET", # Unnecessary return logic
"SIM108", # Use ternary operator
"RET505", # Vectorizer requires both if/else branches; it rejects the early-return form
]
per-file-ignores."src_mettsim/tests_middle_earth/*.py" = [
"ANN", # Missing type annotations
Expand All @@ -236,11 +232,9 @@ per-file-ignores."tests/interface_dag_elements/test_failures.py" = [
"E501", # Line too long
]
per-file-ignores."tests/tt/test_vectorization.py" = [
"E721", # Type comparison using ==
"PLR1714", # Repeated equality comparison
"PLR1716", # Boolean chained comparison
"RET", # Unnecessary return logic
"SIM108", # Use ternary operator
"RET504", # `out = ...; return out` fixtures mirror the vectorizer's output
"RET505", # Vectorizer requires both if/else branches; it rejects the early-return form
"SIM108", # Statement-style if/else blocks are intentional fixtures for the vectorizer
]
pydocstyle.convention = "google"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ def claim_of_child_y(
child_eligible: bool,
schedule: dict[str, float],
) -> float:
if child_eligible:
return schedule["child_amount_y"]
else:
return 0
return schedule["child_amount_y"] if child_eligible else 0


@policy_function()
Expand Down
5 changes: 1 addition & 4 deletions src_mettsim/mettsim/middle_earth/wealth_tax/wealth_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ def amount_y(
tax_rate: float,
exempt_from_wealth_tax: bool,
) -> float:
if exempt_from_wealth_tax:
return 0.0
else:
return wealth * tax_rate
return 0.0 if exempt_from_wealth_tax else wealth * tax_rate


@policy_function()
Expand Down
Loading