Skip to content

Commit

Permalink
Fix pylint E0401 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Jan 3, 2025
1 parent e0888c9 commit 3cb2bbe
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 64 deletions.
4 changes: 2 additions & 2 deletions docs/guide/make/make_params.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
from collections import OrderedDict
import numpy as np
import pandas as pd
from collections import OrderedDict
import taxcalc as tc
import os


CURDIR_PATH = os.path.abspath(os.path.dirname(__file__))
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/make/make_uguide.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import os
import sys
# Other scripts in this folder.
import make_params
import make_io_vars
from .make_params import make_params
from .make_io_vars import make_io_vars

CURDIR_PATH = os.path.abspath(os.path.dirname(__file__))

Expand Down
5 changes: 3 additions & 2 deletions taxcalc/tests/test_benefits.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
import pytest
import numpy as np
import pandas as pd
# pylint: disable=import-error
from taxcalc import Policy, Records, Calculator
from taxcalc.policy import Policy
from taxcalc.records import Records
from taxcalc.calculator import Calculator


@pytest.mark.benefits
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/tests/test_calcfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import os
import re
import ast
from taxcalc import Records # pylint: disable=import-error
from taxcalc import calcfunctions
import numpy as np
import pytest
from taxcalc.records import Records
import taxcalc.calcfunctions as calcfunctions


class GetFuncDefs(ast.NodeVisitor):
Expand Down
27 changes: 13 additions & 14 deletions taxcalc/tests/test_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@
import os
import pytest
import numpy as np
# pylint: disable=import-error,pointless-string-statement
from taxcalc import Policy, Records, Calculator
from taxcalc import add_income_table_row_variable, SOI_AGI_BINS
from taxcalc.policy import Policy
from taxcalc.records import Records
from taxcalc.calculator import Calculator
from taxcalc.utils import add_income_table_row_variable, SOI_AGI_BINS


