policyengine-us 1.387.2__py3-none-any.whl → 1.388.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of policyengine-us might be problematic. Click here for more details.

Files changed (52) hide show
  1. policyengine_us/parameters/gov/local/ca/riv/general_relief/age_threshold.yaml +12 -0
  2. policyengine_us/parameters/gov/local/ca/riv/general_relief/income/deductions/sources.yaml +16 -0
  3. policyengine_us/parameters/gov/local/ca/riv/general_relief/income/sources/earned.yaml +15 -0
  4. policyengine_us/parameters/gov/local/ca/riv/general_relief/income/sources/unearned.yaml +20 -0
  5. policyengine_us/parameters/gov/local/ca/riv/general_relief/needs_standards/food.yaml +21 -0
  6. policyengine_us/parameters/gov/local/ca/riv/general_relief/needs_standards/housing.yaml +21 -0
  7. policyengine_us/parameters/gov/local/ca/riv/general_relief/needs_standards/personal_needs.yaml +21 -0
  8. policyengine_us/parameters/gov/local/ca/riv/general_relief/needs_standards/special_needs/transportation.yaml +12 -0
  9. policyengine_us/parameters/gov/local/ca/riv/general_relief/property/limit.yaml +12 -0
  10. policyengine_us/parameters/gov/local/ca/riv/general_relief/property/sources.yaml +14 -0
  11. policyengine_us/parameters/gov/local/ca/riv/general_relief/property/vehicle_exemption/amount.yaml +11 -0
  12. policyengine_us/parameters/gov/local/ca/riv/general_relief/qualified_immigration_status.yaml +19 -0
  13. policyengine_us/parameters/gov/local/ca/riv/general_relief/work_exempted_age/older.yaml +12 -0
  14. policyengine_us/parameters/gov/local/ca/riv/general_relief/work_exempted_age/younger.yaml +12 -0
  15. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/ca_giv_general_relief_countable_income.yaml +58 -0
  16. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/ca_riv_general_relief_countable_vehicle_value.yaml +23 -0
  17. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/ca_riv_general_relief_excluded_income.yaml +19 -0
  18. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/ca_riv_general_relief_needs_standards.yaml +17 -0
  19. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_eligible.yaml +45 -0
  20. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_immigration_status_eligible.yaml +23 -0
  21. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_income_eligible.yaml +17 -0
  22. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_ineligible_person.yaml +43 -0
  23. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_meets_work_requirements.yaml +75 -0
  24. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_property_eligible.yaml +15 -0
  25. policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/integration.yaml +88 -0
  26. policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/capital_gains/mt_capital_gains_tax_joint.yaml +37 -0
  27. policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/integration.yaml +38 -0
  28. policyengine_us/variables/gov/local/ca/riv/general_relief/ca_riv_general_relief.py +16 -0
  29. policyengine_us/variables/gov/local/ca/riv/general_relief/ca_riv_general_relief_budget_unit_size.py +14 -0
  30. policyengine_us/variables/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_eligible.py +47 -0
  31. policyengine_us/variables/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_immigration_status_eligible.py +15 -0
  32. policyengine_us/variables/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_income_eligible.py +18 -0
  33. policyengine_us/variables/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_ineligible_person.py +25 -0
  34. policyengine_us/variables/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_meets_work_requirements.py +43 -0
  35. policyengine_us/variables/gov/local/ca/riv/general_relief/eligibility/ca_riv_general_relief_property_eligible.py +16 -0
  36. policyengine_us/variables/gov/local/ca/riv/general_relief/income/ca_riv_general_relief_countable_income.py +16 -0
  37. policyengine_us/variables/gov/local/ca/riv/general_relief/income/ca_riv_general_relief_countable_income_person.py +14 -0
  38. policyengine_us/variables/gov/local/ca/riv/general_relief/income/ca_riv_general_relief_excluded_income.py +22 -0
  39. policyengine_us/variables/gov/local/ca/riv/general_relief/income/ca_riv_general_relief_unearned_income.py +12 -0
  40. policyengine_us/variables/gov/local/ca/riv/general_relief/income/earned/ca_riv_general_relief_earned_income.py +12 -0
  41. policyengine_us/variables/gov/local/ca/riv/general_relief/income/earned/ca_riv_general_relief_earned_income_deductions.py +12 -0
  42. policyengine_us/variables/gov/local/ca/riv/general_relief/income/earned/ca_riv_general_relief_net_earned_income.py +17 -0
  43. policyengine_us/variables/gov/local/ca/riv/general_relief/payment/ca_riv_general_relief_needs_standards.py +24 -0
  44. policyengine_us/variables/gov/local/ca/riv/general_relief/payment/ca_riv_general_relief_special_needs_amount.py +14 -0
  45. policyengine_us/variables/gov/local/ca/riv/general_relief/property/ca_riv_general_relief_countable_property_value.py +12 -0
  46. policyengine_us/variables/gov/local/ca/riv/general_relief/property/ca_riv_general_relief_countable_vehicle_value.py +19 -0
  47. policyengine_us/variables/gov/states/mt/tax/income/capital_gains/mt_capital_gains_tax_joint.py +27 -9
  48. {policyengine_us-1.387.2.dist-info → policyengine_us-1.388.0.dist-info}/METADATA +1 -1
  49. {policyengine_us-1.387.2.dist-info → policyengine_us-1.388.0.dist-info}/RECORD +52 -8
  50. {policyengine_us-1.387.2.dist-info → policyengine_us-1.388.0.dist-info}/WHEEL +0 -0
  51. {policyengine_us-1.387.2.dist-info → policyengine_us-1.388.0.dist-info}/entry_points.txt +0 -0
  52. {policyengine_us-1.387.2.dist-info → policyengine_us-1.388.0.dist-info}/licenses/LICENSE +0 -0
