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

Method __init__

test/arrayimpl.py:224–237  ·  view source on GitHub ↗
(self, arg, typecode, shape=None)

Source from the content-addressed store, hash-verified

222 TypeMap.update(TypeMapComplex)
223
224 def __init__(self, arg, typecode, shape=None):
225 if isinstance(arg, (int, float, complex)):
226 if shape is None:
227 shape = ()
228 else:
229 if shape is None:
230 shape = len(arg)
231 self.array = numpy.zeros(shape, typecode)
232 if isinstance(arg, (int, float, complex)):
233 arg = numpy.asarray(arg).astype(typecode)
234 self.array.fill(arg)
235 else:
236 arg = numpy.asarray(arg).astype(typecode)
237 self.array[...] = arg
238
239 @property
240 def address(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected