Skip to content

Fix Alameda County name string in in_ala#8594

Merged
hua7450 merged 1 commit into
PolicyEngine:mainfrom
hua7450:fix-in-ala-county-string
Jun 6, 2026
Merged

Fix Alameda County name string in in_ala#8594
hua7450 merged 1 commit into
PolicyEngine:mainfrom
hua7450:fix-in-ala-county-string

Conversation

@hua7450
Copy link
Copy Markdown
Collaborator

@hua7450 hua7450 commented Jun 6, 2026

Summary

in_ala checks whether a household is in Alameda County, CA. Its formula compared county_str against the literal "Alameda_COUNTY_CA", but county_str returns the county enum name — which is ALAMEDA_COUNTY_CA (all caps), matching the convention used by every other county (LOS_ANGELES_COUNTY_CA, RIVERSIDE_COUNTY_CA, etc.). The mixed-case literal never matched, so the formula never identified Alameda County.

This corrects the string to "ALAMEDA_COUNTY_CA".

Note on behavior

county defaults to first_county_in_state, which is the alphabetically-first county in the state — for CA that is Alameda. So CA households that do not explicitly set a county/county_fips now resolve to in_ala == True and become eligible for Alameda General Assistance (defined_for = "in_ala") in microsimulation contexts. This is the intended correction of the string bug.

Files

  • policyengine_us/variables/gov/local/ca/ala/in_ala.py

🤖 Generated with Claude Code

county_str returns the county enum name, which is ALAMEDA_COUNTY_CA
(all caps). The formula compared against "Alameda_COUNTY_CA", which
never matched. Correct the literal to match the enum name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.77%. Comparing base (623b849) to head (bd1ae42).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...licyengine_us/variables/gov/local/ca/ala/in_ala.py 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (623b849) and HEAD (bd1ae42). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (623b849) HEAD (bd1ae42)
unittests 2 1
Additional details and impacted files
@@             Coverage Diff              @@
##              main    #8594       +/-   ##
============================================
- Coverage   100.00%   77.77%   -22.23%     
============================================
  Files            2        1        -1     
  Lines           34        9       -25     
============================================
- Hits            34        7       -27     
- Misses           0        2        +2     
Flag Coverage Δ
unittests 77.77% <0.00%> (-22.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hua7450 hua7450 merged commit 0d1515b into PolicyEngine:main Jun 6, 2026
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant