Update args.sample type to Path and str vs as_posix comparisons

This commit is contained in:
Aayush Goel
2023-07-09 16:02:28 +05:30
parent e0ed8c6e04
commit 673af45c55
13 changed files with 124 additions and 131 deletions

View File

@@ -170,7 +170,7 @@ def main(argv=None):
samples = []
for file in Path(args.input).rglob("*"):
samples.append(file.as_posix())
samples.append(file)
def pmap(f, args, parallelism=multiprocessing.cpu_count()):
"""apply the given function f to the given args using subprocesses"""
@@ -205,7 +205,7 @@ def main(argv=None):
if result["status"] == "error":
logger.warning(result["error"])
elif result["status"] == "ok":
results[result["path"]] = rd.ResultDocument.parse_obj(result["ok"]).json(exclude_none=True)
results[result["path"].as_posix()] = rd.ResultDocument.parse_obj(result["ok"]).json(exclude_none=True)
else:
raise ValueError(f"unexpected status: {result['status']}")