Skip to content

Commit

Permalink
tests: remove flake8 import and fix Path-string comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Mar 9, 2018
1 parent a680f5b commit 1443dfa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions qpformat/file_formats/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import functools
from functools import lru_cache
import os
import os.path as op

Expand All @@ -10,7 +10,6 @@
from .single_npy_numpy import SingleNpyNumpy
from .single_tif_holo import SingleTifHolo
from .single_tif_phasics import SingleTifPhasics
from flake8.style_guide import lru_cache


class MultipleFormatsNotSupportedError(BaseException):
Expand All @@ -29,7 +28,7 @@ def __init__(self, *args, **kwargs):
def __len__(self):
return len(self.files)

@functools.lru_cache(maxsize=32)
@lru_cache(maxsize=32)
def _get_cropped_file_names(self):
"""self.files with common path prefix/suffix removed"""
prefix = os.path.commonprefix(self.files)
Expand All @@ -52,7 +51,7 @@ def _get_dataset(self, idx):
raise NotImplementedError(msg)
return self._dataset[idx]

@functools.lru_cache(maxsize=32)
@lru_cache(maxsize=32)
def _identifier_data(self):
"""Return a unique identifier for the folder data"""
# Use only file names
Expand Down
2 changes: 1 addition & 1 deletion qpformat/file_formats/single_npy_numpy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from functools import lru_cache
import copy

import numpy as np
import qpimage

from .dataset import SingleData
from flake8.style_guide import lru_cache


class SingleNpyNumpy(SingleData):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_single_tif_phasics.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
def test_load_data():
path = pathlib.Path(__file__).parent / "data" / "single_phasics.tif"
ds = qpformat.load_data(path)
assert ds.path == path
assert pathlib.Path(ds.path) == path
assert "SingleTifPhasics" in ds.__repr__()


Expand Down

0 comments on commit 1443dfa

Please sign in to comment.