Skip to content

Commit c4fce68

Browse files
Fix dependent
1 parent 50f53aa commit c4fce68

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

src/ansys/aedt/core/application/variables.py

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -793,22 +793,13 @@ def _cleanup_variables(self):
793793
del dict_var[var_name]
794794

795795
@pyaedt_function_handler()
796-
def _variable_dict(self, object_list, dependent=True, independent=True):
797-
"""Retrieve the variable dictionary.
796+
def _update_variable_dict(self, object_list):
797+
"""Update variable dictionary.
798798
799799
Parameters
800800
----------
801801
object_list : list
802802
List of objects.
803-
dependent : bool, optional
804-
Whether to include dependent variables. The default is ``True``.
805-
independent : bool, optional
806-
Whether to include independent variables. The default is ``True``.
807-
808-
Returns
809-
-------
810-
dict
811-
Dictionary of the specified variables.
812803
813804
"""
814805
all_names = {}
@@ -829,6 +820,27 @@ def _variable_dict(self, object_list, dependent=True, independent=True):
829820
self.__independent_design_variables[variable_name] = value
830821
else:
831822
self.__dependent_design_variables[variable_name] = value
823+
824+
@pyaedt_function_handler()
825+
def _variable_dict(self, object_list, dependent=True, independent=True):
826+
"""Retrieve the variable dictionary.
827+
828+
Parameters
829+
----------
830+
object_list : list
831+
List of objects.
832+
dependent : bool, optional
833+
Whether to include dependent variables. The default is ``True``.
834+
independent : bool, optional
835+
Whether to include independent variables. The default is ``True``.
836+
837+
Returns
838+
-------
839+
dict
840+
Dictionary of the specified variables.
841+
842+
"""
843+
self._update_variable_dict(object_list)
832844
self._cleanup_variables()
833845
vars_to_output = {}
834846
dicts_to_add = []
@@ -1132,6 +1144,7 @@ def set_variable(
11321144
lower_case_vars = [var_name.lower() for var_name in var_list]
11331145
if name.lower() not in lower_case_vars:
11341146
return False
1147+
11351148
return True
11361149

11371150
@pyaedt_function_handler(separator_name="name")
@@ -1900,7 +1913,7 @@ def evaluated_value(self) -> Union[float, Any]:
19001913
"""Concatenated numeric value and unit string."""
19011914
if self.numeric_value is None:
19021915
return None
1903-
return f"{self.numeric_value}{self._units}"
1916+
return f"{self.numeric_value}{self.units}"
19041917

19051918
@pyaedt_function_handler()
19061919
def decompose(self) -> tuple:

0 commit comments

Comments
 (0)