Skip to content

Commit 82a5af0

Browse files
committed
Remove loguru
1 parent f7f5aa1 commit 82a5af0

4 files changed

Lines changed: 6 additions & 13 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,4 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
pyrightconfig.json

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ dependencies = [
3737
"pyecospold",
3838
"randonneur>=0.6",
3939
"randonneur_data",
40+
"structlog",
4041
"tqdm",
4142
"typer",
4243
"xmltodict",

src/flowmapper/extraction/simapro_csv.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from pathlib import Path
33

44
import bw_simapro_csv
5-
from loguru import logger
5+
import structlog
6+
7+
logger = structlog.get_logger("filemapper")
68

79

810
def is_simapro_csv_file(fp: Path) -> bool:
@@ -14,7 +16,7 @@ def is_simapro_csv_file(fp: Path) -> bool:
1416
].project
1517
return True
1618
except:
17-
logger.critical("Skipping {a} as we can't read it as a SimaPro file", a=fp.name)
19+
logger.critical("Skipping file %s as we can't read it as a SimaPro file", fp.name)
1820
return False
1921

2022

src/flowmapper/extraction/simapro_ecospold1.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22
from pathlib import Path
33

44
import pyecospold
5-
from loguru import logger
6-
7-
# def is_simapro_csv_file(fp: Path) -> bool:
8-
# if not fp.is_file() or not fp.suffix.lower() == ".csv":
9-
# return False
10-
# try:
11-
# bw_simapro_csv.header.parse_header(open(fp, encoding="sloppy-windows-1252"))[0].project
12-
# return True
13-
# except:
14-
# logger.critical("Skipping {a} as we can't read it as a SimaPro file", a=fp.name)
15-
# return False
165

176

187
def simapro_ecospold1_biosphere_extractor(dirpath: Path, output_fp: Path) -> None:

0 commit comments

Comments
 (0)