Skip to content

Commit

Permalink
Allow compute_distributions() to work with filepaths already with a .…
Browse files Browse the repository at this point in the history
…json extension (#846)
  • Loading branch information
JBWilkie committed May 22, 2024
1 parent 19bc2a4 commit 1f42966
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion darwin/dataset/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,9 @@ def compute_distributions(
stems: List[str] = [e.rstrip("\n\r") for e in split_file.open()]

for stem in stems:
annotation_path: Path = annotations_dir / f"{stem}.json"
if not stem.endswith(".json"):
stem = f"{stem}.json"
annotation_path: Path = annotations_dir / stem
annotation_file: Optional[dt.AnnotationFile] = parse_path(
annotation_path
)
Expand Down

0 comments on commit 1f42966

Please sign in to comment.