Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMT_CG_rt is pinned to CG_rt #607

Closed
hdoupe opened this issue Aug 8, 2017 · 2 comments
Closed

AMT_CG_rt is pinned to CG_rt #607

hdoupe opened this issue Aug 8, 2017 · 2 comments
Labels
Milestone

Comments

@hdoupe
Copy link
Collaborator

hdoupe commented Aug 8, 2017

I am creating a separate issue for the bug found in #606.

_AMT_CG_rt{1,2,3} -- If _CG_rt{i} is altered, then the corresponding rate _AMT_CG_rt{i} is pinned to the former rate, i = 1, 2, and 3. But _AMT_CG_rt4 is not affected. If _CG_rt{1,2,3} are not altered then _AMT_CG_rt{1,2,3} are correctly set to the specified values. See http://ospc-taxes7.herokuapp.com/taxbrain/edit/1406/?start_year=2017 and http://ospc-taxes7.herokuapp.com/taxbrain/edit/1407/?start_year=2017

This is probably a bug and not a feature. @martinholmer found the relevant issues and PRs:

First, look at item 4 in Tax-Calculator issue 1074 and item 4 in Tax-Calculator pull request 1109, which was merged on December 22, 2016.

Then look at TaxBrain pull request #448 (merged on January 12, 2017), which was supposed to be the fix on the TaxBrain side. However, the #448 TaxBrain changes did not eliminate the AMT_fixup logic in views.py, which had been added earlier on September 26, 2016, in pull request #342.

So, maybe I'm reading too fast, but it seems as if the behavior you've found was once considered a "feature", then became to be viewed as a "bug", but was never removed from TaxBrain. You're doing a great job on this TaxBrain debugging, so I'll leave it to you to read these issues and pull requests more carefully than I have to see what the intention was. Only then will you be able to determine if this behavior is a "feature" or a "bug".

I will open a PR with a test exposing this bug shortly.

@brittainhard @PeterDSteinberg

@talumbau
Copy link
Member

talumbau commented Aug 8, 2017

@hdoupe can you look at this issue and see if it sheds light on the problem:

#340

I'm wondering if your POST contains a parameter that is no longer in the TaxBrain GUI interface. It should still be fixed if there is a problem, but the discussion in #340 seems relevant

@hdoupe
Copy link
Collaborator Author

hdoupe commented Aug 8, 2017

@talumbau I'm pretty sure that it is still in the TaxBrain GUI interface.

https://www.ospc.org/taxbrain/
screen shot 2017-08-08 at 11 53 59 am

And the corresponding entry in taxcalc/current_law_policy.json

    "_AMT_CG_rt1": {
        "long_name": "Long term capital gain and qualified dividends (AMT) rate 1",
        "description": "Capital gain and qualified dividends (stacked on top of regular income) below threshold 1 are taxed at this rate. ",
        "section_1": "Capital Gains And Dividends",
        "section_2": "AMT - Long Term Capital Gains And Qualified Dividends",
        "irs_ref": "Form 6251, line 47, in-line. ",
        "notes": "",
        "row_var": "FLPDYR",
        "row_label": ["2013"],
        "start_year": 2013,
        "cpi_inflated": false,
        "col_var": "",
        "col_label": "",
        "value": [0.0]
    },

I see that you removed AMT capital gains in #342 but I'm having trouble figuring out where it was added back in or why it is still in the TaxBrain GUI

I can maybe see the value in pinning AMT_CG_rt to CG_rt when AMT_CG_rt is not modified but CG_rt is. But, if AMT_CG_rt is modified, then I don't think that it should be changed. Perhaps, amt_fixup should be:

def amt_fixup(request, reform, model):
    """
    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_thd1_0", "CG_thd1_1",
                        "CG_thd1_2", "CG_thd1_3", "CG_thd1_cpi",
                        "CG_rt2", "CG_thd2_0", "CG_thd2_1",
                        "CG_thd2_2", "CG_thd2_3", "CG_thd2_cpi",
                        "CG_rt3"]

    for cgparam in cap_gains_params:
        if cgparam in reform and 'AMT_' + cgparam not in reform:
            reform['AMT_' + cgparam] = reform[cgparam]
            if cgparam.endswith("_cpi"):
                setattr(model, 'AMT_' + cgparam, reform[cgparam])
            else:
                setattr(model, 'AMT_' + cgparam, reform[cgparam][0])

@martinholmer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants