Skip to content

Commit

Permalink
doc: tweak multi-line comment format
Browse files Browse the repository at this point in the history
  • Loading branch information
danielolsen committed Oct 29, 2021
1 parent d1bdc86 commit ed5b489
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prereise/gather/griddata/hifld/data_process/demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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
Expand Down

0 comments on commit ed5b489

Please sign in to comment.