Skip to content

Commit

Permalink
Black reformating
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Jun 23, 2024
1 parent 8b668f2 commit 2b58d2f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
28 changes: 15 additions & 13 deletions premise/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import uuid
from collections import defaultdict
from functools import lru_cache
from pathlib import Path
from typing import List, Union

Expand All @@ -14,7 +15,6 @@
import yaml
from datapackage import Package
from wurst import searching as ws
from functools import lru_cache

from .activity_maps import InventorySet
from .clean_datasets import get_biosphere_flow_uuid
Expand Down Expand Up @@ -514,8 +514,6 @@ def regionalize_inventories(self, ds_names, regions, data: dict) -> None:
self.write_log(act)
self.add_to_index(act)



# some datasets might be meant to replace the supply
# of other datasets, so we need to adjust those
replacing_acts = {
Expand Down Expand Up @@ -912,14 +910,14 @@ def write_suppliers_exchanges(self, suppliers: dict, supply_share: float) -> lis

@lru_cache()
def add_additional_exchanges(
self,
name: str,
ref_prod: str,
categories: tuple,
unit: str,
amount: float,
region: str,
ei_version: str
self,
name: str,
ref_prod: str,
categories: tuple,
unit: str,
amount: float,
region: str,
ei_version: str,
) -> list:
"""
Add additional exchanges to a dataset.
Expand Down Expand Up @@ -1244,12 +1242,16 @@ def create_markets(self) -> None:
for additional_exc in market_vars["add"]:
add_excs = self.add_additional_exchanges(
name=additional_exc["name"],
ref_prod=additional_exc.get("reference product"),
ref_prod=additional_exc.get(
"reference product"
),
categories=additional_exc.get("categories"),
unit=additional_exc.get("unit"),
amount=additional_exc.get("amount"),
region=region,
ei_version=dp.descriptor["ecoinvent"]["version"],
ei_version=dp.descriptor["ecoinvent"][
"version"
],
)
new_market["exchanges"].extend(add_excs)

Expand Down
6 changes: 5 additions & 1 deletion premise/external_data_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ def find_iam_efficiency_change(


def flag_activities_to_adjust(
dataset: dict, scenario_data: dict, year: int, dataset_vars: dict, region_proxy_mapping=None
dataset: dict,
scenario_data: dict,
year: int,
dataset_vars: dict,
region_proxy_mapping=None,
) -> dict:
"""
Flag datasets that will need to be adjusted.
Expand Down

0 comments on commit 2b58d2f

Please sign in to comment.