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

Fix Age Variables #172

Merged
merged 2 commits into from
Apr 9, 2018
Merged

Fix Age Variables #172

merged 2 commits into from
Apr 9, 2018

Conversation

andersonfrailey
Copy link
Collaborator

This PR addresses concerns raised by @MaxGhenis in issue #164. I've corrected the nu05, nu13, and n24 variables in the CPS file, as well as modified the scripts to create the PUF. Interestingly, I got the same MD5 output from the PUF after rerunning the scripts with the included modification.

cc @martinholmer

@MaxGhenis
Copy link
Contributor

Interestingly, I got the same MD5 output from the PUF after rerunning the scripts with the included modification.

Are the source fields like ICPS03 ints?

@andersonfrailey
Copy link
Collaborator Author

@MaxGhenis, no. We've written the Python scripts so that those variables are incremented while dependents are added to the tax unit, rather than after the fact.

@martinholmer
Copy link
Contributor

@andersonfrailey, using the new puf.csv file generated by the changes in #172, will the following Tax-Calculator test pass (after removing the xfail decorator)? If not, why does the test fail? Is the test logic incorrect? Or are there still problems with the age count variables in the puf.csv file?

@pytest.mark.requires_pufcsv
@pytest.mark.xfail
def test_ubi_n_variables(puf_path):
    """
    Ensure that the three UBI n* variables add up to XTOT variable,
    recognizing that XTOT values are often capped in the IRS-SOI PUF,
    so that XTOT < NSUM might not indicate any data inconsistency.
    """
    pufdf = pd.read_csv(puf_path)
    xtot = pufdf['XTOT']
    nsum = pufdf['nu18'] + pufdf['n1820'] + pufdf['n21']
    if not np.sum(xtot > nsum) == 0:
        print('number xtot > nsum is:', np.sum(xtot > nsum))
        assert 'XTOT' <= '(nu18+n1820+n21)'

@andersonfrailey
Copy link
Collaborator Author

@martinholmer, that will still fail. I haven't been able to address that issue just yet.

@andersonfrailey
Copy link
Collaborator Author

I've updated this PR to include the last few PR's that have been merged. As I mentioned yesterday, I will be offline until the 10th, but this PR is ready for review and can be merged by one of the other maintainers if there are no issues with it while I'm gone.

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

Successfully merging this pull request may close these issues.

3 participants