Utilities
variables_as_yaml(input_variables, output_variables, file=None)
Returns and optionally saves YAML formatted string defining the in- and output variables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_variables
|
list[InputVariable]
|
List of input variables. |
required |
output_variables
|
list[OutputVariable]
|
List of output variables. |
required |
file
|
Union[str, PathLike]
|
If not None, YAML formatted string is saved to given file path. |
None
|
Returns:
Type | Description |
---|---|
str
|
YAML formatted string defining the in- and output variables. |
Source code in lume_model/utils.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
variables_from_dict(config)
Parses given config and returns in- and output variable lists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
dict
|
Variable configuration. |
required |
Returns:
Type | Description |
---|---|
tuple[list[InputVariable], list[OutputVariable]]
|
In- and output variable lists. |
Source code in lume_model/utils.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
variables_from_yaml(yaml_obj)
Parses YAML object and returns in- and output variable lists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
yaml_obj
|
Union[str, PathLike]
|
YAML formatted string or file path. |
required |
Returns:
Type | Description |
---|---|
tuple[list[InputVariable], list[OutputVariable]]
|
In- and output variable lists. |
Source code in lume_model/utils.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|