Skip to content

Commit

Permalink
Fix pylint R0915 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Jan 3, 2025
1 parent 84c2439 commit c613d76
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions extend_tcja.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def main():
"""
High-level script logic.
"""
# pylint: disable=too-many-statements

# identify last parameter name in TCJA_PARAMETERS
last_pname = list(TCJA_PARAMETERS.keys())[-1]
# calculate 2025-to-2026 parameters indexing factor
Expand Down
5 changes: 3 additions & 2 deletions taxcalc/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ def adjust_with_indexing(self, params_or_path, **kwargs):
wiped out after the year in which the value is adjusted for the
same hard-coding reason.
"""
# pylint: disable=too-many-statements

# Temporarily turn off extra ops during the intermediary adjustments
# so that expensive and unnecessary operations are not run.
label_to_extend = self.label_to_extend
Expand Down Expand Up @@ -527,15 +529,14 @@ def initialize(self, start_year, num_years, last_known_year=None,
should use the __init__ method in the future.
"""
# pylint: disable=too-many-arguments,too-many-positional-arguments

# Handle case where project hasn't been initialized yet
if getattr(self, "_data", None) is None:
return Parameters.__init__(
self, start_year, num_years, last_known_year=last_known_year,
removed=removed, redefined=redefined,
wage_indexed=wage_indexed, **kwargs
)
return None
return None # pragma: no cover

def _update(self, revision, print_warnings, raise_errors):
"""
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def fixture_test_reforms(tests_path):
"""
Execute logic only once rather than on each pytest-xdist node.
"""
# pylint: disable=too-many-locals
# pylint: disable=too-many-locals,too-many-statements
num_reforms = 64 # must be same as NUM_REFORMS in test_reforms.py
handling_logic = ('PYTEST_XDIST_WORKER' not in os.environ or
os.environ['PYTEST_XDIST_WORKER'] == 'gw0')
Expand Down
3 changes: 2 additions & 1 deletion taxcalc/tests/test_reforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def test_round_trip_reforms(fyear, tests_path):
and subsequent reform files that represent recent legislation are
specified in a consistent manner.
"""
# pylint: disable=too-many-locals
# pylint: disable=too-many-locals,too-many-statements

# create clp metadata dictionary for current-law policy in fyear
clp_pol = Policy()
clp_pol.set_year(fyear)
Expand Down

0 comments on commit c613d76

Please sign in to comment.