8000 Maximize coverage (#542) · davidbrochart/zarr-python@692f8e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 692f8e6

Browse files
authored
Maximize coverage (zarr-developers#542)
* Drop Python 2 only code * Smooth over NumPy `unravel_index` kwargs
1 parent 3ae9439 commit 692f8e6

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

zarr/indexing.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,7 @@ def __init__(self, selection, array):
691691
self.chunk_rixs = np.nonzero(self.chunk_nitems)[0]
692692

693693
# unravel chunk indices
694-
if tuple(map(int, np.__version__.split('.')[:2])) < (1, 16):
695-
self.chunk_mixs = np.unravel_index(self.chunk_rixs, dims=array._cdata_shape)
696-
else:
697-
# deal with change dims->shape in arguments as of numpy 1.16
698-
self.chunk_mixs = np.unravel_index(self.chunk_rixs, shape=array._cdata_shape)
694+
self.chunk_mixs = np.unravel_index(self.chunk_rixs, array._cdata_shape)
699695

700696
def __iter__(self):
701697

zarr/tests/test_meta.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414

1515
def assert_json_equal(expect, actual):
16-
if isinstance(expect, bytes): # pragma: py3 no cover
17-
expect = str(expect, 'ascii')
1816
if isinstance(actual, bytes):
1917
actual = str(actual, 'ascii')
2018
ej = json.loads(expect)

zarr/util.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -510,15 +510,6 @@ def is_valid_python_name(name):
510510
return name.isidentifier() and not iskeyword(name)
511511

512512

513-
def class_dir(klass): # pragma: py3 no cover
514-
d = dict()
515-
d.update(klass.__dict__)
516-
bases = klass.__bases__
517-
for base in bases:
518-
d.update(class_dir(base))
519-
return d
520-
521-
522513
class NoLock(object):
523514
"""A lock that doesn't lock."""
524515

0 commit comments

Comments
 (0)
0