Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 13, 2024
1 parent 0d5ecfe commit 211592b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
10 changes: 1 addition & 9 deletions config.bright.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,7 @@ custom_data:
custom_sectors: false
gas_network: false # If "True" then a custom .csv file must be placed in "resources/custom_data/pipelines.csv" , If "False" the user can choose btw "greenfield" or Model built-in datasets. Please refer to ["sector"] below.

rename_industry_carriers: {
"Electricity": "electricity",
"Biofuels": "solid biomass",
"Heat": "low-temperature heat",
"Natural Gas": "gas",
"Coal": "coal",
"Hydrogen": "hydrogen",
"Oil": "oil",
}
rename_industry_carriers: {"Electricity": "electricity", "Biofuels": "solid biomass", "Heat": "low-temperature heat", "Natural Gas": "gas", "Coal": "coal", "Hydrogen": "hydrogen", "Oil": "oil"}

costs: # Costs used in PyPSA-Earth-Sec. Year depends on the wildcard planning_horizon in the scenario section
version: v0.6.2
Expand Down
10 changes: 1 addition & 9 deletions config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,7 @@ custom_data:
custom_sectors: false
gas_network: false # If "True" then a custom .csv file must be placed in "resources/custom_data/pipelines.csv" , If "False" the user can choose btw "greenfield" or Model built-in datasets. Please refer to ["sector"] below.

rename_industry_carriers: {
"Electricity": "electricity",
"Biofuels": "solid biomass",
"Heat": "low-temperature heat",
"Natural Gas": "gas",
"Coal": "coal",
"Hydrogen": "hydrogen",
"Oil": "oil",
}
rename_industry_carriers: {"Electricity": "electricity", "Biofuels": "solid biomass", "Heat": "low-temperature heat", "Natural Gas": "gas", "Coal": "coal", "Hydrogen": "hydrogen", "Oil": "oil"}

costs: # Costs used in PyPSA-Earth-Sec. Year depends on the wildcard planning_horizon in the scenario section
version: v0.6.2
Expand Down
17 changes: 10 additions & 7 deletions scripts/build_industry_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def country_to_nodal(industrial_production, keys):
index_col=[0, 1],
)

industry_demand = industry_demand * 1e6 #TWh -> MWh and MtCO2 to tCO2
industry_demand = industry_demand * 1e6 # TWh -> MWh and MtCO2 to tCO2

keys_path = snakemake.input.industrial_distribution_key

Expand All @@ -110,20 +110,23 @@ def country_to_nodal(industrial_production, keys):
nodal_df_co = nodal_production_tom_co.dot(industry_base_totals_co.T)
nodal_df = pd.concat([nodal_df, nodal_df_co])


if snakemake.config["custom_data"]["rename_industry_carriers"]:

nodal_df.rename(columns=snakemake.config["custom_data"]["rename_industry_carriers"], inplace=True)

nodal_df.rename(
columns=snakemake.config["custom_data"]["rename_industry_carriers"],
inplace=True,
)

missing_carriers = set(all_carriers) - set(nodal_df.columns)
if missing_carriers:
_logger.warning("The following carriers are missing in the industy custom data {}".format(missing_carriers))
_logger.warning(
"The following carriers are missing in the industy custom data {}".format(
missing_carriers
)
)

if "process emissions" not in nodal_df.columns:
_logger.warning("No process emissions added to the custom industry data")


else:
no_years = int(snakemake.wildcards.planning_horizons) - int(
snakemake.params.base_year
Expand Down

0 comments on commit 211592b

Please sign in to comment.