Skip to content

Commit

Permalink
Fix pylint W0611 and W0612 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Jan 6, 2025
1 parent 7141d17 commit 2f072e4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
3 changes: 1 addition & 2 deletions taxcalc/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import numpy as np
import marshmallow as ma
import paramtools as pt
from taxcalc.growfactors import GrowFactors


class CompatibleDataSchema(ma.Schema):
Expand Down Expand Up @@ -324,7 +323,7 @@ def adjust_with_indexing(self, params_or_path, **kwargs):
self.delete(to_delete, **kwargs)

# 1.b For all others, these are years after last_known_year.
last_known_year = max(cpi_min_year["year"], self._last_known_year)
# last_known_year=max(cpi_min_year["year"],self._last_known_year)
# calculate 2026 value, using new inflation rates, for parameters
# that revert to their pre-TCJA values.
long_params = ['II_brk7', 'II_brk6', 'II_brk5', 'II_brk4',
Expand Down
7 changes: 3 additions & 4 deletions taxcalc/tests/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# pylint --disable=locally-disabled test_decorators.py

import os
import sys
import importlib
import numpy as np
from pandas import DataFrame
Expand Down Expand Up @@ -311,8 +310,8 @@ def test_function_parameters_optional():

def unjittable_function1(w, x, y, z):
"""Function docstring"""
a = x + y
b = w[0] + x + y + z
a = x + y # pylint: disable=unused-variable
b = w[0] + x + y + z # pylint: disable=unused-variable


def unjittable_function2(w, x, y, z):
Expand Down Expand Up @@ -342,7 +341,7 @@ def test_iterate_jit_raises_on_unknown_return_argument():
pf.y = np.ones((5,))
pf.z = np.ones((5,))
with pytest.raises(AttributeError):
ans = uf2(pm, pf)
ans = uf2(pm, pf) # pylint: disable=unused-variable


def magic_calc6(w, x, y, z):
Expand Down
1 change: 0 additions & 1 deletion taxcalc/tests/test_growdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import os
import json
import numpy as np
import pytest
from taxcalc import GrowDiff, GrowFactors, Policy


Expand Down
17 changes: 8 additions & 9 deletions taxcalc/tests/test_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,25 @@
import json
from io import StringIO
import numpy as np
from numpy.testing import assert_array_equal
import pandas as pd
import pytest
from taxcalc import GrowFactors, Policy, Records, Calculator
from taxcalc import GrowFactors, Policy, Records


def test_incorrect_records_instantiation(cps_subsample):
"""Test docstring"""
with pytest.raises(ValueError):
recs = Records(data=[])
_ = Records(data=[])
with pytest.raises(ValueError):
recs = Records(data=cps_subsample, gfactors=[])
_ = Records(data=cps_subsample, gfactors=[])
with pytest.raises(ValueError):
recs = Records(data=cps_subsample, gfactors=None, weights=[])
_ = Records(data=cps_subsample, gfactors=None, weights=[])
with pytest.raises(ValueError):
recs = Records(data=cps_subsample, gfactors=None, weights=None,
start_year=[])
_ = Records(data=cps_subsample, gfactors=None, weights=None,
start_year=[])
with pytest.raises(ValueError):
recs = Records(data=cps_subsample, gfactors=None, weights=None,
adjust_ratios=[])
_ = Records(data=cps_subsample, gfactors=None, weights=None,
adjust_ratios=[])


def test_correct_records_instantiation(cps_subsample):
Expand Down

0 comments on commit 2f072e4

Please sign in to comment.