hpcflow.app.ValueSequence#
- class hpcflow.app.ValueSequence(path, values, nesting_order=None, label=None, value_class_method=None)#
Bases:
ValueSequence
A sequence of values.
- Parameters:
path (str) – The path to this sequence.
values (list[Any] | None) – The values in this sequence.
nesting_order (int) – A nesting order for this sequence. Can be used to compose sequences together.
label (str) – A label for this sequence.
value_class_method (str) – Name of a method used to generate sequence values. Not normally used directly.
Methods
Build a sequence from a simple file.
Build a sequence from a NumPy geometric space.
Make an instance of this class from JSON (or YAML) data.
Build a sequence from a NumPy linear space.
Build a sequence from a NumPy logarithmic space.
Build a sequence from a uniform random number generator.
Build a sequence from a range.
Build a sequence to cover a rectangle.
Save value to a persistent workflow.
Serialize this object as a dictionary.
Serialize this object as an object structure that can be trivially converted to JSON.
Attributes
The path of the input sequence this is, if it is one.
The type of input sequence this is, if it is one.
True if the values are for a sub part of the parameter.
The labelled type of input sequence this is, if it is one.
The normalised path without the "inputs" prefix, if the sequence is an inputs sequence, else return None.
The path to this sequence.
The parameter this sequence supplies.
The components of ths path.
The type of path this is.
The scope of the resources this is, if it is one.
The values in this sequence.
The workflow containing this sequence.
The path to this sequence.
The label of this sequence.
The nesting order for this sequence.
Name of a method used to generate sequence values.
- classmethod from_file(path, file_path, nesting_order=0, label=None, **kwargs)#
Build a sequence from a simple file.
- classmethod from_geometric_space(path, start, stop, num, nesting_order=0, endpoint=True, label=None, **kwargs)#
Build a sequence from a NumPy geometric space.
- classmethod from_json_like(json_like, shared_data=None)#
Make an instance of this class from JSON (or YAML) data.
- Parameters:
json_like – The data to deserialise.
shared_data – Shared context data.
- Return type:
The deserialised object.
- classmethod from_linear_space(path, start, stop, num, nesting_order=0, label=None, **kwargs)#
Build a sequence from a NumPy linear space.
- classmethod from_log_space(path, start, stop, num, nesting_order=0, base=10.0, endpoint=True, label=None, **kwargs)#
Build a sequence from a NumPy logarithmic space.
- classmethod from_random_uniform(path, num, low=0.0, high=1.0, seed=None, nesting_order=0, label=None, **kwargs)#
Build a sequence from a uniform random number generator.
- classmethod from_range(path, start, stop, nesting_order=0, step=1, label=None, **kwargs)#
Build a sequence from a range.
- classmethod from_rectangle(path, start, stop, num, coord=None, include=None, nesting_order=0, label=None, **kwargs)#
Build a sequence to cover a rectangle.
- Parameters:
coord (int | None) – Which coordinate to use. Either 0, 1, or None, meaning each value will be both coordinates.
include (list[str] | None) – If specified, include only the specified edges. Choose from “top”, “right”, “bottom”, “left”.
path (str) –
start (Sequence[float]) –
stop (Sequence[float]) –
num (Sequence[int]) –
nesting_order (float) –
- Return type:
Self
- label#
The label of this sequence.
- make_persistent(workflow, source)#
Save value to a persistent workflow.
- nesting_order#
The nesting order for this sequence.
- property normalised_inputs_path: str | None#
The normalised path without the “inputs” prefix, if the sequence is an inputs sequence, else return None.
- path#
The path to this sequence.
- 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.
- value_class_method#
Name of a method used to generate sequence values.