Repository: PSLmodels/Tax-Calculator

Issue:
Rename SS_thd50 and SS_thd85 to SS_thd1 and SS_thd2
I think `SS_thd50` and `SS_thd85` are the only policy parameters with their default values in their name. This also diverges from `SS_percentage1` and `SS_percentage2` which are set to 0.5 and 0.85, respectively. Renaming the thresholds to `SS_thd1` and `SS_thd2` would be more consistent.

The variable descriptions also specify 50% and 85% in them, unlike other thresholds.

Discussion:
@TishaJhabak1014: @jdebacker Is this issue solved??@jdebacker: @TishaJhabak1014 This issue is still open.  It will make a change that is backwards incompatible.  I've created a new `v4_development` branch to merge the changes related to this issue into whenever someone decides to tackle it.

Solution patch:
diff --git a/taxcalc/calcfunctions.py b/taxcalc/calcfunctions.py
index a7069606..fb5f66e4 100644
--- a/taxcalc/calcfunctions.py
+++ b/taxcalc/calcfunctions.py
@@ -606,7 +606,7 @@ def CapGains(p23250, p22250, sep, ALD_StudentLoan_hc,
 
 
 @iterate_jit(nopython=True)
-def SSBenefits(MARS, ymod, e02400, SS_all_in_agi, SS_thd50, SS_thd85,
+def SSBenefits(MARS, ymod, e02400, SS_all_in_agi, SS_thd1, SS_thd2,
                SS_percentage1, SS_percentage2, c02500):
     """
     Calculates OASDI benefits included in AGI, c02500.
@@ -622,9 +622,9 @@ def SSBenefits(MARS, ymod, e02400, SS_all_in_agi, SS_thd50, SS_thd85,
         Total social security (OASDI) benefits
     SS_all_in_agi: bool
         Whether all social security benefits are included in AGI
-    SS_thd50: list
+    SS_thd1: list
         Threshold for social security benefit taxability (1)
-    SS_thd85: list
+    SS_thd2: list
         Threshold for social security benefit taxability (2)
     SS_percentage1: float
         Social security taxable income decimal fraction (1)
@@ -638,15 +638,15 @@ def SSBenefits(MARS, ymod, e02400, SS_all_in_agi, SS_thd50, SS_thd85,
     c02500: float
         Social security (OASDI) benefits included in AGI
     """
-    if ymod < SS_thd50[MARS - 1]:
+    if ymod < SS_thd1[MARS - 1]:
         c02500 = 0.
-    elif ymod < SS_thd85[MARS - 1]:
-        c02500 = SS_percentage1 * min(ymod - SS_thd50[MARS - 1], e02400)
+    elif ymod < SS_thd2[MARS - 1]:
+        c02500 = SS_percentage1 * min(ymod - SS_thd1[MARS - 1], e02400)
     else:
-        c02500 = min(SS_percentage2 * (ymod - SS_thd85[MARS - 1]) +
+        c02500 = min(SS_percentage2 * (ymod - SS_thd2[MARS - 1]) +
                      SS_percentage1 *
-                     min(e02400, SS_thd85[MARS - 1] -
-                         SS_thd50[MARS - 1]), SS_percentage2 * e02400)
+                     min(e02400, SS_thd2[MARS - 1] -
+                         SS_thd1[MARS - 1]), SS_percentage2 * e02400)
     if SS_all_in_agi:
         c02500 = e02400
     return c02500
diff --git a/taxcalc/policy.py b/taxcalc/policy.py
index dc570ac6..c2594ee0 100644
--- a/taxcalc/policy.py
+++ b/taxcalc/policy.py
@@ -63,6 +63,9 @@ class Policy(Parameters):
         'DependentCredit_before_CTC': 'is a removed parameter name',
         'FilerCredit_c': 'is a removed parameter name',
         'ALD_InvInc_ec_base_RyanBrady': 'is a removed parameter name',
+        # following parameters were renamed in PR 2918
+        'SS_thd50': 'has been renamed SS_thd1',
+        'SS_thd85': 'has been renamed SS_thd2',
         # following parameters renamed in PR 2345 merged on 2019-06-24
         'PT_excl_rt':
         'was renamed PT_qbid_rt in release 2.4.0',
diff --git a/taxcalc/policy_current_law.json b/taxcalc/policy_current_law.json
index c97ccd9e..d276838a 100644
--- a/taxcalc/policy_current_law.json
+++ b/taxcalc/policy_current_law.json
@@ -450,7 +450,7 @@
             "cps": true
         }
     },
