MCPcopy Create free account
hub / github.com/numpy/numpy / __init__

Method __init__

numpy/lib/npyio.py:185–204  ·  view source on GitHub ↗
(self, fid, own_fid=False, allow_pickle=False,
                 pickle_kwargs=None, *,
                 max_header_size=format._MAX_HEADER_SIZE)

Source from the content-addressed store, hash-verified

183 _MAX_REPR_ARRAY_COUNT = 5
184
185 def __init__(self, fid, own_fid=False, allow_pickle=False,
186 pickle_kwargs=None, *,
187 max_header_size=format._MAX_HEADER_SIZE):
188 # Import is postponed to here since zipfile depends on gzip, an
189 # optional component of the so-called standard library.
190 _zip = zipfile_factory(fid)
191 self._files = _zip.namelist()
192 self.files = []
193 self.allow_pickle = allow_pickle
194 self.max_header_size = max_header_size
195 self.pickle_kwargs = pickle_kwargs
196 for x in self._files:
197 if x.endswith('.npy'):
198 self.files.append(x[:-4])
199 else:
200 self.files.append(x)
201 self.zip = _zip
202 self.f = BagObj(self)
203 if own_fid:
204 self.fid = fid
205
206 def __enter__(self):
207 return self

Callers

nothing calls this directly

Calls 3

zipfile_factoryFunction · 0.85
BagObjClass · 0.85
endswithMethod · 0.80

Tested by

no test coverage detected