Skip to content

Commit f231e5c

Browse files
committed
Fix more code formatting issues
1 parent 03b08ed commit f231e5c

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

nibabel/benchmarks/bench_fileslice.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ def my_table(title, times, base):
109109
with InTemporaryDirectory():
110110
zst_times, zst_base = run_slices('data.zst', repeat)
111111
my_table('zst slice - raw (ratio)',
112-
np.dstack((zst_times, zst_times / zst_base)),
113-
zst_base)
112+
np.dstack((zst_times, zst_times / zst_base)),
113+
zst_base)
114114
sys.stdout.flush()

nibabel/loadsave.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
if HAVE_ZSTD: # If pyzstd installed., add .zst suffix
2424
_compressed_suffixes = (*_compressed_suffixes, '.zst')
2525

26+
2627
def load(filename, **kwargs):
2728
r""" Load file given filename, guessing at file type
2829

nibabel/openers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
except ImportError:
4747
HAVE_ZSTD = False
4848

49+
4950
def _gzip_open(filename, mode='rb', compresslevel=9, keep_open=False):
5051

5152
# use indexed_gzip if possible for faster read access. If keep_open ==

nibabel/volumeutils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import numpy as np
2020

2121
from .casting import shared_range, OK_FLOATS
22-
from .openers import Opener, BZ2File, IndexedGzipFile
22+
from .openers import Opener, BZ2File, IndexedGzipFile, HAVE_ZSTD
2323
from .deprecated import deprecate_with_version
2424
from .externals.oset import OrderedSet
2525

@@ -41,11 +41,10 @@
4141
COMPRESSED_FILE_LIKES = (gzip.GzipFile, BZ2File, IndexedGzipFile)
4242

4343
# Enable .zst support if pyzstd installed.
44-
try:
45-
from pyzstd import ZstdFile
44+
if HAVE_ZSTD:
45+
from .openers import ZstdFile
4646
COMPRESSED_FILE_LIKES = (*COMPRESSED_FILE_LIKES, ZstdFile)
47-
except ImportError:
48-
pass
47+
4948

5049
class Recoder(object):
5150
""" class to return canonical code(s) from code or aliases

0 commit comments

Comments
 (0)