diff --git a/darwin/dataset/local_dataset.py b/darwin/dataset/local_dataset.py index db860e245..4645110c7 100644 --- a/darwin/dataset/local_dataset.py +++ b/darwin/dataset/local_dataset.py @@ -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 @@ -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 @@ -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")): diff --git a/darwin/datatypes.py b/darwin/datatypes.py index 4ea553e73..b0a28d1c8 100644 --- a/darwin/datatypes.py +++ b/darwin/datatypes.py @@ -14,7 +14,6 @@ Tuple, Union, ) -from xmlrpc.client import Boolean try: from numpy.typing import NDArray @@ -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. diff --git a/tests/darwin/importer/formats/import_nifti_test.py b/tests/darwin/importer/formats/import_nifti_test.py index 1ee2a537f..52cbe8a46 100644 --- a/tests/darwin/importer/formats/import_nifti_test.py +++ b/tests/darwin/importer/formats/import_nifti_test.py @@ -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 )