Skip to content

Commit

Permalink
Merge pull request #868 from hdoupe/drop-amt
Browse files Browse the repository at this point in the history
Merged #868
  • Loading branch information
hdoupe authored Mar 26, 2018
2 parents 19a70bc + 9ee1459 commit 6f0bbf6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 119 deletions.
5 changes: 3 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ Release 1.5.0 on 2018-03-2?
- [#847](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/847) - Adds data source to file input page, refactors reform submission, and improves tests - Hank Doupe
- [#848](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/848) - Add missing variables to distribution table (with update to TC 0.17.0) - Sean Wang and Hank Doupe
- [#849](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/849) - Add CCC start year drop-down - Hank Doupe
- [#854](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/854) - Change "About _ remaining" to "Estimated time remaining: _" - Max Ghenis
- [#854](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/854) - Change "About _ remaining" to "Estimated time remaining: _ " - Max Ghenis
- [#856](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/856) - Add link to data document - Anderson Frailey
- [#857](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/857) - Update link to CCC guide - Jason DeBacker
- [#863](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/857) - Updates job time and adds version to docker files - Hank Doupe
- [#863](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/863) - Updates job time and adds version to docker files - Hank Doupe
- [#867](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/857) - Display parameter data type as indicated by Tax-Calculator specifications - Hank Doupe

**Bug Fixes**
- [#844](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/842) - Pass start year to dynamic behavioral - Hank Doupe
- [#851](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/851) - Update update CSV builder test labels and un-xfail the CSV test - Hank Doupe
- [#865](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/865) - Extend tests and fix warning/error handling regression - Hank Doupe
- [#868](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/868) - Remove special processing for AMT parameters - Hank Doupe

Release 1.4.4 on 2018-03-08
----------------------------
Expand Down
1 change: 0 additions & 1 deletion webapp/apps/taxbrain/behaviors.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def set_fields(self, upstream_obj, nonparam_fields=None):
raw_val = str(raw_val)
self.raw_input_fields[field.name] = raw_val

param_formatters.amt_fixup(self.raw_input_fields)
input_fields, failed_lookups = param_formatters.parse_fields(
self.raw_input_fields,
default_data
Expand Down
17 changes: 0 additions & 17 deletions webapp/apps/taxbrain/param_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,6 @@
MetaParam = namedtuple("MetaParam", ["param_name", "param_meta"])
CPI_WIDGET = NullBooleanSelect()

def amt_fixup(fields):
"""
Take the regular tax captial gains parameters from the user reform
and set them as the equivalent Alternative Minimum Tax capital
gains parameters
"""
cap_gains_params = ["CG_rt1", "CG_brk1_0", "CG_brk1_1",
"CG_brk1_2", "CG_brk1_3", "CG_brk1_cpi",
"CG_rt2", "CG_brk2_0", "CG_brk2_1",
"CG_brk2_2", "CG_brk2_3", "CG_brk2_cpi",
"CG_rt3"]

for cgparam in cap_gains_params:
if cgparam in fields:
fields['AMT_' + cgparam] = fields[cgparam]


def parse_value(value, meta_param):
"""
Parse the value to the type that the upstream package specification
Expand Down
99 changes: 0 additions & 99 deletions webapp/apps/taxbrain/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,105 +496,6 @@ def test_taxbrain_bool_separated_values(self):
check_posted_params(result['tb_dropq_compute'], truth_mods,
str(2018))


def test_taxbrain_rt_capital_gain_goes_to_amt(self):
"""
Transfer over the regular tax capital gains to AMT
"""

data = get_post_data(START_YEAR, _ID_BenefitSurtax_Switches=False)
mod = {'CG_rt1': [0.25], 'CG_rt3': [u'0.25'], 'CG_rt2': [u'0.18'],
'CG_brk1_cpi': [u'True'], 'CG_brk2_cpi': [u'True'],
'CG_brk1_0': [u'38659.0'], 'CG_brk1_1': [u'76300.0'],
'CG_brk1_2': [u'38650.0'], 'CG_brk1_3': [u'51400.0'],
'CG_brk2_0': [u'425050.0'], 'CG_brk2_1': [u'476950.0'],
'CG_brk2_2': [u'243475.0'], 'CG_brk2_3': [u'451000.0']}
data.update(mod)

result = do_micro_sim(CLIENT, data)

out2 = OutputUrl.objects.get(pk=result["pk"])
tsi2 = TaxSaveInputs.objects.get(pk=out2.model_pk)
assert tsi2.raw_input_fields['CG_rt1'] == u'0.25'
assert tsi2.raw_input_fields['CG_rt2'] == u'0.18'
assert tsi2.raw_input_fields['CG_rt3'] == u'0.25'
assert tsi2.raw_input_fields['CG_brk1_cpi'] == 'True'
assert tsi2.raw_input_fields['CG_brk1_0'] == u'38659.0'
assert tsi2.raw_input_fields['CG_brk1_1'] == u'76300.0'
assert tsi2.raw_input_fields['CG_brk1_2'] == u'38650.0'
assert tsi2.raw_input_fields['CG_brk1_3'] == u'51400.0'
assert tsi2.raw_input_fields['CG_brk2_cpi'] == 'True'
assert tsi2.raw_input_fields['CG_brk2_0'] == u'425050.0'
assert tsi2.raw_input_fields['CG_brk2_1'] == u'476950.0'
assert tsi2.raw_input_fields['CG_brk2_2'] == u'243475.0'
assert tsi2.raw_input_fields['CG_brk2_3'] == u'451000.0'

assert tsi2.raw_input_fields['AMT_CG_rt1'] == u'0.25'
assert tsi2.raw_input_fields['AMT_CG_rt2'] == u'0.18'
assert tsi2.raw_input_fields['AMT_CG_rt3'] == u'0.25'
assert tsi2.raw_input_fields['AMT_CG_brk1_cpi'] == 'True'
assert tsi2.raw_input_fields['AMT_CG_brk1_0'] == u'38659.0'
assert tsi2.raw_input_fields['AMT_CG_brk1_1'] == u'76300.0'
assert tsi2.raw_input_fields['AMT_CG_brk1_2'] == u'38650.0'
assert tsi2.raw_input_fields['AMT_CG_brk1_3'] == u'51400.0'
assert tsi2.raw_input_fields['AMT_CG_brk2_cpi'] == 'True'
assert tsi2.raw_input_fields['AMT_CG_brk2_0'] == u'425050.0'
assert tsi2.raw_input_fields['AMT_CG_brk2_1'] == u'476950.0'
assert tsi2.raw_input_fields['AMT_CG_brk2_2'] == u'243475.0'
assert tsi2.raw_input_fields['AMT_CG_brk2_3'] == u'451000.0'


def test_taxbrain_rt_to_passthrough(self):
"""
Transfer over the ind. income tax params to passthrough
"""
values1 = {"II_brk1_0": [u'8750.'],
"II_brk1_1": [u'9200.'],
"II_brk1_2": [u'9350.'], "II_brk1_3": [u'9350.'],
"II_rt1": [0.09]}

values2 = {"II_brk2_0": [u'36000.', u'38000.', u'40000.', u'41000.'],
"II_brk2_1": [u'72250.', u'74000.'],
"II_brk2_2": [u'36500.'], "II_brk2_3": [u'46500.'],
"II_rt2": [0.16]}

values3 = {"II_brk3_0": [u'88000.'],
"II_brk3_1": [u'147000.'],
"II_brk3_2": [u'75000.'], "II_brk3_3": [u'126500.'],
"II_rt3": [0.23]}

values4 = {"II_brk4_0": [u'184400.'],
"II_brk4_1": [u'224000.'],
"II_brk4_2": [u'112000.'], "II_brk4_3": [u'205000.'],
"II_rt4": [0.29]}

values5 = {"II_brk5_0": [u'399000.'],
"II_brk5_1": [u'399500.'],
"II_brk5_2": [u'200000.'], "II_brk5_3": [u'405000.'],
"II_rt5": [0.31]}

values6 = {"II_brk6_0": [u'403000.'],
"II_brk6_1": [u'453000.'],
"II_brk6_2": [u'252000.'], "II_brk6_3": [u'435000.'],
"II_rt6": [0.37]}

values7 = {"II_brk7_0": [u'999999.'],
"II_brk7_1": [u'999999.'],
"II_brk7_2": [u'999999.'], "II_brk7_3": [u'999999.'],
"II_rt7": [0.42]}

data = get_post_data(START_YEAR, _ID_BenefitSurtax_Switches=False)

data.update(values1)
data.update(values2)
data.update(values3)
data.update(values4)
data.update(values5)
data.update(values6)
data.update(values7)
#TODO: check how values are saved
do_micro_sim(CLIENT, data)

@pytest.mark.parametrize(
'data_source,use_assumptions',
[('PUF', True), ('CPS', False)]
Expand Down

0 comments on commit 6f0bbf6

Please sign in to comment.