From 0328c93acc4c34e53dcaa371d8afa925feb99e73 Mon Sep 17 00:00:00 2001 From: noman404 Date: Wed, 11 Dec 2024 11:02:52 +0800 Subject: [PATCH] disable second column for +$1 --- .gitignore | 1 + .../config/variable_mappings.yaml | 94 +++++++++---------- policyengine_taxsim/core/output_mapper.py | 9 +- 3 files changed, 49 insertions(+), 55 deletions(-) diff --git a/.gitignore b/.gitignore index 6360d58..a47f7d2 100644 --- a/.gitignore +++ b/.gitignore @@ -168,3 +168,4 @@ cython_debug/ .idea/ input/* output.csv +/tests-yaml/*.yaml diff --git a/policyengine_taxsim/config/variable_mappings.yaml b/policyengine_taxsim/config/variable_mappings.yaml index b325eb8..569d132 100644 --- a/policyengine_taxsim/config/variable_mappings.yaml +++ b/policyengine_taxsim/config/variable_mappings.yaml @@ -121,7 +121,7 @@ policyengine_to_taxsim: text_description: "10. Federal AGI" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v11: variable: tax_unit_taxable_unemployment_compensation implemented: true @@ -131,7 +131,7 @@ policyengine_to_taxsim: text_description: "11. UI in AGI 1979+" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v12: variable: tax_unit_taxable_social_security implemented: true @@ -141,7 +141,7 @@ policyengine_to_taxsim: text_description: "12. Social Security in AGI 84" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v13: variable: standard_deduction implemented: true @@ -151,7 +151,7 @@ policyengine_to_taxsim: text_description: "13. Zero Bracket Amount" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v14: variable: exemptions implemented: true @@ -161,7 +161,7 @@ policyengine_to_taxsim: text_description: "14. Personal Exemptions" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v15: variable: na_pe implemented: false @@ -171,7 +171,7 @@ policyengine_to_taxsim: text_description: "15. Exemption Phaseout 1991+" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v16: variable: na_pe implemented: false @@ -181,7 +181,7 @@ policyengine_to_taxsim: text_description: "16. Deduction Phaseout 1991+" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v17: variable: taxable_income_deductions_if_itemizing implemented: true @@ -191,7 +191,7 @@ policyengine_to_taxsim: text_description: "17. Deductions allowed" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 qbi: variable: qualified_business_income_deduction implemented: true @@ -200,7 +200,7 @@ policyengine_to_taxsim: text_description: "QBI deduction" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v18: variable: taxable_income implemented: true @@ -210,7 +210,7 @@ policyengine_to_taxsim: text_description: "18. Federal Taxable Income" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v19: variable: income_tax_main_rates implemented: true @@ -220,7 +220,7 @@ policyengine_to_taxsim: text_description: "19. Federal Regular Tax" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v20: variable: na_pe implemented: false @@ -230,7 +230,7 @@ policyengine_to_taxsim: text_description: "20. Exemption Surtax 1988-96" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v21: variable: na_pe implemented: false @@ -240,7 +240,7 @@ policyengine_to_taxsim: text_description: "21. General Tax Credit 1975-8" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v22: variable: ctc implemented: true @@ -250,7 +250,7 @@ policyengine_to_taxsim: text_description: "22. Child Tax Credit*17/22 98" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v23: variable: refundable_ctc implemented: true @@ -260,7 +260,7 @@ policyengine_to_taxsim: text_description: "23. Refundable Part" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v24: variable: cdcc implemented: true @@ -270,7 +270,7 @@ policyengine_to_taxsim: text_description: "24. Child Care Credit 1076+" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v25: variable: eitc implemented: true @@ -280,7 +280,7 @@ policyengine_to_taxsim: text_description: "25. Earned Income Credit 1975" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 special_cases: - mn: implemented: false @@ -294,7 +294,7 @@ policyengine_to_taxsim: text_description: "26. Alternative Min Income" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v27: variable: alternative_minimum_tax implemented: true @@ -304,7 +304,7 @@ policyengine_to_taxsim: text_description: "27. AMT" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v28: variable: multiple_variables implemented: true @@ -314,7 +314,7 @@ policyengine_to_taxsim: text_description: "28. Income Tax Before Credits" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 variables: - income_tax_main_rates - capital_gains_tax @@ -326,7 +326,7 @@ policyengine_to_taxsim: text_description: "Total Credits" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 net_investment_income_tax: variable: na_pe implemented: false @@ -335,7 +335,7 @@ policyengine_to_taxsim: text_description: "Net Investment Income Tax" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v29: variable: taxsim_tfica implemented: true @@ -345,7 +345,7 @@ policyengine_to_taxsim: text_description: "29. FICA" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 tax_payer_share: variable: na_pe implemented: false @@ -355,7 +355,7 @@ policyengine_to_taxsim: text_description: "Taxpayer share of FICA" group_order: 3 full_text_group: "Federal Tax Calculation" - group_column: 2 + group_column: 1 v30: variable: na_pe implemented: false @@ -365,7 +365,7 @@ policyengine_to_taxsim: text_description: "30. Household Income" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 v31: variable: na_pe implemented: false @@ -375,7 +375,7 @@ policyengine_to_taxsim: text_description: "31. Imputed Rent" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 v32: variable: state_agi implemented: true @@ -385,7 +385,7 @@ policyengine_to_taxsim: text_description: "32. AGI" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 special_cases: - mn: implemented: false @@ -402,7 +402,7 @@ policyengine_to_taxsim: text_description: "33. Exemptions" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 v34: variable: state_standard_deduction implemented: true @@ -412,7 +412,7 @@ policyengine_to_taxsim: text_description: "34. Standard Deduction" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 special_cases: - ms: implemented: false @@ -441,7 +441,7 @@ policyengine_to_taxsim: text_description: "35. Itemized Deductions" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 special_cases: - il: implemented: false @@ -455,7 +455,7 @@ policyengine_to_taxsim: text_description: "36. Taxable Income" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 tax_before_credits: variable: state_income_tax_before_non_refundable_credits implemented: true @@ -464,7 +464,7 @@ policyengine_to_taxsim: text_description: "Tax before credits" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 v41: variable: na_pe implemented: false @@ -473,7 +473,7 @@ policyengine_to_taxsim: text_description: "Bracket Rate" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 v37: variable: state_property_tax_credit implemented: true @@ -483,7 +483,7 @@ policyengine_to_taxsim: text_description: "37. Property Tax Credit" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 special_cases: - mn: implemented: false @@ -497,7 +497,7 @@ policyengine_to_taxsim: text_description: "Rent credit" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 v38: variable: state_cdcc implemented: true @@ -507,7 +507,7 @@ policyengine_to_taxsim: text_description: "38. Child Care Credit" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 special_cases: - il: implemented: false @@ -521,7 +521,7 @@ policyengine_to_taxsim: text_description: "39. EIC" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 energy_fuel_credit: variable: na_pe implemented: false @@ -530,7 +530,7 @@ policyengine_to_taxsim: text_description: "Energy|Fuel Credit" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 ctc: variable: state_ctc implemented: true @@ -539,7 +539,7 @@ policyengine_to_taxsim: text_description: "Child Tax Credit" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 special_cases: - mn: implemented: false @@ -553,7 +553,7 @@ policyengine_to_taxsim: text_description: "40. Total Credits" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 variables: - state_non_refundable_credit - state_refundable_credits @@ -565,7 +565,7 @@ policyengine_to_taxsim: text_description: "Energy|Fuel Credit" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 general_food_low_inc_credit: variable: na_pe implemented: false @@ -574,7 +574,7 @@ policyengine_to_taxsim: text_description: "General/Food/Low Inc crd" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 amt: variable: na_pe implemented: false @@ -583,7 +583,7 @@ policyengine_to_taxsim: text_description: "AMT" group_order: 4 full_text_group: "State Tax Calculation" - group_column: 2 + group_column: 1 v42: variable: qualified_business_income_deduction implemented: true @@ -593,7 +593,7 @@ policyengine_to_taxsim: text_description: "42. QBI Deduction" group_order: 5 full_text_group: "TCJA 2018+" - group_column: 2 + group_column: 1 v43: variable: net_investment_income_tax implemented: true @@ -603,7 +603,7 @@ policyengine_to_taxsim: text_description: "Net Investment Income Tax" group_order: 6 full_text_group: "Additional Medicare Taxes 2013+" - group_column: 2 + group_column: 1 v44: variable: multiple_variable implemented: true @@ -612,7 +612,7 @@ policyengine_to_taxsim: text_description: "44. Medicare Tax on Earnings" group_order: 6 full_text_group: "Additional Medicare Taxes 2013+" - group_column: 2 + group_column: 1 variables: - employee_medicare_tax - additional_medicare_tax @@ -805,7 +805,7 @@ policyengine_to_taxsim: text_description: "FICA w Medicare (t,s)" group_order: 9 full_text_group: "Only Regular Tax Relevant" - group_column: 2 + group_column: 1 taxsim_to_policyengine: household_situation: diff --git a/policyengine_taxsim/core/output_mapper.py b/policyengine_taxsim/core/output_mapper.py index ef398eb..f1c7cff 100644 --- a/policyengine_taxsim/core/output_mapper.py +++ b/policyengine_taxsim/core/output_mapper.py @@ -99,7 +99,7 @@ def generate_text_description_output(taxsim_input, mappings, year, state_name, s line = f"{' ' * GROUP_MARGIN}{group_name}:" padding = ' ' * (LABEL_WIDTH + LABEL_INDENT - len(group_name) - 1) # -1 for the colon base_text = f"{'Base':>8}" - plus_one_text = f"{'+$1':>8}" + plus_one_text = f"{'':>8}" lines.append(f"{line}{padding}{base_text:>{VALUE_WIDTH}}{plus_one_text:>{SECOND_VALUE_WIDTH}}") else: # Group headers are 2 tabs left of text_description @@ -181,13 +181,6 @@ def taxsim_input_definition(data_dict, year, state_name): current_year = data_dict.get('year', year) output_lines.extend([ - "NBER TAXSIM @(#) $Version: 241116 With TCJA", - f"User modifications to tax law", - "", - f"State law coded through {current_year}", - "Later state laws extrapolated from that year.", - "Marginal rate not requested.", - "", " Input Data:" ])