pynbody.array.shared.make_shared_array#
- pynbody.array.shared.make_shared_array(dims, dtype, zeros=False, fname=None, create=True, offset=None, strides=None) → SharedMemorySimArray[source]#
Create an array of dimensions dims with the given numpy dtype.
- Parameters:
dims (tuple | int) – The dimensions of the numpy array to create
dtype – The data type to use
zeros – If True, zero the array; otherwise leave uninitialised
fname (str, optional) – The shared memory name to use. If None, a random name will be created. This is only valid with create=True.
create (bool) – Whether to create the shared array, or to open existing shared memory. If the latter, the fname must be specified and the caller is responsible for making sure the dtype and dims match the original array.
offset (int, optional) – The offset into the shared memory to use. This is only valid with create=False
strides (tuple, optional) – The strides to use. This is only valid with create=False