Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pathways' into pathways
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarojhahn committed Jul 30, 2024
2 parents 77d64bf + ac5d3e1 commit ebc2c2a
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions premise/wind_turbines.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def create_direct_drive_turbines(self):
construction_datasets = self.create_construction_datasets()
self.database.extend(construction_datasets)

market_datasets = self.create_market_datasets(dataset_copy, construction_datasets)
market_datasets = self.create_market_datasets(
dataset_copy, construction_datasets
)
self.database.extend(market_datasets)

self.update_production_dataset_links(dataset_copy, market_datasets)
Expand Down Expand Up @@ -121,13 +123,14 @@ def create_construction_datasets(self):
"wind power plant construction, 2MW, offshore, moving parts",
"wind turbine construction, 4.5MW, onshore",
"wind turbine construction, 2MW, onshore",

]

construction_datasets = []
for name in construction_names:
construction_dataset = ws.get_one(self.database, ws.equals("name", name))
construction_dataset_copy = self.create_dataset_copy(construction_dataset, "direct drive")
construction_dataset_copy = self.create_dataset_copy(
construction_dataset, "direct drive"
)
construction_datasets.append(construction_dataset_copy)

return construction_datasets
Expand All @@ -137,20 +140,24 @@ def create_market_datasets(self, parent_dataset, construction_datasets):
"market for wind power plant, 800kW, moving parts",
"market for wind power plant, 2MW, offshore, moving parts",
"market for wind turbine, 4.5MW, onshore",
"market for wind turbine, 2MW, onshore"
"market for wind turbine, 2MW, onshore",
]

product_names = [
"wind power plant, 800kW, moving parts",
"wind power plant, 2MW, offshore, moving parts",
"wind turbine, 4.5MW, onshore",
"wind turbine, 2MW, onshore"
"wind turbine, 2MW, onshore",
]

market_datasets = []
for market_name, product_name, construction_dataset in zip(market_names, product_names, construction_datasets):
for market_name, product_name, construction_dataset in zip(
market_names, product_names, construction_datasets
):
market_dataset = ws.get_one(self.database, ws.equals("name", market_name))
market_dataset_copy = self.create_dataset_copy(market_dataset, "direct drive")
market_dataset_copy = self.create_dataset_copy(
market_dataset, "direct drive"
)

for exc in ws.technosphere(market_dataset_copy):
if exc["product"] == product_name:
Expand All @@ -165,7 +172,9 @@ def create_market_datasets(self, parent_dataset, construction_datasets):
@staticmethod
def update_production_dataset_links(production_dataset, market_datasets):
for market_dataset in market_datasets:
market_product = [exc for exc in ws.production(market_dataset)][0]["product"]
market_product = [exc for exc in ws.production(market_dataset)][0][
"product"
]
market_name = market_dataset["name"]
for exc in ws.technosphere(production_dataset):
if exc["product"] == market_product:
Expand Down

0 comments on commit ebc2c2a

Please sign in to comment.