"""
2015 IRS-SOI amounts by AGI category are from "Table 3.3 All Returns: Tax
Liability, Tax Credits, and Tax Payments by Size of Adjusted Gross Income,
Tax Year 2015" which is available as a spreadsheet at this URL:
<https://www.irs.gov/statistics/soi-tax-stats-individual-
statistical-tables-by-size-of-adjusted-gross-income>
The IRS-SOI amounts are from 19 rows in the spreadsheet numbered from
11 (AGI under one dollar) through 29 (AGI $10M or more).
Dollar IRS-SOI amounts are expressed in billions of dollars and rounded
to the nearest one-tenth of a million dollars.
"""
# 2015 IRS-SOI amounts by AGI category are from "Table 3.3 All Returns: Tax
# Liability, Tax Credits, and Tax Payments by Size of Adjusted Gross Income,
# Tax Year 2015" which is available as a spreadsheet at this URL:
# <https://www.irs.gov/statistics/soi-tax-stats-individual-
# statistical-tables-by-size-of-adjusted-gross-income>
# The IRS-SOI amounts are from 19 rows in the spreadsheet numbered from
# 11 (AGI under one dollar) through 29 (AGI $10M or more).
# Dollar IRS-SOI amounts are expressed in billions of dollars and rounded
# to the nearest one-tenth of a million dollars.
ITAX = {
'0:EITC': {
# Full earned income credit
Expand Down
4 changes: 3 additions & 1 deletion taxcalc/tests/test_compatible_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
import copy
import pytest
import numpy as np
from taxcalc import Policy, Records, Calculator # pylint: disable=import-error
from taxcalc.policy import Policy
from taxcalc.records import Records
from taxcalc.calculator import Calculator


@pytest.fixture(scope='module', name='allparams')
Expand Down
7 changes: 5 additions & 2 deletions taxcalc/tests/test_cpscsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
import pytest
import numpy as np
import pandas as pd
# pylint: disable=import-error
from taxcalc import GrowFactors, GrowDiff, Policy, Records, Calculator
from taxcalc.growfactors import GrowFactors
from taxcalc.growdiff import GrowDiff
from taxcalc.policy import Policy
from taxcalc.records import Records
from taxcalc.calculator import Calculator


START_YEAR = 2017
Expand Down
5 changes: 3 additions & 2 deletions taxcalc/tests/test_growfactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import os
import tempfile
import pytest
# pylint: disable=import-error
from taxcalc import GrowFactors, Records, Policy
from taxcalc.growfactors import GrowFactors
from taxcalc.policy import Policy
from taxcalc.records import Records


@pytest.fixture(scope='module', name='bad_gf_file')
Expand Down
14 changes: 5 additions & 9 deletions taxcalc/tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@
import numpy as np
import paramtools
import pytest
# pylint: disable=import-error
from taxcalc import (
Parameters,
Policy,
Consumption,
GrowDiff,
GrowFactors,
is_paramtools_format,
)
from taxcalc.parameters import Parameters, is_paramtools_format
from taxcalc.policy import Policy
from taxcalc.consumption import Consumption
from taxcalc.growdiff import GrowDiff
from taxcalc.growfactors import GrowFactors


# Test specification and use of simple Parameters-derived class that has
Expand Down
3 changes: 1 addition & 2 deletions taxcalc/tests/test_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import numpy as np
import pytest
import paramtools as pt
# pylint: disable=import-error
from taxcalc import Policy
from taxcalc.policy import Policy


def cmp_policy_objs(pol1, pol2, year_range=None, exclude=None):
Expand Down
5 changes: 3 additions & 2 deletions taxcalc/tests/test_puf_var_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
import numpy as np
import pandas as pd
import pytest
# pylint: disable=import-error
from taxcalc import Policy, Records, Calculator
from taxcalc.policy import Policy
from taxcalc.records import Records
from taxcalc.calculator import Calculator


def create_base_table(test_path):
Expand Down
5 changes: 3 additions & 2 deletions taxcalc/tests/test_pufcsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
import pytest
import numpy as np
import pandas as pd
# pylint: disable=import-error
from taxcalc import Policy, Records, Calculator
from taxcalc.policy import Policy
from taxcalc.records import Records
from taxcalc.calculator import Calculator


START_YEAR = 2017
Expand Down
4 changes: 3 additions & 1 deletion taxcalc/tests/test_reforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import pytest
import numpy as np
import pandas as pd
from taxcalc import Calculator, Policy, Records # pylint: disable=import-error
from taxcalc.policy import Policy
from taxcalc.records import Records
from taxcalc.calculator import Calculator


def test_2017_law_reform(tests_path):
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/tests/test_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import os
import glob
# pylint: disable=import-error
from taxcalc import Consumption, GrowDiff
from taxcalc.consumption import Consumption
from taxcalc.growdiff import GrowDiff


def test_response_json(tests_path):
Expand Down
41 changes: 22 additions & 19 deletions taxcalc/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,28 @@
import numpy as np
import pandas as pd
import pytest
# pylint: disable=import-error
from taxcalc import Policy, Records, Calculator
from taxcalc.utils import (DIST_VARIABLES,
DIST_TABLE_COLUMNS, DIST_TABLE_LABELS,
DIFF_VARIABLES,
DIFF_TABLE_COLUMNS, DIFF_TABLE_LABELS,
SOI_AGI_BINS,
create_difference_table,
weighted_sum, weighted_mean,
wage_weighted, agi_weighted,
expanded_income_weighted,
add_income_table_row_variable,
add_quantile_table_row_variable,
mtr_graph_data, atr_graph_data,
xtr_graph_plot, write_graph_file,
read_egg_csv, read_egg_json, delete_file,
bootstrap_se_ci,
certainty_equivalent,
ce_aftertax_expanded_income)
from taxcalc.policy import Policy
from taxcalc.records import Records
from taxcalc.calculator import Calculator
from taxcalc.utils import (
DIST_VARIABLES,
DIST_TABLE_COLUMNS, DIST_TABLE_LABELS,
DIFF_VARIABLES,
DIFF_TABLE_COLUMNS, DIFF_TABLE_LABELS,
SOI_AGI_BINS,
create_difference_table,
weighted_sum, weighted_mean,
wage_weighted, agi_weighted,
expanded_income_weighted,
add_income_table_row_variable,
add_quantile_table_row_variable,
mtr_graph_data, atr_graph_data,
xtr_graph_plot, write_graph_file,
read_egg_csv, read_egg_json, delete_file,
bootstrap_se_ci,
certainty_equivalent,
ce_aftertax_expanded_income
)


DATA = [[1.0, 2, 'a'],
Expand Down

0 comments on commit 3cb2bbe

Please sign in to comment.