Skip to content

Commit

Permalink
Reduce default Roughness nodule radius (#3875)
Browse files Browse the repository at this point in the history
Deprecate is_used_variable method
  • Loading branch information
Samuelopez-ansys authored Nov 14, 2023
1 parent 94e72ee commit 55bbb97
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
2 changes: 2 additions & 0 deletions _unittest/test_09_VariableManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 24 additions & 2 deletions pyaedt/application/Variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions pyaedt/modules/LayerStackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 55bbb97

Please sign in to comment.