Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristofferEdlund committed Nov 17, 2023
1 parent 4c30f17 commit d0b33e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
5 changes: 2 additions & 3 deletions darwin/dataset/local_dataset.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import multiprocessing as mp
from pathlib import Path
from typing import Any, Dict, Iterator, List, Optional, Tuple
from xmlrpc.client import Boolean

import numpy as np
from PIL import Image as PILImage
Expand Down Expand Up @@ -68,7 +67,7 @@ def __init__(
split: str = "default",
split_type: str = "random",
release_name: Optional[str] = None,
keep_empty_annotations: Boolean = False,
keep_empty_annotations: bool = False,
):
self.dataset_path = dataset_path
self.annotation_type = annotation_type
Expand Down Expand Up @@ -134,7 +133,7 @@ def _setup_annotations_and_images(
split,
partition,
split_type,
keep_empty_annotations=False,
keep_empty_annotations: bool = False,
):
# Find all the annotations and their corresponding images
for annotation_path in sorted(annotations_dir.glob("**/*.json")):
Expand Down
3 changes: 1 addition & 2 deletions darwin/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
Tuple,
Union,
)
from xmlrpc.client import Boolean

try:
from numpy.typing import NDArray
Expand Down Expand Up @@ -538,7 +537,7 @@ def make_polygon(
bounding_box: Optional[Dict] = None,
subs: Optional[List[SubAnnotation]] = None,
slot_names: Optional[List[str]] = None,
darwin_v1: Boolean = False,
darwin_v1: bool = False,
) -> Annotation:
"""
Creates and returns a polygon annotation.
Expand Down
12 changes: 7 additions & 5 deletions tests/darwin/importer/formats/import_nifti_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,18 @@ def test_image_annotation_nifti_import_single_slot(team_slug_darwin_json_v2: str

expected_json_string = json.load(
open(
Path(tmpdir) / team_slug_darwin_json_v2 / "nifti" / "vol0_annotation_file.json",
Path(tmpdir)
/ team_slug_darwin_json_v2
/ "nifti"
/ "vol0_annotation_file.json",
"r",
)
)

expected_output_frames = expected_json_string['annotations'][0]['frames']
expected_output_frames = expected_json_string["annotations"][0]["frames"]

assert (
output_json_string["annotations"][0]["frames"]
== expected_output_frames
output_json_string["annotations"][0]["frames"] == expected_output_frames
)


Expand Down

0 comments on commit d0b33e5

Please sign in to comment.