From 601023c9cc6fb269e07c08394ec212449a58a578 Mon Sep 17 00:00:00 2001 From: TJohnsonAZ Date: Tue, 21 May 2024 13:23:26 -0700 Subject: [PATCH] Bug fixes. --- epymorph/geo/adrio/census/adrio_census.py | 10 +++++----- epymorph/geo/dynamic.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epymorph/geo/adrio/census/adrio_census.py b/epymorph/geo/adrio/census/adrio_census.py index 6cc7355c..704235b7 100644 --- a/epymorph/geo/adrio/census/adrio_census.py +++ b/epymorph/geo/adrio/census/adrio_census.py @@ -345,7 +345,7 @@ def fetch_sf(self, scope: CensusScope) -> GeoDataFrame: sort_param = ['state', 'county', 'tract'] case TractScope('county', includes): - data_df = concat(tracts(state=s, county=c) + data_df = concat(tracts(state=s, county=c, year=scope.year) for s, c in map(COUNTY.decompose, includes)) data_df = data_df.rename( @@ -354,7 +354,7 @@ def fetch_sf(self, scope: CensusScope) -> GeoDataFrame: sort_param = ['state', 'county', 'tract'] case TractScope('tract', includes): - data_df = concat(tracts(state=s, county=c) + data_df = concat(tracts(state=s, county=c, year=scope.year) for s, c, t in map(TRACT.decompose, includes)) data_df = data_df.rename( @@ -374,7 +374,7 @@ def fetch_sf(self, scope: CensusScope) -> GeoDataFrame: sort_param = ['state', 'county', 'tract', 'block group'] case BlockGroupScope('county', includes): - data_df = concat(block_groups(state=s, county=c) + data_df = concat(block_groups(state=s, county=c, year=scope.year) for s, c in map(COUNTY.decompose, includes)) data_df = data_df.rename(columns={ @@ -383,7 +383,7 @@ def fetch_sf(self, scope: CensusScope) -> GeoDataFrame: sort_param = ['state', 'county', 'tract', 'block group'] case BlockGroupScope('tract', includes): - data_df = concat(block_groups(state=s, county=c) + data_df = concat(block_groups(state=s, county=c, year=scope.year) for s, c, t in map(TRACT.decompose, includes)) data_df = data_df.rename(columns={ @@ -395,7 +395,7 @@ def fetch_sf(self, scope: CensusScope) -> GeoDataFrame: sort_param = ['state', 'county', 'tract', 'block_group'] case BlockGroupScope('block group', includes): - data_df = concat(block_groups(state=s, county=c) + data_df = concat(block_groups(state=s, county=c, year=scope.year) for s, c, t, bg in map(BLOCK_GROUP.decompose, includes)) data_df = data_df.rename(columns={ diff --git a/epymorph/geo/dynamic.py b/epymorph/geo/dynamic.py index 93becdbd..8fa9b3b5 100644 --- a/epymorph/geo/dynamic.py +++ b/epymorph/geo/dynamic.py @@ -79,7 +79,7 @@ def __init__(self, spec: DynamicGeoSpec, adrios: dict[str, ADRIO]): raise ValueError("Geo must contain an attribute called 'label'.") self._adrios = adrios labels = self._adrios[LABEL.name].get_value() - super().__init__(spec, len(labels)) + super().__init__(spec, labels.size) # events self.fetch_start = Event()