Skip to content

Commit

Permalink
Sort import statements by using isort
Browse files Browse the repository at this point in the history
isort --atomic python/**/*.py
  • Loading branch information
gigony committed Jul 10, 2021
1 parent c8a3e30 commit 5148e28
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 34 deletions.
9 changes: 2 additions & 7 deletions python/cucim/ci/bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import, print_function, unicode_literals

import os
import subprocess
import sys
from os.path import abspath
from os.path import dirname
from os.path import exists
from os.path import join
from os.path import abspath, dirname, exists, join

base_path = dirname(dirname(abspath(__file__)))

Expand Down
10 changes: 3 additions & 7 deletions python/cucim/setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import absolute_import, print_function

import io
import sys
from os.path import dirname
from os.path import join

from setuptools import find_packages
from setuptools import setup
from os.path import dirname, join

import versioneer
from setuptools import find_packages, setup

# Give setuptools a hint to complain if it's too old a version
# 24.2.0 added the python_requires option
Expand Down
2 changes: 1 addition & 1 deletion python/cucim/src/cucim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
pass

try:
from .clara import __version__, CuImage, cli
from .clara import CuImage, __version__, cli
except ImportError:
from ._version import get_versions
__version__ = get_versions()['version']
Expand Down
2 changes: 1 addition & 1 deletion python/cucim/src/cucim/clara/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from . import cli, converter
# import hidden methods
from ._cucim import CuImage, __version__, filesystem, io, cache
from ._cucim import CuImage, __version__, cache, filesystem, io

__all__ = ['cli', 'CuImage', 'filesystem', 'io', 'cache', 'converter', '__version__']

Expand Down
3 changes: 2 additions & 1 deletion python/cucim/src/cucim/clara/cache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
#

from cucim.clara._cucim.cache import CacheType, ImageCache, preferred_memory_capacity
from cucim.clara._cucim.cache import (CacheType, ImageCache,
preferred_memory_capacity)

__all__ = ['CacheType', 'ImageCache', 'preferred_memory_capacity']
12 changes: 6 additions & 6 deletions python/cucim/src/cucim/skimage/color/tests/test_colorconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
from cucim.skimage.color import (combine_stains, convert_colorspace, gray2rgb,
gray2rgba, hed2rgb, hsv2rgb, lab2lch, lab2rgb,
lab2xyz, lch2lab, luv2rgb, luv2xyz, rgb2gray,
rgb2hed, rgb2hsv, rgb2lab, rgb2luv, rgb2rgbcie,
rgb2xyz, rgb2ycbcr, rgb2ydbdr, rgb2yiq,
rgb2ypbpr, rgb2yuv, rgba2rgb, rgbcie2rgb,
separate_stains, xyz2lab, xyz2luv, xyz2rgb,
ycbcr2rgb, ydbdr2rgb, yiq2rgb, ypbpr2rgb,
yuv2rgb)
rgb2hed, rgb2hsv, rgb2lab, rgb2luv,
rgb2rgbcie, rgb2xyz, rgb2ycbcr, rgb2ydbdr,
rgb2yiq, rgb2ypbpr, rgb2yuv, rgba2rgb,
rgbcie2rgb, separate_stains, xyz2lab, xyz2luv,
xyz2rgb, ycbcr2rgb, ydbdr2rgb, yiq2rgb,
ypbpr2rgb, yuv2rgb)
from cucim.skimage.util import img_as_float, img_as_float32, img_as_ubyte


Expand Down
5 changes: 3 additions & 2 deletions python/cucim/src/cucim/skimage/filters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
from .thresholding import (apply_hysteresis_threshold, threshold_isodata,
threshold_li, threshold_local, threshold_mean,
threshold_minimum, threshold_multiotsu,
threshold_niblack, threshold_otsu, threshold_sauvola,
threshold_triangle, threshold_yen, try_all_threshold)
threshold_niblack, threshold_otsu,
threshold_sauvola, threshold_triangle,
threshold_yen, try_all_threshold)

__all__ = [
"inverse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
from cucim.skimage.color import rgb2gray
from cucim.skimage.exposure import histogram
from cucim.skimage.filters.thresholding import _cross_entropy # _mean_std,
from cucim.skimage.filters.thresholding import (threshold_isodata, threshold_li,
threshold_local, threshold_mean,
from cucim.skimage.filters.thresholding import (threshold_isodata,
threshold_li, threshold_local,
threshold_mean,
threshold_minimum,
threshold_multiotsu,
threshold_niblack,
Expand Down
4 changes: 2 additions & 2 deletions python/cucim/src/cucim/skimage/transform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
PiecewiseAffineTransform, PolynomialTransform,
ProjectiveTransform, SimilarityTransform,
estimate_transform, matrix_transform)
from ._warps import (downscale_local_mean, rescale, resize, rotate, swirl, warp,
warp_coords, warp_polar)
from ._warps import (downscale_local_mean, rescale, resize, rotate, swirl,
warp, warp_coords, warp_polar)
from .integral import integral_image, integrate
from .pyramids import (pyramid_expand, pyramid_gaussian, pyramid_laplacian,
pyramid_reduce)
Expand Down
4 changes: 3 additions & 1 deletion python/cucim/tests/fixtures/testimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
#

import shutil

import pytest
from ..util.gen_image import ImageGenerator
from pytest_lazyfixture import lazy_fixture

from ..util.gen_image import ImageGenerator


def gen_image(tmpdir_factory, recipe):
dataset_path = tmpdir_factory.mktemp('datasets').strpath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#

import pytest

from ...util.io import open_image_cucim


Expand Down Expand Up @@ -46,6 +47,7 @@ def test_read_region_cuda_memleak(testimg_tiff_stripe_4096x4096_256):

def test_read_region_cpu_memleak(testimg_tiff_stripe_4096x4096_256):
import os

import psutil
process = psutil.Process(os.getpid())

Expand All @@ -65,8 +67,9 @@ def test_read_region_cpu_memleak(testimg_tiff_stripe_4096x4096_256):

def test_read_random_region_cpu_memleak(testimg_tiff_stripe_4096x4096_256):
import os
import psutil
import random

import psutil
process = psutil.Process(os.getpid())

img = open_image_cucim(testimg_tiff_stripe_4096x4096_256)
Expand Down
1 change: 1 addition & 0 deletions python/cucim/tests/unit/clara/test_load_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#

import pytest

from ...util.io import open_image_cucim


Expand Down
1 change: 1 addition & 0 deletions python/cucim/tests/unit/clara/test_tiff_read_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import numpy as np
import pytest

from ...util.io import open_image_cucim


Expand Down
7 changes: 4 additions & 3 deletions python/cucim/tests/util/gen_tiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
# limitations under the License.
#

from tifffile import TiffWriter
import numpy as np
from pathlib import Path
from functools import reduce
from pathlib import Path
from tempfile import mkdtemp

import numpy as np
from tifffile import TiffWriter

COMPRESSION_MAP = {'jpeg': ('jpeg', 95),
'deflate': 'deflate'}

Expand Down

0 comments on commit 5148e28

Please sign in to comment.