Skip to content

Commit b200633

Browse files
committed
apply isort changes
Changes were automatically applied by running: python -m isort . Signed-off-by: James Butler <[email protected]>
1 parent 0f797d7 commit b200633

30 files changed

+30
-65
lines changed

monai/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
from __future__ import annotations
1313

14+
import logging
1415
import os
1516
import sys
16-
import logging
1717
import warnings
18-
from ._version import get_versions
1918

19+
from ._version import get_versions
2020

2121
old_showwarning = warnings.showwarning
2222

monai/apps/detection/transforms/array.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515

1616
from __future__ import annotations
1717

18-
from typing import Any
19-
2018
from collections.abc import Sequence
19+
from typing import Any
2120

2221
import numpy as np
2322
import torch

monai/apps/detection/utils/anchor_utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939

4040
from __future__ import annotations
4141

42-
4342
from collections.abc import Sequence
4443

4544
import torch

monai/apps/pathology/engines/utils.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
from __future__ import annotations
1313

14-
from typing import Any
15-
1614
from collections.abc import Sequence
15+
from typing import Any
1716

1817
import torch
1918

monai/apps/pathology/inferers/inferer.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
from __future__ import annotations
1313

14-
from typing import Any, Callable
15-
1614
from collections.abc import Sequence
15+
from typing import Any, Callable
1716

1817
import numpy as np
1918
import torch

monai/apps/pathology/metrics/lesion_froc.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
from __future__ import annotations
1313

14-
from typing import TYPE_CHECKING, Any
15-
1614
from collections.abc import Iterable
15+
from typing import TYPE_CHECKING, Any
1716

1817
import numpy as np
1918

monai/apps/pathology/transforms/post/array.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
from __future__ import annotations
1313

1414
import warnings
15-
from typing import Callable
16-
1715
from collections.abc import Sequence
16+
from typing import Callable
1817

1918
import numpy as np
2019
import torch

monai/bundle/reference_resolver.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313

1414
import re
1515
import warnings
16-
from collections.abc import Sequence
16+
from collections.abc import Iterator, Sequence
1717
from typing import Any
1818

19-
from collections.abc import Iterator
20-
2119
from monai.bundle.config_item import ConfigComponent, ConfigExpression, ConfigItem
2220
from monai.bundle.utils import DEPRECATED_ID_MAPPING, ID_REF_KEY, ID_SEP_KEY
2321
from monai.utils import allow_missing_reference, look_up_option

monai/bundle/workflows.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
import sys
1717
import time
1818
from abc import ABC, abstractmethod
19+
from collections.abc import Sequence
1920
from copy import copy
2021
from logging.config import fileConfig
2122
from pathlib import Path
2223
from typing import Any
2324

24-
from collections.abc import Sequence
25-
2625
from monai.apps.utils import get_logger
2726
from monai.bundle.config_parser import ConfigParser
2827
from monai.bundle.properties import InferProperties, MetaProperties, TrainProperties

monai/config/type_definitions.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
from __future__ import annotations
1313

1414
import os
15-
from typing import TypeVar, Union
16-
1715
from collections.abc import Collection, Hashable, Iterable, Sequence
16+
from typing import TypeVar, Union
1817

1918
import numpy as np
2019
import torch

monai/data/meta_obj.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313

1414
import itertools
1515
import pprint
16+
from collections.abc import Iterable
1617
from copy import deepcopy
1718
from typing import Any
1819

19-
from collections.abc import Iterable
20-
2120
import numpy as np
2221
import torch
2322

monai/data/meta_tensor.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313

1414
import functools
1515
import warnings
16+
from collections.abc import Sequence
1617
from copy import deepcopy
1718
from typing import Any
1819

19-
from collections.abc import Sequence
20-
2120
import numpy as np
2221
import torch
2322

monai/engines/evaluator.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
from __future__ import annotations
1313

1414
import warnings
15-
from typing import TYPE_CHECKING, Any, Callable
16-
1715
from collections.abc import Iterable, Sequence
16+
from typing import TYPE_CHECKING, Any, Callable
1817

1918
import torch
2019
from torch.utils.data import DataLoader

monai/engines/trainer.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
from __future__ import annotations
1313

1414
import warnings
15-
from typing import TYPE_CHECKING, Any, Callable
16-
1715
from collections.abc import Iterable, Sequence
16+
from typing import TYPE_CHECKING, Any, Callable
1817

1918
import torch
2019
from torch.optim.optimizer import Optimizer

monai/engines/utils.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
from __future__ import annotations
1313

1414
from abc import ABC, abstractmethod
15-
from collections.abc import Callable, Sequence
15+
from collections.abc import Callable, Mapping, Sequence
1616
from typing import TYPE_CHECKING, Any, cast
1717

18-
from collections.abc import Mapping
19-
2018
import torch
2119
import torch.nn as nn
2220

monai/handlers/clearml_handlers.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
from __future__ import annotations
1313

