Results#

exception yaflux._results.FlagError[source]#

Bases: Exception

Raised when attempting to modify a flag that has already been set.

class yaflux._results.FlagLock[source]#

Bases: object

Context manager for controlling flag mutation.

Methods

allow_mutation()

Context manager for allowing mutation.

can_mutate()

Check if the current thread is allowed to mutate.

classmethod allow_mutation()[source]#

Context manager for allowing mutation.

classmethod can_mutate()[source]#

Check if the current thread is allowed to mutate.

Return type:

bool

class yaflux._results.Results[source]#

Bases: object

Dynamic container for analysis results.

_data#

The results data. Indexed by the creates items in the step definition.

Type:

dict[str, Any]

_metadata#

The metadata for each result. Indexed by the step name.

Type:

dict[str, Metadata]

Methods

get_step_metadata(step_name)

Get the metadata for a result.

get_step_results(step_name)

Get the results for a step.

set_metadata(step_name, metadata)

Set the metadata for a result.

get_step_metadata(step_name)[source]#

Get the metadata for a result.

Return type:

Metadata

get_step_results(step_name)[source]#

Get the results for a step.

Return type:

dict[str, Any]

set_metadata(step_name, metadata)[source]#

Set the metadata for a result.

class yaflux._results.ResultsLock[source]#

Bases: object

Context manager for controlling results mutation with granular key control.

Methods

allow_mutation(cls[, keys])

Context manager for allowing results mutation.

can_mutate()

Check if the current thread is allowed to mutate any results.

can_mutate_key(key)

Check if a specific key can be mutated.

get_mutable_keys()

Get the set of keys that can currently be mutated.

classmethod allow_mutation(cls, keys=None)[source]#

Context manager for allowing results mutation.

Parameters:

keys (Optional[set[str]]) – Set of specific keys that can be mutated. If None, all keys can be mutated.

classmethod can_mutate()[source]#

Check if the current thread is allowed to mutate any results.

Return type:

bool

classmethod can_mutate_key(key)[source]#

Check if a specific key can be mutated.

Return type:

bool

classmethod get_mutable_keys()[source]#

Get the set of keys that can currently be mutated.

Return type:

set[str]

exception yaflux._results.UnauthorizedMutationError[source]#

Bases: Exception

Raised when attempting to modify results outside of a step decorator.