@@ -2,6 +2,7 @@
2
2
  period: 2024
3
3
  input:
4
4
  long_term_capital_gains: 1_000
5
+ mt_taxable_income_joint: 1_000
5
6
  mt_capital_gains_tax_applicable_threshold_joint: 0
6
7
  filing_status: SINGLE
7
8
  state_code: MT
@@ -12,6 +13,7 @@
12
13
  period: 2024
13
14
  input:
14
15
  long_term_capital_gains: 1_000
16
+ mt_taxable_income_joint: 1_000
15
17
  mt_capital_gains_tax_applicable_threshold_joint: 2_000
16
18
  filing_status: SEPARATE
17
19
  state_code: MT
@@ -23,6 +25,7 @@
23
25
  period: 2024
24
26
  input:
25
27
  long_term_capital_gains: 3_000
28
+ mt_taxable_income_joint: 3_000
26
29
  mt_capital_gains_tax_applicable_threshold_joint: 2_000
27
30
  filing_status: SEPARATE
28
31
  state_code: MT
@@ -33,8 +36,42 @@
33
36
  period: 2023
34
37
  input:
35
38
  long_term_capital_gains: 3_000
39
+ mt_taxable_income_joint: 3_000
36
40
  mt_capital_gains_tax_applicable_threshold_joint: 2_000
37
41
  filing_status: JOINT
38
42
  state_code: MT
39
43
  output:
40
44
  mt_capital_gains_tax_joint: 0
45
+
46
+ - name: Taxable income below LTCG and below higher rate threshold
47
+ period: 2024
48
+ input:
49
+ long_term_capital_gains: 3_000
50
+ mt_taxable_income_joint: 1_000
51
+ mt_capital_gains_tax_applicable_threshold_joint: 2_000
52
+ filing_status: JOINT
53
+ state_code: MT
54
+ output:
55
+ mt_capital_gains_tax_joint: 30
56
+
57
+ - name: Taxable income below LTCG and above higher rate threshold
58
+ period: 2024
59
+ input:
60
+ long_term_capital_gains: 10_000
61
+ mt_taxable_income_joint: 3_000
62
+ mt_capital_gains_tax_applicable_threshold_joint: 2_000
63
+ filing_status: JOINT
64
+ state_code: MT
65
+ output:
66
+ mt_capital_gains_tax_joint: 101
67
+
68
+ - name: Taxable above above LTCG and above higher rate threshold
69
+ period: 2024
70
+ input:
71
+ long_term_capital_gains: 10_000
72
+ mt_taxable_income_joint: 12_000
73
+ mt_capital_gains_tax_applicable_threshold_joint: 2_000
74
+ filing_status: JOINT
75
+ state_code: MT
76
+ output:
77
+ mt_capital_gains_tax_joint: 410
@@ -252,3 +252,41 @@
252
252
  output:
