PSLmodels / Tax-Brain

Tax-Brain is an integrator model for PSL tax models
http://taxbrain.pslmodels.org/
MIT License
9 stars 14 forks source link

WIP: Add code to run OG-USA #56

Open andersonfrailey opened 5 years ago

andersonfrailey commented 5 years ago

This PR adds the code needed to run OG-USA and apply the change in wage growth in taxcalc. Right now, I just run OG-USA using the parameters from the example and the user opts to run OG-USA with a boolean argument. Future updates will be needed to add custom parameter support for both the Python API and the COMP web app.

I still need to do more robust checks to make sure everything is being applied correctly and would appreciate feedback from others.

cc @MattHJensen @jdebacker @rickecon

andersonfrailey commented 5 years ago

I believe that this PR is ready for review. As the first step in fully integrating OG-USA into Tax-Brain, all I've tried to do here is apply the percentage change in wage growth rates to the default rates. Additional outputs related to OG-USA such as new graphs/tables will come in another PR and I'm open to suggestions as to what those would be. Adding OG-USA to COMP will also come in a later PR.

cc @MattHJensen @rickecon @jdebacker

jdebacker commented 3 years ago

@andersonfrailey, We should have been on this for you! I'm getting my head around TB now and can probably help with this PR (or create a new one) at this point. Let me know.

andersonfrailey commented 3 years ago

Thanks, @jdebacker! Can you take a look at what we've got here? It'd be great if we could just fix the conflicts here, but no biggie if it's easier to just start fresh.

jdebacker commented 3 years ago

@andersonfrailey Yes, can you fix the conflicts, then I'll checkout the branch and make a few tweaks to tbogusa and maybe another one or two places?

andersonfrailey commented 3 years ago

@jdebacker, conflicts are taken care of

jdebacker commented 3 years ago

@andersonfrailey Ok - I'm working on this on your branch. I'll push my changes to that.

BUT, I'm having some issues getting Tax-Brain to run generally. Maybe the best place to get me started there is there make sure I can run the testing suite from my master branch. Can you take a look at the issue I describe in PR #160 and see if you can replicate that or know of the possible issue.

FYI, When I was trying to test my OG-USA integration changes, I was unable import taxbrain, with the error being that I couldn't import pypandoc, even though it was installed in the toxbrain-dev environment I just recreated:

In [1]: from taxbrain import TaxBrain
   ...: from distributed import Client
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-90e0a1277b08> in <module>
----> 1 from taxbrain import TaxBrain
      2 from distributed import Client

~/repos/Tax-Brain/taxbrain/__init__.py in <module>
      1 from taxbrain.taxbrain import *
      2 from taxbrain.utils import *
----> 3 from taxbrain.cli import *
      4 from taxbrain.report import *
      5 from taxbrain.report_utils import *

~/repos/Tax-Brain/taxbrain/cli.py in <module>
      3 """
      4 import argparse
----> 5 from taxbrain import TaxBrain, report
      6 from pathlib import Path
      7 from datetime import datetime

~/repos/Tax-Brain/taxbrain/report.py in <module>
      4 import taxcalc as tc
      5 from pathlib import Path
----> 6 from .report_utils import (form_intro, form_baseline_intro, write_text, date,
      7                            largest_tax_change, notable_changes,
      8                            behavioral_assumptions, consumption_assumptions,

~/repos/Tax-Brain/taxbrain/report_utils.py in <module>
      3 """
      4 import json
----> 5 import pypandoc
      6 import numpy as np
      7 import pandas as pd

ModuleNotFoundError: No module named 'pypandoc'

In [2]: exit
(taxbrain-dev) jason.debacker@JDEBACKER Tax-Brain % conda list pypandoc
# packages in environment at /Users/jason.debacker/anaconda3/envs/taxbrain-dev:
#
# Name                    Version                   Build  Channel
pypandoc                  1.5                pyh9f0ad1d_0    conda-forge
jdebacker commented 3 years ago

The above is resolved with the new environment.yml file in PR #160.