Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
cmutel committed Sep 10, 2024
1 parent e0a11df commit 760109d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bw_simapro_csv/brightway.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ def name_for_process(process: Process, missing_string: str) -> str:
if given_name := substitute_unspecified(process.parsed["metadata"].get("Process name")):
return given_name
if "Products" in process.blocks:
names = [edge['name'] for edge in process.blocks["Products"].parsed]
names = [edge["name"] for edge in process.blocks["Products"].parsed]
if len(names) == 1:
return names[0]
else:
return "MFP: {}".format("⧺".join([name[:25] for name in names]))
if "Waste treatment" in process.blocks:
names = [edge['name'] for edge in process.blocks["Waste treatment"].parsed]
names = [edge["name"] for edge in process.blocks["Waste treatment"].parsed]
if len(names) == 1:
return names[0]
else:
Expand Down
2 changes: 1 addition & 1 deletion bw_simapro_csv/cas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from numbers import Number
import numpy as np
from typing import Any, Optional

import numpy as np
from loguru import logger


Expand Down
2 changes: 0 additions & 2 deletions bw_simapro_csv/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"decimal separator:": "decimal_separator",
"open project:": "open_project",
"selection:": "selection",

# These labels can be translated; who knows why these and not others!?
"project": "project",
"projet": "project",
Expand All @@ -36,7 +35,6 @@
"projeto": "project",
"progetto": "project",
"projekt": "project",

"open library": "open_library",
"ouvrir bibliothèque": "open_library", # This doesn't feel correct but it's in the files
"ouvrir projet": "open_project", # I made this one up
Expand Down
1 change: 1 addition & 0 deletions bw_simapro_csv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def noquotes(s: str) -> str:
s = s[1:-1]
return s


YES_STRINGS = {"yes", "y", "true", "t", "1", "ja", "oui", "tá", "si", "sim", "sì", "kyllä"}
NO_STRINGS = {"no", "n", "false", "f", "0", "nein", "non", "nee", "níl", "não", "nej", "nei", "ei"}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def test_header_extraction_translation(fixtures_dir):
"selection": "Selection (18557)",
"open_project": None,
"exclude_library_processes": None,
"open_library": 'AGRIBALYSE - Unit',
"open_library": "AGRIBALYSE - Unit",
"date_separator": "/",
"export_platform_ids": False,
"skip_empty_fields": False,
Expand Down

0 comments on commit 760109d

Please sign in to comment.