Skip to content

Compute PRCDA entire-state non-PRCDA list from prcda.csv - #231

Merged
depryf merged 2 commits into
masterfrom
prcda-changes-230
Nov 5, 2026
Merged

depryf merged 2 commits into
masterfrom
prcda-changes-230

Conversation

@depryf

@depryf depryf commented Nov 5, 2026

Copy link
Copy Markdown
Member

Closes #230

The hard-coded ENTIRE_STATE_NON_PRCDA list in PrcdaUtils got out of sync with prcda.csv (MD and TN now have PRCDA counties), so unknown counties for those states returned 0 instead of 9. The list is now computed in CountryData when the PRCDA data is initialized: 50 states + DC minus the states present in the CSV, plus territories, provinces and military codes.

The hard-coded ENTIRE_STATE_NON_PRCDA list in PrcdaUtils got out of sync
with prcda.csv (MD and TN now have PRCDA counties), so unknown counties
for those states returned 0 instead of 9. The list is now computed in
CountryData when the PRCDA data is initialized: 50 states + DC minus the
states present in the CSV, plus territories, provinces and military codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@depryf

depryf commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@howew do you mind reviewing the changes? Thanks.

@depryf
depryf requested a review from howew November 5, 2026 18:19
@howew

howew commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

We should probably factor in the ENTIRE_STATE_PRCDA list into the logic as well. There are states that don't have entries in the CSV, but we know all counties are PRCDA. That way there isn't any overlap between ENTIRE_STATE_PRCDA and ENTIRE_STATE_NON_PRCDA. Can you move the logic for ENTIRE_STATE_PRCDA into CountyData as well and factor it into the NON_PRCDA determination?

The logic checks ENTIRE_STATE_PRCDA first, so even if there is overlap it will give you the right value... but it probably shouldn't have overlap, just in case the order of those if statements is ever changed.

The entire-state PRCDA list now lives in CountryData next to the
non-PRCDA list, and those states are excluded when computing the
non-PRCDA list so the two can never overlap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@depryf

depryf commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Good call. I just made the change.

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@howew

howew commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Looks good to me!!

@depryf
depryf merged commit 71d8c41 into master Nov 5, 2026
4 checks passed
@depryf
depryf deleted the prcda-changes-230 branch November 5, 2026 19:03
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.

Update "ENTIRE_STATE_NON_PRCDA" Logic

2 participants