Skip to content

Commit

Permalink
Black reformating
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Oct 27, 2023
1 parent c7e3d14 commit a5b682e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions unfold/data_cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def get_outdated_flows() -> dict:

return flows


def get_outdated_units() -> dict:
"""
Retrieve a list of outdated flows from the outdated flows file.
Expand Down
31 changes: 15 additions & 16 deletions unfold/unfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,9 @@ def fix_key(self, key: tuple) -> tuple:
else:
# try first by searching for alternative units
if key[4] in self.outdated_units:
print(f"found alternative unit: {key[4]}. Changing to {self.outdated_units[key[4]]}")
print(
f"found alternative unit: {key[4]}. Changing to {self.outdated_units[key[4]]}"
)
if (
key[0],
key[1],
Expand All @@ -502,14 +504,16 @@ def fix_key(self, key: tuple) -> tuple:
self.outdated_units[key[4]],
key[5],
) in self.dependency_mapping:
return self.dependency_mapping[(
key[0],
key[1],
key[2],
key[3],
self.outdated_units[key[4]],
key[5],
)]
return self.dependency_mapping[
(
key[0],
key[1],
key[2],
key[3],
self.outdated_units[key[4]],
key[5],
)
]

correct_id = self.find_correct_id(key)
if correct_id is None:
Expand Down Expand Up @@ -1064,9 +1068,7 @@ def format_superstructure_dataframe(self) -> None:
"production",
)
if consumer_key in self.reversed_acts_indices:
consumer_idx = self.reversed_acts_indices[
consumer_key
]
consumer_idx = self.reversed_acts_indices[consumer_key]
else:
consumer_key = (
c_name,
Expand All @@ -1078,9 +1080,7 @@ def format_superstructure_dataframe(self) -> None:
)

if consumer_key in self.reversed_acts_indices:
consumer_idx = self.reversed_acts_indices[
consumer_key
]
consumer_idx = self.reversed_acts_indices[consumer_key]
else:
print("not found key for consumer ", consumer_key)
consumer_idx = 0
Expand Down Expand Up @@ -1112,7 +1112,6 @@ def format_superstructure_dataframe(self) -> None:
s_type,
)
except TypeError:

supplier_key = (
s_name,
s_prod,
Expand Down

0 comments on commit a5b682e

Please sign in to comment.