diff --git a/_unittest/test_09_VariableManager.py b/_unittest/test_09_VariableManager.py index 1fd01c51075..cd8e828b5c6 100644 --- a/_unittest/test_09_VariableManager.py +++ b/_unittest/test_09_VariableManager.py @@ -668,6 +668,8 @@ def test_32_delete_unused_variables(self): self.aedtapp.modeler.create_rectangle(0, ["used_var", "used_var", "used_var"], [10, 20]) mat1 = self.aedtapp.materials.add_material("new_copper2") mat1.permittivity = "$project_used_var" + assert self.aedtapp.variable_manager.is_used("used_var") + assert not self.aedtapp.variable_manager.is_used("unused_var") assert self.aedtapp.variable_manager.delete_variable("unused_var") self.aedtapp["unused_var"] = "1mm" number_of_variables = len(self.aedtapp.variable_manager.variable_names) diff --git a/pyaedt/application/Variables.py b/pyaedt/application/Variables.py index 48257aaadcd..e9cd41646af 100644 --- a/pyaedt/application/Variables.py +++ b/pyaedt/application/Variables.py @@ -19,6 +19,7 @@ import os import re import types +import warnings from pyaedt import pyaedt_function_handler from pyaedt.generic.constants import AEDT_UNITS @@ -1237,7 +1238,7 @@ def delete_variable(self, var_name): return False @pyaedt_function_handler() - def is_used_variable(self, var_name): + def is_used(self, var_name): """Find if a variable is used. Parameters @@ -1268,6 +1269,27 @@ def is_used_variable(self, var_name): return used return used + @pyaedt_function_handler() + def is_used_variable(self, var_name): + """Find if a variable is used. + + .. deprecated:: 0.7.4 + Use :func:`is_used` method instead. + + Parameters + ---------- + var_name : str + Name of the variable. + + Returns + ------- + bool + ``True`` when successful, ``False`` when failed. + + """ + warnings.warn("`is_used_variable` is deprecated. Use `is_used` method instead.", DeprecationWarning) + return self.is_used(var_name) + def _find_used_variable_history(self, history, var_name): """Find if a variable is used. @@ -1307,7 +1329,7 @@ def delete_unused_variables(self): var_list = self.variable_names for var in var_list[:]: - if not self.is_used_variable(var): + if not self.is_used(var): self.delete_variable(var) return True diff --git a/pyaedt/modules/LayerStackup.py b/pyaedt/modules/LayerStackup.py index fed46ca06fc..05e010c8536 100644 --- a/pyaedt/modules/LayerStackup.py +++ b/pyaedt/modules/LayerStackup.py @@ -160,13 +160,13 @@ def __init__(self, app, layertype="signal", negative=False): # Rough option self._user = False self._RMdl = "Huray" - self._NR = 0.5 + self._NR = 0.0005 self._HRatio = 2.9 self._BRMdl = "Huray" - self._BNR = 0.5 + self._BNR = 0.0005 self._BHRatio = 2.9 self._SRMdl = "Huray" - self._SNR = 0.5 + self._SNR = 0.0005 self._SHRatio = 2.9 # Solver option self._usp = False