The Variables.py module#

Summary#

CSVDataset

Reads in a CSV file and extracts data, which can be augmented with constant values.

VariableManager

Manages design properties and project variables.

Variable

Stores design properties and project variables and provides operations to perform on them.

DataSet

Manages datasets.

decompose_variable_value

Decompose a variable value.

generate_validation_errors

From the given property names, expected settings and actual settings, return a list of validation errors.

Description#

This module contains these classes: CSVDataset, DataSet, Expression, Variable, and VariableManager.

This module is used to create and edit design and project variables in the 3D tools.

Examples#

>>> from ansys.aedt.core import Hfss
>>> hfss = Hfss()
>>> hfss["$d"] = "5mm"
>>> hfss["d"] = "5mm"
>>> hfss["postd"] = "1W"

Module detail#

Variables.decompose_variable_value(variable_value, full_variables={})#

Decompose a variable value.

Parameters:
variable_valuestr
full_variablesdict
Returns:
tuples

Tuples made of the float value of the variable and the units exposed as a string.

Variables.generate_validation_errors(property_names, expected_settings, actual_settings)#

From the given property names, expected settings and actual settings, return a list of validation errors. If no errors are found, an empty list is returned. The validation of values such as “10mm” ensures that they are close to within a relative tolerance. For example an expected setting of “10mm”, and actual of “10.000000001mm” will not yield a validation error. For values with no numerical value, an equivalence check is made.

Parameters:
property_namesList[str]

List of property names.

expected_settingsList[str]

List of the expected settings.

actual_settingsList[str]

List of actual settings.

Returns:
List[str]

A list of validation errors for the given settings.