Repository: PolicyEngine/policyengine-us (language: python)

Issue:
Remove unused cliff gap parameters
This is necessary due to changes made in https://github.com/PolicyEngine/policyengine-us/pull/5322


Discussion / hints:

Fix patch:
diff --git a/changelog_entry.yaml b/changelog_entry.yaml
index e69de29bb2d..50f0da9b67c 100644
--- a/changelog_entry.yaml
+++ b/changelog_entry.yaml
@@ -0,0 +1,9 @@
+- bump: patch
+  changes:
+    changed:
+    - Changed formula for cliff_evaluated to use new marginal tax rate adults parameter.
+    - Updated cliff_gap test to use new marginal tax rate adults parameter.
+    removed:
+    - Unused cliff impact parameters.
+    added:
+    - New test to cliff_evaluated to demonstrate differences between adults and children in given household.
diff --git a/policyengine_us/parameters/simulation/cliff_adults.yaml b/policyengine_us/parameters/simulation/cliff_adults.yaml
deleted file mode 100644
index f8325987079..00000000000
--- a/policyengine_us/parameters/simulation/cliff_adults.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-description: Number of adults to simulate a marginal tax rate for, in each household.
-values:
-  0000-01-01: 3
-metadata:
-  unit: int
-  label: Number of adults to simulate a marginal tax rate for
diff --git a/policyengine_us/parameters/simulation/cliff_delta.yaml b/policyengine_us/parameters/simulation/cliff_delta.yaml
deleted file mode 100644
index 334c29498a3..00000000000
--- a/policyengine_us/parameters/simulation/cliff_delta.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-description: Employment income increase used to assess whether a person is on a tax-benefit cliff
-values:
-  0000-01-01: 500
-metadata:
-  unit: currency-USD
diff --git a/policyengine_us/variables/household/cliff.py b/policyengine_us/variables/household/cliff.py
index efdee4914c4..7756a397ec3 100644
--- a/policyengine_us/variables/household/cliff.py
+++ b/policyengine_us/variables/household/cliff.py
@@ -10,9 +10,11 @@ class cliff_evaluated(Variable):
 
     def formula(person, period, parameters):
         adult_index_values = person("adult_index", period)
-        cliff_adult_count = parameters(period).simulation.cliff_adults
+        mtr_adult_count = parameters(
+            period
+        ).simulation.marginal_tax_rate_adults
         is_adult = person("is_adult", period)
-        return is_adult & (adult_index_values <= cliff_adult_count)
+        return is_adult & (adult_index_values <= mtr_adult_count)
 
 
 class cliff_gap(Variable):


Test patch:
diff --git a/policyengine_us/tests/policy/baseline/household/cliff_evaluated.yaml b/policyengine_us/tests/policy/baseline/household/cliff_evaluated.yaml
index 764307b0cc7..fe9a4312347 100644
--- a/policyengine_us/tests/policy/baseline/household/cliff_evaluated.yaml
+++ b/policyengine_us/tests/policy/baseline/household/cliff_evaluated.yaml
@@ -1,5 +1,5 @@
 - name: cliff_evaluated unit test 1
-  period: 2021
+  period: 2024
   input:
     people:
       person1:
@@ -21,9 +21,9 @@
     cliff_evaluated: [true, true, false]
 
 - name: cliff_evaluated unit test 2
-  period: 2021
+  period: 2024
   input:
-    simulation.cliff_adults: 3
+    simulation.marginal_tax_rate_adults: 5
     people:
       person1:
         age: 40
@@ -42,3 +42,26 @@
         members: [person1, person2, person3]
   output:
     cliff_evaluated: [true, true, false]
+
+- name: cliff_evaluated unit test 3
+  period: 2024
+  input:
+    simulation.marginal_tax_rate_adults: 5
+    people:
+      person1:
+        age: 40
+      person2:
+        age: 39
+      person3:
+        age: 36
+    tax_units:
+      tax_unit:
+        members: [person1, person2, person3]
+    spm_units:
+      spm_unit:
+        members: [person1, person2, person3]
+    households:
+      household:
+        members: [person1, person2, person3]
+  output:
+    cliff_evaluated: [true, true, true]
diff --git a/policyengine_us/tests/policy/baseline/household/cliff_gap.yaml b/policyengine_us/tests/policy/baseline/household/cliff_gap.yaml
index b1892ca5c4e..b9baa0c2a27 100644
--- a/policyengine_us/tests/policy/baseline/household/cliff_gap.yaml
+++ b/policyengine_us/tests/policy/baseline/household/cliff_gap.yaml
@@ -65,7 +65,7 @@
   absolute_error_margin: 0.01
   period: 2021
   input:
-    simulation.cliff_delta: 1_000
+    simulation.marginal_tax_rate_delta: 1_000
     age: 70
     employment_income: 76_500
     rent: 24_000
@@ -131,7 +131,7 @@
   absolute_error_margin: 0.01
   period: 2021
   input:
-    simulation.cliff_delta: 1_000
+    simulation.marginal_tax_rate_delta: 1_000
     people:
       person1:
         age: 70