Skip to content

Commit

Permalink
Black reformating
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Mar 2, 2023
1 parent c0669ea commit db8f662
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions unfold/data_cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def check_for_duplicates(db: List[dict], data: List[dict]) -> List[dict]:
(x["name"].lower(), x["reference product"].lower(), x["location"])
for x in data
if (x["name"].lower(), x["reference product"].lower(), x["location"])
in db_names
in db_names
]

if len(already_exist) > 0:
Expand Down Expand Up @@ -328,9 +328,9 @@ def correct_fields_format(data: list, name: str) -> list:
dataset["parameters"] = [dataset["parameters"]]

if (
dataset["parameters"] is None
or dataset["parameters"] == {}
or dataset["parameters"] == []
dataset["parameters"] is None
or dataset["parameters"] == {}
or dataset["parameters"] == []
):
del dataset["parameters"]

Expand Down Expand Up @@ -377,8 +377,8 @@ def check_mandatory_fields(data: list) -> list:
for field in dataset_fields:
if field not in dataset:
if (
field in ["reference product", "location", "unit", "name"]
and "exchanges" in dataset
field in ["reference product", "location", "unit", "name"]
and "exchanges" in dataset
):
for exc in dataset["exchanges"]:
if exc["type"] == "production":
Expand Down
2 changes: 1 addition & 1 deletion unfold/fold.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
from . import __version__
from .data_cleaning import (
DATA_DIR,
check_commonality_between_databases,
check_mandatory_fields,
get_biosphere_code,
get_outdated_flows,
check_commonality_between_databases,
)

DIR_DATAPACKAGE_TEMP = DATA_DIR / "temp"
Expand Down
1 change: 0 additions & 1 deletion unfold/unfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,6 @@ def build_superstructure_database(self, matrix: np.ndarray) -> list:
def build_single_databases(
self, matrix, databases_to_build: List[dict]
) -> list[list[dict]]:

"""
Generate a list of single databases for each scenario specified in `databases_to_build`.
Expand Down

0 comments on commit db8f662

Please sign in to comment.