-    "SS_thd50": {
+    "SS_thd1": {
         "title": "Threshold for Social Security benefit taxability 1",
         "description": "The first threshold for Social Security benefit taxability: if taxpayers have provisional income greater than this threshold, up to rate 1 of their Social Security benefit will be subject to tax under current law.",
         "notes": "",
@@ -489,7 +489,7 @@
         "validators": {
             "range": {
                 "min": 0,
-                "max": "SS_thd85"
+                "max": "SS_thd2"
             }
         },
         "compatible_data": {
@@ -523,7 +523,7 @@
             "cps": true
         }
     },
-    "SS_thd85": {
+    "SS_thd2": {
         "title": "Threshold for Social Security benefit taxability 2",
         "description": "The second threshold for Social Security taxability: if taxpayers have provisional income greater than this threshold, up to rate 2 of their Social Security benefit will be subject to tax under current law.",
         "notes": "",
@@ -561,7 +561,7 @@
         ],
         "validators": {
             "range": {
-                "min": "SS_thd50",
+                "min": "SS_thd1",
                 "max": 9e+99
             }
         },
diff --git a/taxcalc/reforms/Larson2019.json b/taxcalc/reforms/Larson2019.json
index e984c633..e835cdeb 100644
--- a/taxcalc/reforms/Larson2019.json
+++ b/taxcalc/reforms/Larson2019.json
@@ -8,12 +8,12 @@
 // - Make wage and self-employment income above $400,000 subject to FICA taxes (2)
 // - Phase in an increase to the contribution rate starting in 2020 (3)
 // Reform_Parameter_Map:
-// - 1: SS_thd50, SS_thd85
+// - 1: SS_thd1, SS_thd2
 // - 2: SS_Earnings_thd
 // - 3: FICA_ss_trt_employer, FICA_ss_trt_employee
 {
-    "SS_thd50": {"2019": [50000, 100000, 50000, 50000, 50000]},
-    "SS_thd85": {"2019": [50000, 100000, 50000, 50000, 50000]},
+    "SS_thd1": {"2019": [50000, 100000, 50000, 50000, 50000]},
+    "SS_thd2": {"2019": [50000, 100000, 50000, 50000, 50000]},
     "SS_Earnings_thd": {"2019": 400000},
     "FICA_ss_trt_employer": {"2020": 0.0625,
                              "2021": 0.063,


Test patch:
diff --git a/taxcalc/tests/reforms.json b/taxcalc/tests/reforms.json
index 5795e407..256f5ca7 100644
--- a/taxcalc/tests/reforms.json
+++ b/taxcalc/tests/reforms.json
@@ -49,8 +49,8 @@
   "6": {
       "baseline": "2017_law.json",
       "start_year": 2015,
-      "value": {"SS_thd50": [0, 0, 0, 0, 0],
-                "SS_thd85": [0, 0, 0, 0, 0],
+      "value": {"SS_thd1": [0, 0, 0, 0, 0],
+                "SS_thd2": [0, 0, 0, 0, 0],
                 "SS_percentage1": 1,
                 "SS_percentage2": 1},
       "name": "All OASDI benefits included in AGI",
diff --git a/taxcalc/tests/test_policy.py b/taxcalc/tests/test_policy.py
index 4b1f0aac..814533af 100644
--- a/taxcalc/tests/test_policy.py
+++ b/taxcalc/tests/test_policy.py
@@ -835,7 +835,7 @@ def test_reform_with_out_of_range_error():
     Try to use out-of-range values versus other parameter values in a reform.
     """
     pol = Policy()
-    reform = {'SS_thd85': {2020: [20000, 20000, 20000, 20000, 20000]}}
+    reform = {'SS_thd2': {2020: [20000, 20000, 20000, 20000, 20000]}}
     pol.implement_reform(reform, raise_errors=False)
     assert pol.parameter_errors
 
@@ -868,7 +868,7 @@ def test_reform_with_scalar_vector_errors():
     Test catching scalar-vector confusion.
     """
     policy1 = Policy()
-    reform1 = {'SS_thd85': {2020: 30000}}
+    reform1 = {'SS_thd2': {2020: 30000}}
     with pytest.raises(paramtools.ValidationError):
         policy1.implement_reform(reform1)
 
diff --git a/taxcalc/tests/test_reforms.py b/taxcalc/tests/test_reforms.py
index 8c772561..e2e52db2 100644
--- a/taxcalc/tests/test_reforms.py
+++ b/taxcalc/tests/test_reforms.py
@@ -37,7 +37,7 @@ def test_2017_law_reform(tests_path):
         # relation '>' implies asserting that actual > expect
         # ... parameters not affected by TCJA and that are not indexed
         'AMEDT_ec': {'relation': '=', 'value': 200000},
-        'SS_thd85': {'relation': '=', 'value': 34000},
+        'SS_thd2': {'relation': '=', 'value': 34000},
         # ... parameters not affected by TCJA and that are indexed
         'STD_Dep': {'relation': '>', 'value': 1050},
         'CG_brk2': {'relation': '>', 'value': 425400},