pymor.tools.random

Module Contents

Functions

get_random_state

Returns a NumPy RandomState.

default_random_state

Returns the default NumPy RandomState.

Attributes

_default_random_state

pymor.tools.random.get_random_state(random_state=None, seed=None)[source]

Returns a NumPy RandomState.

Parameters

random_state

If specified, this state is returned.

seed

If specified, the seed to initialize a new random state.

Returns

Either the provided, a newly created or the default RandomState object.

pymor.tools.random.default_random_state(seed=42)[source]

Returns the default NumPy RandomState.

Parameters

seed

Seed to use for initializing the random state.

Returns

The default RandomState object.

pymor.tools.random._default_random_state[source]