matflow.ValueSequence#

class matflow.ValueSequence(path, values, nesting_order=0, label=None, value_class_method=None)#

Bases: ValueSequence

A sequence of values.

Parameters:
  • path (str) – The path to this sequence.

  • values (List[Any]) – 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

from_file

Build a sequence from a simple file.

from_geometric_space

Build a sequence from a NumPy geometric space.

from_json_like

Make an instance of this class from JSON (or YAML) data.

from_linear_space

Build a sequence from a NumPy linear space.

from_log_space

Build a sequence from a NumPy logarithmic space.

from_random_uniform

Build a sequence from a uniform random number generator.

from_range

Build a sequence from a range.

from_rectangle

Build a sequence to cover a rectangle.

make_persistent

Save value to a persistent workflow.

to_dict

Serialize this object as a dictionary.

to_json_like

Serialize this object as an object structure that can be trivially converted to JSON.

Attributes

app

input_path

The path of the input sequence this is, if it is one.

input_type

The type of input sequence this is, if it is one.

is_sub_value

True if the values are for a sub part of the parameter.

labelled_type

The labelled type of input sequence this is, if it is one.

normalised_inputs_path

The normalised path without the "inputs" prefix, if the sequence is an inputs sequence, else return None.

normalised_path

The path to this sequence.

parameter

The parameter this sequence supplies.

path_split

The components of ths path.

path_type

The type of path this is.

resource_scope

The scope of the resources this is, if it is one.

values

The values in this sequence.

workflow

The workflow containing this sequence.

path

The path to this sequence.

label

The label of this sequence.

nesting_order

The nesting order for this sequence.

value_class_method

Name of a method used to generate sequence values.

app = App(name='MatFlow', version='0.3.0a132')#
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”.

property input_path#

The path of the input sequence this is, if it is one.

property input_type#

The type of input sequence this is, if it is one.

property is_sub_value#

True if the values are for a sub part of the parameter.

label#

The label of this sequence.

property labelled_type#

The labelled type of input sequence this is, if it is one.

make_persistent(workflow, source)#

Save value to a persistent workflow.

Parameters:
Return type:

Tuple[str, List[int], bool]

nesting_order#

The nesting order for this sequence.

property normalised_inputs_path#

The normalised path without the “inputs” prefix, if the sequence is an inputs sequence, else return None.

property normalised_path#

The path to this sequence.

property parameter#

The parameter this sequence supplies.

path#

The path to this sequence.

property path_split#

The components of ths path.

property path_type#

The type of path this is.

property resource_scope#

The scope of the resources this is, if it is one.

to_dict()#

Serialize this object as a dictionary.

to_json_like(dct=None, shared_data=None, exclude=None, 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.

property values#

The values in this sequence.

property workflow#

The workflow containing this sequence.