Skip to content

Commit

Permalink
Eliminate duplicate state ids passed from adrio.
Browse files Browse the repository at this point in the history
  • Loading branch information
TJohnsonAZ committed Aug 27, 2024
1 parent 7b8c461 commit 87e6caa
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions epymorph/adrio/us_tiger.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def _get_geo(scope: CensusScope) -> GeoDataFrame:
case 'county':
gdf = get_counties_geo(year)
case 'tract':
gdf = get_tracts_geo(year, [STATE.extract(x)
for x in scope.get_node_ids()])
gdf = get_tracts_geo(year, list({STATE.extract(x)
for x in scope.get_node_ids()}))
case 'block group':
gdf = get_block_groups_geo(year, [STATE.extract(x)
for x in scope.get_node_ids()])
gdf = get_block_groups_geo(year, list({STATE.extract(x)
for x in scope.get_node_ids()}))
case x:
raise DataResourceException(
f"{x} is not a supported granularity for us_tiger attributes."
Expand All @@ -63,11 +63,11 @@ def _get_info(scope: CensusScope) -> DataFrame:
case 'county':
gdf = get_counties_info(year)
case 'tract':
gdf = get_tracts_info(year, [STATE.extract(x)
for x in scope.get_node_ids()])
gdf = get_tracts_info(year, list({STATE.extract(x)
for x in scope.get_node_ids()}))
case 'block group':
gdf = get_block_groups_info(year, [STATE.extract(x)
for x in scope.get_node_ids()])
gdf = get_block_groups_info(year, list({STATE.extract(x)
for x in scope.get_node_ids()}))
case x:
raise DataResourceException(
f"{x} is not a supported granularity for us_tiger attributes."
Expand Down

0 comments on commit 87e6caa

Please sign in to comment.