File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 5454from .arraywriters import make_array_writer
5555from .wrapstruct import WrapStruct
5656from .fileslice import canonical_slicers , predict_shape , slice2outax
57+ from .keywordonly import kw_only_meth
5758from .deprecated import deprecate_with_version
5859
5960BLOCK_SIZE = 512
@@ -873,7 +874,8 @@ def _get_fileholders(file_map):
873874 return file_map ['header' ], file_map ['image' ]
874875
875876 @classmethod
876- def from_file_map (klass , file_map ):
877+ @kw_only_meth (1 )
878+ def from_file_map (klass , file_map , mmap = True , keep_file_open = None ):
877879 """class method to create image from mapping
878880 specified in file_map
879881 """
Original file line number Diff line number Diff line change 1717from .spatialimages import SpatialHeader , SpatialImage
1818from .fileslice import canonical_slicers
1919
20+ from .keywordonly import kw_only_meth
2021from .deprecated import FutureWarningMixin
2122
2223_dt_dict = {
@@ -310,7 +311,9 @@ class Minc1Image(SpatialImage):
310311 ImageArrayProxy = MincImageArrayProxy
311312
312313 @classmethod
313- def from_file_map (klass , file_map ):
314+ @kw_only_meth (1 )
315+ def from_file_map (klass , file_map , mmap = True , keep_file_open = None ):
316+ # Note that mmap and keep_file_open are included for proper
314317 with file_map ['image' ].get_prepare_fileobj () as fobj :
315318 minc_file = Minc1File (netcdf_file (fobj ))
316319 affine = minc_file .get_affine ()
Original file line number Diff line number Diff line change 2727"""
2828import numpy as np
2929
30+ from .keywordonly import kw_only_meth
3031from .optpkg import optional_package
3132h5py , have_h5py , setup_module = optional_package ('h5py' )
3233
@@ -158,7 +159,8 @@ class Minc2Image(Minc1Image):
158159 header_class = Minc2Header
159160
160161 @classmethod
161- def from_file_map (klass , file_map ):
162+ @kw_only_meth (1 )
163+ def from_file_map (klass , file_map , mmap = True , keep_file_open = None ):
162164 holder = file_map ['image' ]
163165 if holder .filename is None :
164166 raise MincError ('MINC2 needs filename for load' )
You can’t perform that action at this time.
0 commit comments