Skip to content

Commit

Permalink
Merge pull request #1228 from martinholmer/move-simtax-code
Browse files Browse the repository at this point in the history
Move simtax code and test to taxcalc/validation/taxsim directory
  • Loading branch information
martinholmer authored Mar 8, 2017
2 parents 6a2cad1 + bcb5fc6 commit f771360
Show file tree
Hide file tree
Showing 39 changed files with 114 additions and 108 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ omit =
taxcalc/_version.py
taxcalc/functions.py
taxcalc/*.json
taxcalc/validation/taxsim/*
29 changes: 14 additions & 15 deletions taxcalc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
from .calculate import *
from .policy import *
from .behavior import *
from .consumption import *
from .filings import *
from .growfactors import *
from .growdiff import *
from .records import *
from .simpletaxio import *
from .taxcalcio import *
from .utils import *
from .decorators import *
from .macro_elasticity import *
from .dropq import *
from taxcalc.calculate import *
from taxcalc.policy import *
from taxcalc.behavior import *
from taxcalc.consumption import *
from taxcalc.filings import *
from taxcalc.growfactors import *
from taxcalc.growdiff import *
from taxcalc.records import *
from taxcalc.taxcalcio import *
from taxcalc.utils import *
from taxcalc.decorators import *
from taxcalc.macro_elasticity import *
from taxcalc.dropq import *

from ._version import get_versions
from taxcalc._version import get_versions
__version__ = get_versions()['version']
del get_versions
4 changes: 2 additions & 2 deletions taxcalc/behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import copy
import numpy as np
from .policy import Policy
from .parameters import ParametersBase
from taxcalc.policy import Policy
from taxcalc.parameters import ParametersBase


class Behavior(ParametersBase):
Expand Down
12 changes: 6 additions & 6 deletions taxcalc/calculate.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import re
import copy
import numpy as np
from .utils import *
from .functions import *
from .policy import Policy
from .records import Records
from .behavior import Behavior
from .consumption import Consumption
from taxcalc.utils import *
from taxcalc.functions import *
from taxcalc.policy import Policy
from taxcalc.records import Records
from taxcalc.behavior import Behavior
from taxcalc.consumption import Consumption
# import pdb


Expand Down
6 changes: 3 additions & 3 deletions taxcalc/consumption.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# pep8 --ignore=E402 consumption.py
# pylint --disable=locally-disabled consumption.py

from .parameters import ParametersBase
from .policy import Policy
from .records import Records
from taxcalc.parameters import ParametersBase
from taxcalc.policy import Policy
from taxcalc.records import Records


class Consumption(ParametersBase):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import inspect
import toolz
from six import StringIO
from .policy import Policy
from taxcalc.policy import Policy


def id_wrapper(*dec_args, **dec_kwargs): # pylint: disable=unused-argument
Expand Down
13 changes: 8 additions & 5 deletions taxcalc/dropq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from .dropq import (run_model, run_nth_year_model, check_user_mods,
run_gdp_elast_model, run_nth_year_gdp_elast_model,
calculate_baseline_and_reform,
chooser, drop_records,
format_macro_results, groupby_means_and_comparisons)
from taxcalc.dropq.dropq import (run_model, check_user_mods,
run_nth_year_model,
run_gdp_elast_model,
run_nth_year_gdp_elast_model,
calculate_baseline_and_reform,
chooser, drop_records,
format_macro_results,
groupby_means_and_comparisons)
24 changes: 13 additions & 11 deletions taxcalc/dropq/dropq.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@
import numpy as np
from pandas import DataFrame
import pandas as pd
from .dropq_utils import create_dropq_difference_table as dropq_diff_table
from .dropq_utils import create_dropq_distribution_table as dropq_dist_table
from .dropq_utils import (WEBAPP_INCOME_BINS,
add_income_bins,
add_weighted_income_bins,
create_distribution_table,
create_json_table)
from .. import (Calculator, Growfactors, Records,
Policy, Consumption, Behavior, Growdiff,
proportional_change_gdp,
TABLE_LABELS, TABLE_COLUMNS, STATS_COLUMNS)
from taxcalc.dropq.dropq_utils import (create_dropq_difference_table as
dropq_diff_table)
from taxcalc.dropq.dropq_utils import (create_dropq_distribution_table as
dropq_dist_table)
from taxcalc.dropq.dropq_utils import (WEBAPP_INCOME_BINS,
add_income_bins,
add_weighted_income_bins,
create_distribution_table,
create_json_table)
from taxcalc import (Calculator, Growfactors, Records,
Policy, Consumption, Behavior, Growdiff,
proportional_change_gdp,
TABLE_LABELS, TABLE_COLUMNS, STATS_COLUMNS)


# specify constants
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .forms import *
from taxcalc.filings.forms import *
40 changes: 20 additions & 20 deletions taxcalc/filings/forms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
from .errors import *
from .tax_form import TaxForm
from .us1040 import US1040
from .us1040sa import US1040SA
from .us1040sb import US1040SB
from .us1040sc import US1040SC
from .us1040sd import US1040SD
from .us1040se import US1040SE
from .us1040seic import US1040SEIC
from .us1040sr import US1040SR
from .us1040sse import US1040SSE
from .us2441 import US2441
from .us3800 import US3800
from .us4137 import US4137
from .us4255 import US4255
from .us4952 import US4952
from .us5695 import US5695
from .us6251 import US6251
from .us8801 import US8801
from .us8863 import US8863
from taxcalc.filings.forms.errors import *
from taxcalc.filings.forms.tax_form import TaxForm
from taxcalc.filings.forms.us1040 import US1040
from taxcalc.filings.forms.us1040sa import US1040SA
from taxcalc.filings.forms.us1040sb import US1040SB
from taxcalc.filings.forms.us1040sc import US1040SC
from taxcalc.filings.forms.us1040sd import US1040SD
from taxcalc.filings.forms.us1040se import US1040SE
from taxcalc.filings.forms.us1040seic import US1040SEIC
from taxcalc.filings.forms.us1040sr import US1040SR
from taxcalc.filings.forms.us1040sse import US1040SSE
from taxcalc.filings.forms.us2441 import US2441
from taxcalc.filings.forms.us3800 import US3800
from taxcalc.filings.forms.us4137 import US4137
from taxcalc.filings.forms.us4255 import US4255
from taxcalc.filings.forms.us4952 import US4952
from taxcalc.filings.forms.us5695 import US5695
from taxcalc.filings.forms.us6251 import US6251
from taxcalc.filings.forms.us8801 import US8801
from taxcalc.filings.forms.us8863 import US8863
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/tax_form.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import six

from .errors import UnsupportedFormYearError
from taxcalc.filings.forms.errors import UnsupportedFormYearError
from taxcalc.utils import string_to_number


Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us1040.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm
from taxcalc.utils import string_to_number


Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us1040sa.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm
from taxcalc.utils import string_to_number


Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us1040sb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US1040SB(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us1040sc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US1040SC(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us1040sd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US1040SD(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us1040se.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm
from taxcalc.utils import string_to_number


Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us1040seic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US1040SEIC(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us1040sr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US1040SR(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us1040sse.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US1040SSE(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us2441.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US2441(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us3800.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US3800(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us4137.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US4137(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us4255.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US4255(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us4952.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US4952(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us5695.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US5695(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us6251.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US6251(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us8801.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US8801(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us8863.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tax_form import TaxForm
from taxcalc.filings.forms.tax_form import TaxForm


class US8863(TaxForm):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import math
import copy
import numpy as np
from .decorators import iterate_jit, jit
from taxcalc.decorators import iterate_jit, jit


@iterate_jit(nopython=True)
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/growdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# pylint --disable=locally-disabled growdiff.py

import numpy as np
from .policy import Policy
from .parameters import ParametersBase
from taxcalc.policy import Policy
from taxcalc.parameters import ParametersBase


class Growdiff(ParametersBase):
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/growfactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os
import six
import pandas as pd
from .utils import read_egg_csv
from taxcalc.utils import read_egg_csv


class Growfactors(object):
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# pep8 --ignore=E402 policy.py
# pylint --disable=locally-disabled policy.py

from .parameters import ParametersBase
from .growfactors import Growfactors
from taxcalc.parameters import ParametersBase
from taxcalc.growfactors import Growfactors


class Policy(ParametersBase):
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import six
import numpy as np
import pandas as pd
from .growfactors import Growfactors
from .utils import read_egg_csv
from taxcalc.growfactors import Growfactors
from taxcalc.utils import read_egg_csv


PUFCSV_YEAR = 2009
Expand Down
16 changes: 8 additions & 8 deletions taxcalc/taxcalcio.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import copy
import six
import pandas as pd
from .policy import Policy
from .records import Records
from .consumption import Consumption
from .behavior import Behavior
from .growdiff import Growdiff
from .growfactors import Growfactors
from .calculate import Calculator
from .utils import ce_aftertax_income
from taxcalc.policy import Policy
from taxcalc.records import Records
from taxcalc.consumption import Consumption
from taxcalc.behavior import Behavior
from taxcalc.growdiff import Growdiff
from taxcalc.growfactors import Growfactors
from taxcalc.calculate import Calculator
from taxcalc.utils import ce_aftertax_income


class TaxCalcIO(object):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Tax-Calculator simple tax input-output class.
Tax-Calculator simple tax input-output class used in TAXSIM validation work.
"""
# CODING-STYLE CHECKS:
# pep8 --ignore=E402 simpletaxio.py
Expand All @@ -10,9 +10,10 @@
import re
import six
import pandas as pd
from .policy import Policy
from .records import Records
from .calculate import Calculator
CUR_PATH = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(CUR_PATH, '..', '..', '..'))
# pylint: disable=wrong-import-position,import-error
from taxcalc import Policy, Records, Calculator


class SimpleTaxIO(object):
Expand Down
2 changes: 1 addition & 1 deletion simtax.py → taxcalc/validation/taxsim/simtax.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import argparse
import sys
from taxcalc import SimpleTaxIO
from simpletaxio import SimpleTaxIO


def main():
Expand Down
Loading

0 comments on commit f771360

Please sign in to comment.