PSLmodels / Tax-Calculator

USA Federal Individual Income and Payroll Tax Microsimulation Model
https://taxcalc.pslmodels.org
Other
255 stars 154 forks source link

Add baseline table to output file generated by the tc --sqldb command #2714

Closed martinholmer closed 7 months ago

martinholmer commented 7 months ago

In prior versions of the Tax-Calculator CLI tool, tc, the --sqldb option created an SQLite3 database that contained variables for the specified reform, but not variables for the baseline. This made it more difficult for users to conduct analysis of policy reforms using SQL scripts.

This pull request enhances the tc tool so that the --sqldb option generates an SQLite3 database that contains two tables (each containing the same set of specified variables), one for the baseline and one for the reform.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (f850d81) 98.54% compared to head (d806ac3) 98.54%. Report is 1 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2714/graphs/tree.svg?width=650&height=150&src=pr&token=KqtTvRSNjQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels)](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2714?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) ```diff @@ Coverage Diff @@ ## master #2714 +/- ## ======================================= Coverage 98.54% 98.54% ======================================= Files 14 14 Lines 2608 2616 +8 ======================================= + Hits 2570 2578 +8 Misses 38 38 ``` | [Flag](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2714/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2714/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | `98.54% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2714?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [taxcalc/taxcalcio.py](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2714?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-dGF4Y2FsYy90YXhjYWxjaW8ucHk=) | `100.00% <100.00%> (ø)` | |
jdebacker commented 7 months ago

@martinholmer Thanks for making this change.

Can you write a unit test that covers the taxcalcio.analyze function with the new outputs? With that, I think this PR will be ready to merge.

martinholmer commented 7 months ago

@jdebacker, Why am I now getting the following error? What is the failing test meant to do: Test reading JSON assumption file using URL.

Screenshot 2024-02-06 at 1 25 19 PM
martinholmer commented 7 months ago

@jdebacker, Can you merge #2714? This PR did pass all the tests on ubuntu,3.9.

jdebacker commented 7 months ago

Thanks @martinholmer. Merging.