hpcflow.sdk.core.task.RepeatsDescriptor#
- class hpcflow.sdk.core.task.RepeatsDescriptor(number, name='', nesting_order=0.0, generate_seed_sequence=True, master_seed=None)#
Bases:
JSONLikeSpecification for defining element repeats.
- Parameters:
name (str) – Name to reference this repeats descriptor. An empty string by default.
number (int) – Number of times to repeat the elements of the element set.
nesting_order (int | float) – The nesting order. Normally an integer; non-integer values have special meanings.
generate_seed_sequence (bool) – Whether to generate a ValueSequence of random seeds corresponding to the repeats.
master_seed (int | None) – The master seed to use if generating a corresponding ValueSequence of random seeds.
Methods
Make an instance of this class from JSON (or YAML) data.
Generate from repeats descriptors specified in potentially several ways.
Serialize this object as a dictionary.
Serialize this object as an object structure that can be trivially converted to JSON.
Attributes
Whether to generate a ValueSequence of random seeds corresponding to the repeats
The master seed to use if generating a corresponding ValueSequence of random seeds.
Name to reference this repeats descriptor.
The nesting order.
Number of times to repeat the elements of the element set.
- classmethod from_json_like(json_like, shared_data=None)#
Make an instance of this class from JSON (or YAML) data.
- Parameters:
json_like (str | Mapping[str, JSONed] | Sequence[Mapping[str, JSONed]] | None) – The data to deserialise.
shared_data (Mapping[str, ObjectList[JSONable]] | None) – Shared context data.
- Return type:
The deserialised object.
- generate_seed_sequence: bool = True#
Whether to generate a ValueSequence of random seeds corresponding to the repeats
- master_seed: int | None = None#
The master seed to use if generating a corresponding ValueSequence of random seeds.
- nesting_order: int | float = 0.0#
The nesting order. Normally an integer; non-integer values have special meanings.
- classmethod normalise(repeats)#
Generate from repeats descriptors specified in potentially several ways.
- Parameters:
repeats (RepeatsDescriptorType)
- Return type:
list[Self]
- to_json_like(dct=None, shared_data=None, exclude=(), path=None)#
Serialize this object as an object structure that can be trivially converted to JSON. Note that YAML can also be produced from the result of this method; it just requires a different final serialization step.