Skip to content

Commit

Permalink
Merge pull request #6 from ChemiKyle/hotfix/ACS2024_breakage
Browse files Browse the repository at this point in the history
Hotfix to work around breakage of non ACS2024 data
  • Loading branch information
ChemiKyle authored Sep 11, 2024
2 parents 072fc9a + fdd406a commit d96c3ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions CensusExternalModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,16 @@ function getSharedArgs($censusYear){
$censusYear = (int)$censusYear;
// NOTE: The US census is conducted every 10 years on years ending in 0
$mostRecentCensusYear = (int) (floor($censusYear / 10) * 10);
if ($mostRecentCensusYear !== $censusYear) {
// HACK: US Census site eliminated most vintages and benchmarks in August 2024
if (!in_array($censusYear, [2010, 2020])) { $censusYear = $mostRecentCensusYear; }
if ($mostRecentCensusYear == $censusYear) {
// NOTE: vintage Census<mostRecentCensusYear> is chosen for similarity to Census2020_Current scheme, namely the presence of data in "Census Blocks" field of API results
// see comments on related PR for further details
// https://github.com/vanderbilt-redcap/Census-Tract-Geocoding-External-Module/pull/4
$benchmark = "Public_AR_ACS{$censusYear}";
$vintage = "Census{$mostRecentCensusYear}_ACS{$censusYear}";
// HACK: At the release of ACS 2024, all other ACS benchmarks were eliminated as well as all non ACS2024 vintages
$ACS_year = 2024;
$benchmark = "Public_AR_ACS{$ACS_year}";
$vintage = "Census{$mostRecentCensusYear}_ACS{$ACS_year}";
} else {
$benchmark = "Public_AR_Current";
$vintage = "Census{$censusYear}_Current";
Expand Down
1 change: 0 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"type": "dropdown",
"developer_comment": "Please do not attempt to add a 'current' choice; despite census.gov supporting it, this has broken things in the past due to changes in their API",
"choices": [
{ "value": "2023", "name": "2023" },
{ "value": "2020", "name": "2020" },
{ "value": "2010", "name": "2010" }
]
Expand Down

0 comments on commit d96c3ab

Please sign in to comment.