🧹 Make process_dir() keyword arguments keyword-only

pull/111/head
Mike Gerber 9 months ago
parent 945aec5673
commit 932bfafc7d

@ -187,7 +187,7 @@ def process(
def process_dir(
gt, ocr, report_prefix, reports_folder, metrics, differences, textequiv_level
gt, ocr, report_prefix, reports_folder, *, metrics, differences, textequiv_level
):
for gt_file in os.listdir(gt):
gt_file_path = os.path.join(gt, gt_file)
@ -269,9 +269,9 @@ def main(
ocr,
report_prefix,
reports_folder,
metrics,
differences,
textequiv_level,
metrics=metrics,
differences=differences,
textequiv_level=textequiv_level,
)
else:
process(

@ -21,9 +21,9 @@ def test_cli_directory(tmp_path):
os.path.join(data_dir, "directory-test", "ocr"),
"report",
str(tmp_path / "reports"),
False,
True,
"line",
metrics=False,
differences=True,
textequiv_level="line",
)
assert os.path.exists(tmp_path / "reports/1.xml-report.json")
@ -45,9 +45,9 @@ def test_cli_fail_without_gt(tmp_path):
os.path.join(data_dir, "directory-test", "ocr"),
"report",
str(tmp_path / "reports"),
False,
True,
"line",
metrics=False,
differences=True,
textequiv_level="line",
)
assert len(os.listdir(tmp_path / "reports")) == 2 * 2

Loading…
Cancel
Save