14-
from typing import TYPE_CHECKING, Any
15-
1614
from collections.abc import Mapping, Sequence
15+
from typing import TYPE_CHECKING, Any
1716

1817
from monai.utils import optional_import
1918

monai/inferers/utils.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
from __future__ import annotations
1313

1414
import itertools
15-
from collections.abc import Callable, Mapping, Sequence
15+
from collections.abc import Callable, Iterable, Mapping, Sequence
1616
from typing import Any
1717

18-
from collections.abc import Iterable
19-
2018
import numpy as np
2119
import torch
2220
import torch.nn.functional as F

monai/metrics/utils.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
from __future__ import annotations
1313

1414
import warnings
15+
from collections.abc import Iterable, Sequence
1516
from functools import lru_cache, partial
1617
from types import ModuleType
1718
from typing import Any
1819

19-
from collections.abc import Iterable, Sequence
20-
2120
import numpy as np
2221
import torch
2322

monai/networks/nets/swin_unetr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313

1414
import itertools
1515
from collections.abc import Sequence
16+
from typing import Final
1617

1718
import numpy as np
1819
import torch
1920
import torch.nn as nn
2021
import torch.nn.functional as F
2122
import torch.utils.checkpoint as checkpoint
2223
from torch.nn import LayerNorm
23-
from typing import Final
2424

2525
from monai.networks.blocks import MLPBlock as Mlp
2626
from monai.networks.blocks import PatchEmbed, UnetOutBlock, UnetrBasicBlock, UnetrUpBlock

monai/transforms/intensity/dictionary.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717

1818
from __future__ import annotations
1919

20-
from typing import Callable
21-
2220
from collections.abc import Hashable, Mapping, Sequence
21+
from typing import Callable
2322

2423
import numpy as np
2524

monai/transforms/lazy/functional.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
from __future__ import annotations
1313

14-
from typing import Any
15-
1614
from collections.abc import Mapping, Sequence
15+
from typing import Any
1716

1817
import torch
1918

monai/transforms/spatial/array.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515
from __future__ import annotations
1616

1717
import warnings
18-
from collections.abc import Callable
18+
from collections.abc import Callable, Sequence
1919
from copy import deepcopy
2020
from itertools import zip_longest
2121
from typing import Any, Optional, Union, cast
2222

23-
from collections.abc import Sequence
24-
2523
import numpy as np
2624
import torch
2725

monai/transforms/utility/dictionary.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818
from __future__ import annotations
1919

2020
import re
21-
from collections.abc import Callable, Hashable, Mapping
21+
from collections.abc import Callable, Hashable, Mapping, Sequence
2222
from copy import deepcopy
2323
from typing import Any, cast
2424

25-
from collections.abc import Sequence
26-
2725
import numpy as np
2826
import torch
2927

monai/utils/component_store.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
from __future__ import annotations
1313

1414
from collections import namedtuple
15+
from collections.abc import Iterable
1516
from keyword import iskeyword
1617
from textwrap import dedent, indent
1718
from typing import Any, Callable, TypeVar
1819

19-
from collections.abc import Iterable
20-
2120
T = TypeVar("T")
2221

2322

monai/utils/decorators.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515

1616
__all__ = ["RestartGenerator", "MethodReplacer"]
1717

18-
from typing import Callable
19-
2018
from collections.abc import Generator
19+
from typing import Callable
2120

2221

2322
class RestartGenerator:

monai/utils/dist.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
import warnings
1515
from collections.abc import Callable
1616
from logging import Filter
17-
18-
from typing import Literal
19-
20-
from typing import overload
17+
from typing import Literal, overload
2118

2219
import torch
2320
import torch.distributed as dist

monai/utils/module.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import re
1919
import sys
2020
import warnings
21-
from collections.abc import Callable, Collection, Hashable, Mapping
21+
from collections.abc import Callable, Collection, Hashable, Iterable, Mapping
2222
from functools import partial, wraps
2323
from importlib import import_module
2424
from pkgutil import walk_packages
@@ -27,8 +27,6 @@
2727
from types import FunctionType, ModuleType
2828
from typing import Any, cast
2929

30-
from collections.abc import Iterable
31-
3230
import torch
3331

3432
# bundle config system flags

monai/utils/state_cacher.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
import os
1616
import pickle
1717
import tempfile
18+
from collections.abc import Hashable
1819
from types import ModuleType
1920
from typing import Any
2021

21-
from collections.abc import Hashable
22-
2322
import torch
2423
from torch.serialization import DEFAULT_PROTOCOL
2524

tests/test_dynunet.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313

1414
import platform
1515
import unittest
16-
from typing import Any
17-
1816
from collections.abc import Sequence
17+
from typing import Any
1918

2019
import torch
2120
from parameterized import parameterized

tests/test_network_consistency.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
import json
1515
import os
1616
import unittest
17-
from glob import glob
1817
from collections.abc import Sequence
18+
from glob import glob
1919
from unittest.case import skipIf
2020

2121
import torch

0 commit comments

Comments
 (0)