MCPcopy Index your code
hub / github.com/numpy/numpy / __init__

Method __init__

numpy/lib/_npyio_impl.py:192–208  ·  view source on GitHub ↗
(self, fid, own_fid=False, allow_pickle=False,
                 pickle_kwargs=None, *,
                 max_header_size=_MAX_HEADER_SIZE)

Source from the content-addressed store, hash-verified

190 _MAX_REPR_ARRAY_COUNT = 5
191
192 def __init__(self, fid, own_fid=False, allow_pickle=False,
193 pickle_kwargs=None, *,
194 max_header_size=_MAX_HEADER_SIZE):
195 # Import is postponed to here since zipfile depends on gzip, an
196 # optional component of the so-called standard library.
197 _zip = zipfile_factory(fid)
198 _files = _zip.namelist()
199 self.files = [name.removesuffix(".npy") for name in _files]
200 self._files = dict(zip(self.files, _files))
201 self._files.update(zip(_files, _files))
202 self.allow_pickle = allow_pickle
203 self.max_header_size = max_header_size
204 self.pickle_kwargs = pickle_kwargs
205 self.zip = _zip
206 self.f = BagObj(self)
207 if own_fid:
208 self.fid = fid
209
210 def __enter__(self):
211 return self

Callers

nothing calls this directly

Calls 3

zipfile_factoryFunction · 0.85
BagObjClass · 0.85
updateMethod · 0.80

Tested by

no test coverage detected