Skip to content

Commit

Permalink
Black reformating
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Oct 5, 2023
1 parent a9c165b commit d65d365
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
3 changes: 1 addition & 2 deletions premise/data_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,10 @@ def __get_iam_data(
x.lower() if isinstance(x, str) else x for x in dataframe.columns
]

#print(dataframe["variable"].unique())
# print(dataframe["variable"].unique())

dataframe = dataframe.loc[dataframe["variable"].isin(variables)]


dataframe = dataframe.rename(columns={"variable": "variables"})

# make a list of headers that are integer
Expand Down
35 changes: 22 additions & 13 deletions premise/electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1658,24 +1658,34 @@ def create_region_specific_power_plants(self):
"Gas CHP CCS",
"Gas CC CCS",
"Oil CC CCS",
#"Oil ST",
#"Oil CC",
# "Oil ST",
# "Oil CC",
"Coal CF 80-20",
"Coal CF 50-50",
"Storage, Flow Battery",
"Storage, Hydrogen"
"Storage, Hydrogen",
]

list_datasets_to_duplicate = list(set([
dataset["name"]
for dataset in self.database
if dataset["name"]
in [y for k, v in self.powerplant_map.items()
for y in v
if k in techs]
]))
list_datasets_to_duplicate = list(
set(
[
dataset["name"]
for dataset in self.database
if dataset["name"]
in [
y
for k, v in self.powerplant_map.items()
for y in v
if k in techs
]
]
)
)

list_datasets_to_duplicate.insert(0,"hydrogen storage, for grid-balancing",)
list_datasets_to_duplicate.insert(
0,
"hydrogen storage, for grid-balancing",
)

list_datasets_to_duplicate.extend(
[
Expand All @@ -1695,7 +1705,6 @@ def create_region_specific_power_plants(self):
*[ws.contains("name", name) for name in list_datasets_to_duplicate]
),
):

new_plants = self.fetch_proxies(
name=dataset["name"],
ref_prod=dataset["reference product"],
Expand Down
8 changes: 4 additions & 4 deletions premise/steel.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ def create_steel_markets(self):
/ self.iam_data.production_volumes.sel(
variables=["steel - primary", "steel - secondary"],
region=[
x
for x in self.iam_data.production_volumes.region.values
if x != "World"
],
x
for x in self.iam_data.production_volumes.region.values
if x != "World"
],
)
.interp(year=self.year)
.sum(dim=["variables", "region"])
Expand Down

0 comments on commit d65d365

Please sign in to comment.