dedalus.tools.random_arrays =========================== .. py:module:: dedalus.tools.random_arrays .. autoapi-nested-parse:: Tools for random array generation. Module Contents --------------- .. py:class:: ChunkedRandomArray(shape, seed=None, chunk_size=2**20, distribution='uniform', **kw) Random array with elements that are deterministically produced when indexed. This allows robustly constructing and selecting from a random array without requiring enough local memory to hold the entire array. :Parameters: * **shape** (*tuple of ints*) -- Shape of array. * **seed** (*int, optional*) -- RNG seed. Default: None. * **chunk_size** (*int, optional*) -- Chunk size for drawing from distribution. Should be less than locally available memory. Default: 2**20, corresponding to 8 MB of float64. * **distribution** (*str, optional*) -- Distribution name, corresponding to numpy random Generator method. Default: 'uniform'. * **\*\*kw** (*dict*) -- Other keywords passed to the distribution method. .. py:attribute:: chunk_size :value: 1048576 .. py:attribute:: distribution :value: 'uniform' .. py:attribute:: kw .. py:attribute:: seed :value: None .. py:class:: IndexArray(shape, order='C') mgrid-like object that returns an array of flat indices when sliced. :Parameters: * **shape** (*tuple of ints*) -- Shape of array. * **order** (*{'C', 'F'}, optional*) -- Determines whether the returned flat indices should correspond to a row-major (C-style) or column-major (Fortran-style) order. .. py:attribute:: ndim .. py:attribute:: order :value: 'C' .. py:attribute:: shape .. py:function:: chunked_rng(seed, chunk_size, distribution, **kw) RNG stream as a chunked generator. .. py:function:: rng_element(index, seed, chunk_size, distribution, **kw) Get a specified element from a RNG stream. .. py:function:: rng_elements(indices, seed, chunk_size, distribution, **kw) Get an array of elements from a RNG stream.