PSLmodels / Tax-Brain

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

Convert params function #158

Open jdebacker opened 3 years ago

jdebacker commented 3 years ago

Since cs2tc is a dependency, I think one could use a function from that package and remove the report_utils.convert_params() function.

jdebacker commented 3 years ago

Also perhaps redundant with cs2tc:

andersonfrailey commented 3 years ago

I'll defer to @hdoupe for this one

hdoupe commented 3 years ago

cs2tc only makes a couple high-level changes to the parameter format. For example, it renames parameters coming from CS that are named EITC_c_checkbox to EITC_c-indexed. It doesn't do full conversions between ParamTools and Tax-Calculator parameter formats.

Tax-Calculator's Parameters._update, which is called by methods like Policy.implement_reform, converts parameters from Traditional Tax-Calculator style to the paramtools format but not the other way around.

The convert_params function is the only (still living :skull:) function that converts parameters from ParamTools format to Tax-Calculator format. (@andersonfrailey if you're interested, I would happily update the report creation logic to use ParamTools formatted data so we can purge one more of these conversion functions.)

Also perhaps redundant with cs2tc:

  • utils.update_policy()
  • utils.is_paramtools_format()

These aren't in cs2tc. I don't know the best home for them. They are duplicated in CCC, too:

https://github.com/PSLmodels/Cost-of-Capital-Calculator/blob/afad7751597f0f937f7b00a353d41f827f5e9527/ccc/get_taxcalc_rates.py#L157-L186

It may be best to include this logic directly in Tax-Calculator or in a third-party package like cs2tc.