From 87e6caac114ad1480057e1e01f8a60872f41ed88 Mon Sep 17 00:00:00 2001 From: TJohnsonAZ Date: Tue, 27 Aug 2024 12:00:33 -0700 Subject: [PATCH] Eliminate duplicate state ids passed from adrio. --- epymorph/adrio/us_tiger.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/epymorph/adrio/us_tiger.py b/epymorph/adrio/us_tiger.py index 83b276cb..823a45c3 100644 --- a/epymorph/adrio/us_tiger.py +++ b/epymorph/adrio/us_tiger.py @@ -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." @@ -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."