253
253
  mt_files_separately: false
254
254
  mt_income_tax: 76_963
255
+
256
+ - name: taxsim_record_29826_2024.yaml
257
+ absolute_error_margin: 2
258
+ period: 2024
259
+ input:
260
+ people:
261
+ person1:
262
+ age: 77
263
+ employment_income: 0.0
264
+ qualified_dividend_income: 1804.41835
265
+ long_term_capital_gains: 19594.1835
266
+ taxable_interest_income: 1242.1687
267
+ is_tax_unit_head: true
268
+ person2:
269
+ age: 77
270
+ employment_income: 0.0
271
+ qualified_dividend_income: 1804.41835
272
+ long_term_capital_gains: 19594.1835
273
+ taxable_interest_income: 1242.1687
274
+ is_tax_unit_spouse: true
275
+ tax_units:
276
+ tax_unit:
277
+ members: [person1, person2]
278
+ premium_tax_credit: 0
279
+ local_income_tax: 0
280
+ state_sales_tax: 0
281
+ spm_units:
282
+ spm_unit:
283
+ members: [person1, person2]
284
+ snap: 0
285
+ tanf: 0
286
+ households:
287
+ household:
288
+ members: [person1, person2]
289
+ state_fips: 30
290
+ output:
291
+ mt_capital_gains_tax_joint: [59, 0]
292
+ mt_income_tax: 59
@@ -0,0 +1,16 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief(Variable):
5
+ value_type = float
6
+ entity = SPMUnit
7
+ unit = USD
8
+ label = "Riverside County General Relief"
9
+ definition_period = MONTH
10
+ defined_for = "ca_riv_general_relief_eligible"
11
+
12
+ adds = [
13
+ "ca_riv_general_relief_needs_standards",
14
+ "ca_riv_general_relief_special_needs_amount",
15
+ ]
16
+ subtracts = ["ca_riv_general_relief_countable_income"]
@@ -0,0 +1,14 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_budget_unit_size(Variable):
5
+ value_type = int
6
+ entity = SPMUnit
7
+ label = "Riverside County General Relief budget unit size"
8
+ definition_period = MONTH
9
+ defined_for = "in_riv"
10
+
11
+ # Ineligible persons in the SPM Unit cannot receive GR benefits.
12
+ # The number of ineligible person would never exceed the number of people in the SPM Unit.
13
+ adds = ["spm_unit_size"]
14
+ subtracts = ["ca_riv_general_relief_ineligible_person"]
@@ -0,0 +1,47 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_eligible(Variable):
5
+ value_type = bool
6
+ entity = SPMUnit
7
+ label = "Eligible for the Riverside County General Relief"
8
+ definition_period = MONTH
9
+ defined_for = "in_riv"
10
+
11
+ def formula(spm_unit, period, parameters):
12
+ p = parameters(period).gov.local.ca.riv.general_relief
13
+ age = spm_unit.members("monthly_age", period)
14
+ # Adults with dependent children under certain age are NOT eligible for GA.
15
+ # They should apply for CalWORKs (California's TANF) instead.
16
+ age_eligible = spm_unit.all(age >= p.age_threshold)
17
+
18
+ immigration_status_eligible = (
19
+ add(
20
+ spm_unit,
21
+ period,
22
+ ["ca_riv_general_relief_immigration_status_eligible"],
23
+ )
24
+ > 0
25
+ )
26
+ meets_work_requirements = (
27
+ add(
28
+ spm_unit,
29
+ period,
30
+ ["ca_riv_general_relief_meets_work_requirements"],
31
+ )
32
+ > 0
33
+ )
34
+ property_eligible = spm_unit(
35
+ "ca_riv_general_relief_property_eligible", period
36
+ )
37
+ income_eligible = spm_unit(
38
+ "ca_riv_general_relief_income_eligible", period
39
+ )
40
+
41
+ return (
42
+ age_eligible
43
+ & immigration_status_eligible
44
+ & property_eligible
45
+ & income_eligible
46
+ & meets_work_requirements
47
+ )
@@ -0,0 +1,15 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_immigration_status_eligible(Variable):
5
+ value_type = bool
6
+ entity = Person
7
+ label = "Eligible for the Riverside County General Relief due to immigration status"
8
+ definition_period = MONTH
9
+ defined_for = "in_riv"
10
+
11
+ def formula(person, period, parameters):
12
+ p = parameters(period).gov.local.ca.riv.general_relief
13
+ immigration_status = person("immigration_status", period)
14
+ immigration_status_str = immigration_status.decode_to_str()
15
+ return np.isin(immigration_status_str, p.qualified_immigration_status)
@@ -0,0 +1,18 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_income_eligible(Variable):
5
+ value_type = bool
6
+ entity = SPMUnit
7
+ label = "Eligible for the Riverside County General Relief due to income"
8
+ definition_period = MONTH
9
+ defined_for = "in_riv"
10
+
11
+ def formula(spm_unit, period, parameters):
12
+ countable_income = spm_unit(
13
+ "ca_riv_general_relief_countable_income", period
14
+ )
15
+ needs_standards = spm_unit(
16
+ "ca_riv_general_relief_needs_standards", period
17
+ )
18
+ return countable_income <= needs_standards
@@ -0,0 +1,25 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_ineligible_person(Variable):
5
+ value_type = bool
6
+ entity = Person
7
+ label = "Ineligible person for the Riverside County General Relief"
8
+ definition_period = MONTH
9
+ defined_for = "in_riv"
10
+
11
+ def formula(person, period, parameters):
12
+ receives_ssi_or_tanf = (
13
+ add(person.spm_unit, period, ["ssi", "ca_tanf"]) > 0
14
+ )
15
+ immigration_status_eligible = person(
16
+ "ca_riv_general_relief_immigration_status_eligible", period
17
+ )
18
+ meets_work_requirement = person(
19
+ "ca_riv_general_relief_meets_work_requirements", period
20
+ )
21
+ return (
22
+ receives_ssi_or_tanf
23
+ | ~immigration_status_eligible
24
+ | ~meets_work_requirement
25
+ )
@@ -0,0 +1,43 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_meets_work_requirements(Variable):
5
+ value_type = bool
6
+ entity = Person
7
+ label = "Meets work requirements for the Riverside County General Relief"
8
+ definition_period = MONTH
9
+ defined_for = "in_riv"
10
+
11
+ def formula(person, period, parameters):
12
+ p = parameters(
13
+ period
14
+ ).gov.local.ca.riv.general_relief.work_exempted_age
15
+ # Person who is actively searching for jobs also qualify for work requirements
16
+ is_working = (
17
+ add(
18
+ person, period, ["employment_income", "self_employment_income"]
19
+ )
20
+ > 0
21
+ )
22
+ # Check if person is a qualifying secondary school student
23
+ age = person("monthly_age", period)
24
+ is_full_time_student = person("is_full_time_student", period)
25
+ in_secondary_school = person("is_in_secondary_school", period)
26
+ is_qualifying_secondary_student = (
27
+ is_full_time_student & in_secondary_school
28
+ )
29
+ # Age-based exemptions have different thresholds based on student status:
30
+ # - Full-time secondary students: exempt if younger than threshold
31
+ # - Non-students: exempt if older than threshold (senior citizens)
32
+ work_exempted_due_to_age = where(
33
+ is_qualifying_secondary_student,
34
+ age < p.younger, # Student exemption: too young
35
+ age >= p.older, # Senior exemption: too old
36
+ )
37
+ # Incapacitated or need to caring full time for a member of household
38
+ has_incapable_of_self_care = person.spm_unit.any(
39
+ person("is_incapable_of_self_care", period)
40
+ )
41
+ return (
42
+ is_working | work_exempted_due_to_age | has_incapable_of_self_care
43
+ )
@@ -0,0 +1,16 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_property_eligible(Variable):
5
+ value_type = bool
6
+ entity = SPMUnit
7
+ label = "Meets property limit for Riverside County General Relief"
8
+ definition_period = YEAR
9
+ defined_for = "in_riv"
10
+
11
+ def formula(spm_unit, period, parameters):
12
+ p = parameters(period).gov.local.ca.riv.general_relief.property
13
+ total_property_value = spm_unit(
14
+ "ca_riv_general_relief_countable_property_value", period
15
+ )
16
+ return total_property_value < p.limit
@@ -0,0 +1,16 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_countable_income(Variable):
5
+ value_type = float
6
+ entity = SPMUnit
7
+ unit = USD
8
+ label = "Riverside County General Relief countable income"
9
+ definition_period = MONTH
10
+ defined_for = "in_riv"
11
+
12
+ # This value cannot be negative because the exclusion is calculated
13
+ # as a fraction of the excluded person's income, determined by
14
+ # household size and the number of applicants.
15
+ adds = ["ca_riv_general_relief_countable_income_person"]
16
+ subtracts = ["ca_riv_general_relief_excluded_income"]
@@ -0,0 +1,14 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_countable_income_person(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ unit = USD
8
+ label = "Person's countable income before proration"
9
+ definition_period = MONTH
10
+
11
+ adds = [
12
+ "ca_riv_general_relief_net_earned_income",
13
+ "ca_riv_general_relief_unearned_income",
14
+ ]
@@ -0,0 +1,22 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_excluded_income(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ unit = USD
8
+ label = "Income amount excluded from ineligible household members due to proration under Riverside County General Relief Program"
9
+ definition_period = MONTH
10
+ defined_for = "ca_riv_general_relief_ineligible_person"
11
+
12
+ def formula(person, period, parameters):
13
+ income = person(
14
+ "ca_riv_general_relief_countable_income_person", period
15
+ )
16
+ spm_unit = person.spm_unit
17
+ needs_unit_size = spm_unit("spm_unit_size", period)
18
+ budget_unit_size = spm_unit(
19
+ "ca_riv_general_relief_budget_unit_size", period
20
+ )
21
+ exclusion_rate = (needs_unit_size - budget_unit_size) / needs_unit_size
22
+ return exclusion_rate * income
@@ -0,0 +1,12 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_unearned_income(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ unit = USD
8
+ label = "Riverside County General Relief unearned income per person"
9
+ definition_period = MONTH
10
+ defined_for = "in_riv"
11
+
12
+ adds = "gov.local.ca.riv.general_relief.income.sources.unearned"
@@ -0,0 +1,12 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_earned_income(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ unit = USD
8
+ label = "Riverside County General Relief earned income per person"
9
+ definition_period = MONTH
10
+ defined_for = "in_riv"
11
+
12
+ adds = "gov.local.ca.riv.general_relief.income.sources.earned"
@@ -0,0 +1,12 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_earned_income_deductions(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ unit = USD
8
+ label = "Riverside County General Relief earned income deductions"
9
+ definition_period = MONTH
10
+ defined_for = "in_riv"
11
+
12
+ adds = "gov.local.ca.riv.general_relief.income.deductions.sources"
@@ -0,0 +1,17 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_net_earned_income(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ unit = USD
8
+ label = "Riverside County GA net earned income after deductions"
9
+ definition_period = MONTH
10
+
11
+ def formula(person, period, parameters):
12
+ earned = person("ca_riv_general_relief_earned_income", period)
13
+ deductions = person(
14
+ "ca_riv_general_relief_earned_income_deductions", period
15
+ )
16
+
17
+ return max_(earned - deductions, 0)
@@ -0,0 +1,24 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_needs_standards(Variable):
5
+ value_type = float
6
+ entity = SPMUnit
7
+ unit = USD
8
+ label = "Riverside County General Relief needs standards"
9
+ definition_period = MONTH
10
+ defined_for = "in_riv"
11
+
12
+ def formula(spm_unit, period, parameters):
13
+ p = parameters(period).gov.local.ca.riv.general_relief.needs_standards
14
+ size = spm_unit("ca_riv_general_relief_budget_unit_size", period)
15
+ capped_size = clip(size, 1, 5)
16
+ # Verify the housing cost using the DPSS 1140, GA Housing Information/Verification,
17
+ # or any other sufficient verification, such as lease agreement
18
+ housing_expense = spm_unit("housing_cost", period)
19
+ capped_housing_benefit = min_(housing_expense, p.housing[capped_size])
20
+ return (
21
+ capped_housing_benefit
22
+ + p.food[capped_size]
23
+ + p.personal_needs[capped_size]
24
+ )
@@ -0,0 +1,14 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_special_needs_amount(Variable):
5
+ value_type = float
6
+ entity = SPMUnit
7
+ unit = USD
8
+ label = "Riverside County General Relief special needs amount"
9
+ definition_period = YEAR
10
+ defined_for = "in_riv"
11
+
12
+ adds = [
13
+ "gov.local.ca.riv.general_relief.needs_standards.special_needs.transportation"
14
+ ]
@@ -0,0 +1,12 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_countable_property_value(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ unit = USD
8
+ label = "Riverside County General Relief countable property value"
9
+ definition_period = YEAR
10
+ defined_for = "in_riv"
11
+
12
+ adds = "gov.local.ca.riv.general_relief.property.sources"
@@ -0,0 +1,19 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class ca_riv_general_relief_countable_vehicle_value(Variable):
5
+ value_type = float
6
+ entity = SPMUnit
7
+ unit = USD
8
+ label = "Riverside County General Relief countable vehicle value"
9
+ definition_period = YEAR
10
+ defined_for = "in_riv"
11
+
12
+ def formula(spm_unit, period, parameters):
13
+ p = parameters(
14
+ period
15
+ ).gov.local.ca.riv.general_relief.property.vehicle_exemption
16
+ total_vehicle_value = spm_unit.household(
17
+ "household_vehicles_value", period
18
+ )
19
+ return max_(total_vehicle_value - p.amount, 0)
@@ -14,8 +14,22 @@ class mt_capital_gains_tax_joint(Variable):
14
14
  p = parameters(period).gov.states.mt.tax.income.main.capital_gains
15
15
  # the tax for capital gains comes into effect after 2024
16
16
  if p.in_effect:
17
+ # Line instructions from the 2024 Montana Individual Income Tax Return Form 2
18
+ # https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2/2024_Montana_Individual_Income_Tax_Return_Form_2.pdf#page=2
19
+ # Line 1
20
+ taxable_income = person("mt_taxable_income_joint", period)
21
+ # Line 2
17
22
  capital_gains = person("long_term_capital_gains", period)
23
+ # Line 3
24
+ lesser_of_cg_and_taxable_income = min_(
25
+ capital_gains, taxable_income
26
+ )
27
+ # Line 4
28
+ excess_over_taxable_income = max_(
29
+ taxable_income - lesser_of_cg_and_taxable_income, 0
30
+ )
18
31
  filing_status = person.tax_unit("filing_status", period)
32
+ # Line 5
19
33
  applicable_threshold = person(
20
34
  "mt_capital_gains_tax_applicable_threshold_joint", period
21
35
  )
@@ -53,21 +67,25 @@ class mt_capital_gains_tax_joint(Variable):
53
67
  p.rates.head_of_household.amounts[-1],
54
68
  ],
55
69
  )
56
- # Calculate taxes
57
- capital_gains_below_threshold = min_(
58
- applicable_threshold, capital_gains
70
+ # Line 6
71
+ excess_over_threshold = max_(
72
+ applicable_threshold - excess_over_taxable_income, 0
59
73
  )
60
- capital_gains_above_threshold = max_(
61
- capital_gains - applicable_threshold, 0
74
+ # Line 7
75
+ capital_gains_below_threshold = min_(
76
+ excess_over_threshold, lesser_of_cg_and_taxable_income
62
77
  )
63
-
78
+ # Line 8
64
79
  lower_capital_gains_tax = (
65
80
  capital_gains_below_threshold * lower_rate
66
81
  )
67
- higher_capital_gains_tax = (
68
- capital_gains_above_threshold * higher_rate
82
+ # Line 9
83
+ income_above_threshold = max_(
84
+ lesser_of_cg_and_taxable_income - excess_over_threshold, 0
69
85
  )
70
-
86
+ # Line 10
87
+ higher_capital_gains_tax = income_above_threshold * higher_rate
88
+ # Line 11
71
89
  return lower_capital_gains_tax + higher_capital_gains_tax
72
90
 
73
91
  return 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: policyengine-us
3
- Version: 1.387.2
3
+ Version: 1.388.0
4
4
  Summary: Add your description here.
5
5
  Author-email: PolicyEngine <hello@policyengine.org>
6
6
  License-File: LICENSE