hpcflow.sdk.core.test_utils.P1_parameter_cls#

class hpcflow.sdk.core.test_utils.P1_parameter_cls(a=0, d=None, sub_param=None)#

Bases: ParameterValue

Parameter value handler: p1c

Note

This is a composite value handler.

Methods

CLI_format

CLI_format_group

CLI_parse

custom_CLI_format

custom_CLI_format_prep

Used for testing custom object CLI formatting.

dump_to_HDF5_group

Write this parameter value to an HDF5 group.

from_data

from_file

prepare_JSON_dump

Prepare this parameter value for serialisation as JSON.

save_from_HDF5_group

Extract a parameter value from an HDF5 group.

save_from_JSON

Extract a parameter value from JSON data.

sum

to_dict

Serialise this parameter value as a dictionary.

Attributes

a

d

sub_param

sub_param_prop

twice_a

Parameters:
CLI_format()#
Return type:

str

static CLI_format_group(*objs)#
Return type:

str

classmethod CLI_parse(a_str, double='', e=None)#
Parameters:
  • a_str (str) –

  • double (str) –

  • e (str | None) –

a: int = 0#
custom_CLI_format(add=None, sub=None)#
Parameters:
  • add (str | None) –

  • sub (str | None) –

Return type:

str

custom_CLI_format_prep(reps=None)#

Used for testing custom object CLI formatting.

For example, with a command like this:

<<join[delim=”,”](parameter:p1c.custom_CLI_format_prep(reps=4))>>.

Parameters:

reps (str | None) –

Return type:

list[int]

d: int | None = None#
dump_to_HDF5_group(group)#

Write this parameter value to an HDF5 group.

Parameters:

group (HDFSGroup) –

classmethod from_data(b, c)#
Parameters:
classmethod from_file(path)#
Parameters:

path (str) –

prepare_JSON_dump()#

Prepare this parameter value for serialisation as JSON.

Return type:

dict[str, Any]

classmethod save_from_HDF5_group(group, param_id, workflow)#

Extract a parameter value from an HDF5 group.

Parameters:
  • group (HDFSGroup) –

  • param_id (int) –

  • workflow (Workflow) –

classmethod save_from_JSON(data, param_id, workflow)#

Extract a parameter value from JSON data.

Parameters:
sub_param: P1_sub_parameter_cls | None = None#
property sub_param_prop: P1_sub_parameter_cls#
static sum(*objs, **kwargs)#
Return type:

str

to_dict()#

Serialise this parameter value as a dictionary.

Return type:

dict[str, Any]

property twice_a: int#