diff --git a/prereise/gather/griddata/hifld/data_process/demand.py b/prereise/gather/griddata/hifld/data_process/demand.py index b0d63ff12..c61c6a0ae 100644 --- a/prereise/gather/griddata/hifld/data_process/demand.py +++ b/prereise/gather/griddata/hifld/data_process/demand.py @@ -47,7 +47,7 @@ def assign_demand_to_buses(substations, branch, plant, bus): substations["pop_ZIP"] = load_substations["ZIP"].map(zip_assigned_population) # Assign remaining county population to substations with load already, - # plus the most connected substation in any county without a load substation + # plus the most connected substation in any county without a load substation. load_subs_from_zips = substations.query("pop_ZIP > 0") load_subs_per_county = load_subs_from_zips.value_counts("COUNTYFIPS") county_pop = county_data["population"] @@ -68,8 +68,8 @@ def assign_demand_to_buses(substations, branch, plant, bus): distributed_pop = load_subs.groupby("COUNTYFIPS")["pop_ZIP"].sum() remaining_pop = county_pop - distributed_pop.reindex(county_pop.index).fillna(0) remaining_pop_per_sub = remaining_pop.clip(lower=0) / load_subs_per_county - # We may still miss some population, since there may be a county with zero - # substations, but we should cover the vast majority + # We may still miss some population, since there may be a county without any + # substations, but we should cover the vast majority. substations["pop_county"] = load_subs["COUNTYFIPS"].map(remaining_pop_per_sub) # Translate population to demand