plato.context module¶
Context management
-
class
plato.context.Context(hasher, parent=None, meta=None)[source]¶ Bases:
objectContext used in sampling from
Providerinstances.- Parameters
hasher – Hasher used to derive the random number seed and to derive hashers for subcontexts.
parent (Optional[plato.context.Context]) – The parent context if any.
meta (dict) – A dictionary that can be used by
Providerinstances to store additional information in the context. Be aware that the passed instance might be modified.
-
meta: dict[source]¶ Dictionary that can be used by providers to store additional information across invocations of
Provider.sample(). Use theProviderinstance or concrete class as key to avoid key collisions with other providers.
-
parent: Optional[plato.context.Context][source]¶ The parent context or
Noneif this is a root context.
-
rng: random.Random[source]¶ A seeded random number generator that may be used for the generation of random numbers.
-
class
plato.context.Hasher(*args, **kwargs)[source]¶ Bases:
ProtocolProtocol of classes to perform incremental hashing.