Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorb1 committed Nov 27, 2024
1 parent 6301a76 commit 7fc97ef
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
13 changes: 8 additions & 5 deletions workflow/scripts/osemosys_global/storage/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ def main(
max_cap_invest_storage = max_cap_invest_base.copy()
tech_set = tech_set_base.copy()
storage_set = pd.DataFrame(columns=["VALUE"])
tech_to_storage = pd.DataFrame(columns=["REGION","TECHNOLOGY","STORAGE","MODE_OF_OPERATION"])
tech_from_storage = pd.DataFrame(columns=["REGION","TECHNOLOGY","STORAGE","MODE_OF_OPERATION"])
tech_to_storage = pd.DataFrame(columns=["REGION","TECHNOLOGY","STORAGE","MODE_OF_OPERATION", "VALUE"])
tech_from_storage = pd.DataFrame(columns=["REGION","TECHNOLOGY","STORAGE","MODE_OF_OPERATION", "VALUE"])
res_cap = res_cap_base.copy()
res_cap_storage = pd.DataFrame(columns=["REGION", "STORAGE", "YEAR"])
storage_level_start = pd.DataFrame(columns=["REGION", "STORAGE"])
res_cap_storage = pd.DataFrame(columns=["REGION", "STORAGE", "YEAR", "VALUE"])
storage_level_start = pd.DataFrame(columns=["REGION", "STORAGE", "VALUE"])
tech_capacity_sto = None

else:
Expand Down Expand Up @@ -312,7 +312,10 @@ def main(

# SET INPUT DATA

sto_techs = list(storage_parameters.keys())
if storage_parameters:
sto_techs = list(storage_parameters.keys())
else:
sto_techs = None

build_rates = import_storage_build_rates(file_storage_build_rates)

Expand Down
5 changes: 4 additions & 1 deletion workflow/scripts/osemosys_global/summary/carbon_intensity.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def calculate_emission_intensity(
save = "results/India/results/AnnualEmissionIntensity.csv"
storage = {"SDS": [], "LDS": []}

exclusions = list(storage)
if storage:
exclusions = list(storage)
else:
exclusions = []

production = pd.read_csv(production_csv, index_col=[0, 1, 2, 3, 4])
annual_emissions = pd.read_csv(annual_emissions_csv, index_col=[0, 1, 2])
Expand Down
5 changes: 4 additions & 1 deletion workflow/scripts/osemosys_global/summary/gen_shares.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ def calc_generation_shares_country(
production_by_technology_annual_csv, index_col=[0, 1, 2, 3]
)

exclusions = list(storage)
if storage:
exclusions = list(storage)
else:
exclusions = []

nodes = calc_generation_shares_node(production_by_technology_annual, exclusions)
country = calc_generation_shares_country(
Expand Down
6 changes: 5 additions & 1 deletion workflow/scripts/osemosys_global/summary/headline.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ def get_gen_shares(
)
total_discounted_cost = pd.read_csv(total_discounted_cost_csv, index_col=[0, 1])
demand = pd.read_csv(demand_csv, index_col=[0, 1, 2, 3])
exclusions = list(storage)

if storage:
exclusions = list(storage)
else:
exclusions = []

dfs = []

Expand Down

0 comments on commit 7fc97ef

Please sign in to comment.