autoformat
This commit is contained in:
parent
f38681f134
commit
d7f3f16a9b
@ -402,10 +402,9 @@ def add_heating_capacities_installed_before_baseyear(
|
|||||||
"""
|
"""
|
||||||
logger.debug(f"Adding heating capacities installed before {baseyear}")
|
logger.debug(f"Adding heating capacities installed before {baseyear}")
|
||||||
|
|
||||||
existing_heating = pd.read_csv(snakemake.input.existing_heating_distribution,
|
existing_heating = pd.read_csv(
|
||||||
header=[0,1],
|
snakemake.input.existing_heating_distribution, header=[0, 1], index_col=0
|
||||||
index_col=0)
|
)
|
||||||
|
|
||||||
|
|
||||||
techs = existing_heating.columns.get_level_values(1).unique()
|
techs = existing_heating.columns.get_level_values(1).unique()
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@ def build_existing_heating():
|
|||||||
# data is for buildings only (i.e. NOT district heating) and represents the year 2012
|
# data is for buildings only (i.e. NOT district heating) and represents the year 2012
|
||||||
# TODO start from original file
|
# TODO start from original file
|
||||||
|
|
||||||
existing_heating = pd.read_csv(snakemake.input.existing_heating,
|
existing_heating = pd.read_csv(
|
||||||
index_col=0,
|
snakemake.input.existing_heating, index_col=0, header=0
|
||||||
header=0)
|
)
|
||||||
|
|
||||||
# data for Albania, Montenegro and Macedonia not included in database
|
# data for Albania, Montenegro and Macedonia not included in database
|
||||||
existing_heating.loc["Albania"] = np.nan
|
existing_heating.loc["Albania"] = np.nan
|
||||||
@ -75,14 +75,17 @@ def build_existing_heating():
|
|||||||
nodal_sectoral_totals.sum(axis=1), axis=0
|
nodal_sectoral_totals.sum(axis=1), axis=0
|
||||||
)
|
)
|
||||||
|
|
||||||
nodal_heat_name_fraction = pd.DataFrame(index=district_heat_info.index,
|
nodal_heat_name_fraction = pd.DataFrame(index=district_heat_info.index, dtype=float)
|
||||||
dtype=float)
|
|
||||||
|
|
||||||
nodal_heat_name_fraction["urban central"] = 0.
|
nodal_heat_name_fraction["urban central"] = 0.0
|
||||||
|
|
||||||
for sector in sectors:
|
for sector in sectors:
|
||||||
nodal_heat_name_fraction[f"{sector} rural"] = nodal_sectoral_fraction[sector]*(1 - urban_fraction)
|
nodal_heat_name_fraction[f"{sector} rural"] = nodal_sectoral_fraction[
|
||||||
nodal_heat_name_fraction[f"{sector} urban decentral"] = nodal_sectoral_fraction[sector]*urban_fraction
|
sector
|
||||||
|
] * (1 - urban_fraction)
|
||||||
|
nodal_heat_name_fraction[f"{sector} urban decentral"] = (
|
||||||
|
nodal_sectoral_fraction[sector] * urban_fraction
|
||||||
|
)
|
||||||
|
|
||||||
nodal_heat_name_tech = pd.concat(
|
nodal_heat_name_tech = pd.concat(
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user