Skip to content

Commit 293d8ca

Browse files
committed
STY: Rename ioobject to io_obj for clarity
1 parent 59f6db4 commit 293d8ca

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

nibabel/filebasedimages.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -540,27 +540,27 @@ class SerializableImage(FileBasedImage):
540540
"""
541541

542542
@classmethod
543-
def _filemap_from_iobase(klass, ioobject: io.IOBase):
543+
def _filemap_from_iobase(klass, io_obj: io.IOBase):
544544
"""For single-file image types, make a file map with the correct key"""
545545
if len(klass.files_types) > 1:
546546
raise NotImplementedError(
547547
"(de)serialization is undefined for multi-file images"
548548
)
549-
return klass.make_file_map({klass.files_types[0][0]: ioobject})
549+
return klass.make_file_map({klass.files_types[0][0]: io_obj})
550550

551551
@classmethod
552-
def _from_iobase(klass, ioobject: io.IOBase):
552+
def _from_iobase(klass, io_obj: io.IOBase):
553553
"""Load image from readable IO stream
554554
555555
Convert to BytesIO to enable seeking, if input stream is not seekable
556556
"""
557-
if not ioobject.seekable():
558-
ioobject = io.BytesIO(ioobject.read())
559-
return klass.from_file_map(klass._filemap_from_iobase(ioobject))
557+
if not io_obj.seekable():
558+
io_obj = io.BytesIO(io_obj.read())
559+
return klass.from_file_map(klass._filemap_from_iobase(io_obj))
560560

561-
def _to_iobase(self, ioobject: io.IOBase, **kwargs):
561+
def _to_iobase(self, io_obj: io.IOBase, **kwargs):
562562
"""Save image from writable IO stream"""
563-
self.to_file_map(self._filemap_from_iobase(ioobject), **kwargs)
563+
self.to_file_map(self._filemap_from_iobase(io_obj), **kwargs)
564564

565565
@classmethod
566566
def from_bytes(klass, bytestring: bytes):

0 commit comments

Comments
 (0)