diff --git a/src/ansys/aedt/core/modeler/cad/elements_3d.py b/src/ansys/aedt/core/modeler/cad/elements_3d.py index 89168acee53..d792784e98f 100644 --- a/src/ansys/aedt/core/modeler/cad/elements_3d.py +++ b/src/ansys/aedt/core/modeler/cad/elements_3d.py @@ -24,6 +24,8 @@ from __future__ import absolute_import +import warnings + from ansys.aedt.core.generic.general_methods import _dim_arg from ansys.aedt.core.generic.general_methods import clamp from ansys.aedt.core.generic.general_methods import pyaedt_function_handler @@ -1408,6 +1410,17 @@ def __init__(self, node, child_object, first_level=False, get_child_obj_arg=None self.segments = self.children[name].children del self.children[name] + @property + def props(self): + """Properties data. + + Returns + ------- + :class:``ansys.aedt.coree.modeler.cad.elements_3d.HistoryProps`` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + @property def properties(self): """Properties data. diff --git a/src/ansys/aedt/core/modeler/cad/modeler.py b/src/ansys/aedt/core/modeler/cad/modeler.py index 41fcb489dd2..44222c2820f 100644 --- a/src/ansys/aedt/core/modeler/cad/modeler.py +++ b/src/ansys/aedt/core/modeler/cad/modeler.py @@ -30,7 +30,9 @@ 3D Layout Modeler, and Circuit Modeler. """ -from __future__ import absolute_import # noreorder +from __future__ import absolute_import + +import warnings # noreorder from ansys.aedt.core.generic.data_handlers import _dict2arg from ansys.aedt.core.generic.general_methods import PropsManager @@ -439,11 +441,22 @@ def __init__(self, modeler, props=None, name=None, face_id=None): @property def props(self): - """Properties of the coordinate system. + """Coordinate system properties. + + Returns + ------- + :class:`ansys.aedt.core.modeler.cad.modeler.CsProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """Coordinate system properties. Returns ------- - :class:`ansys.aedt.core.modeler.Modeler.CSProps` + :class:`ansys.aedt.core.modeler.cad.modeler.CsProps` """ if self._props or settings.aedt_version <= "2022.2" or self.name is None: return self._props @@ -733,11 +746,22 @@ def mode(self, value): @property def props(self): + """Coordinate system properties. + + Returns + ------- + :class:`ansys.aedt.core.modeler.cad.modeler.CsProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): """Coordinate System Properties. Returns ------- - :class:`ansys.aedt.core.modeler.Modeler.CSProps` + :class:`ansys.aedt.core.modeler.cad.modeler.CsProps` """ if self._props or settings.aedt_version <= "2022.2" or self.name is None: return self._props @@ -1269,11 +1293,22 @@ def ref_cs(self, value): @property def props(self): - """Properties of the coordinate system. + """Coordinate system properties. + + Returns + ------- + :class:`ansys.aedt.core.modeler.cad.modeler.CsProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """Coordinate system properties. Returns ------- - :class:`ansys.aedt.core.modeler.Modeler.CSProps` + :class:`ansys.aedt.core.modeler.cad.modeler.CsProps` """ if self._props or settings.aedt_version <= "2022.2" or self.name is None: return self._props diff --git a/src/ansys/aedt/core/modeler/circuits/primitives_circuit.py b/src/ansys/aedt/core/modeler/circuits/primitives_circuit.py index b5f32fc57d3..d4b6108025f 100644 --- a/src/ansys/aedt/core/modeler/circuits/primitives_circuit.py +++ b/src/ansys/aedt/core/modeler/circuits/primitives_circuit.py @@ -25,6 +25,7 @@ import math import os import secrets +import warnings from ansys.aedt.core.application.variables import decompose_variable_value from ansys.aedt.core.generic.constants import AEDT_UNITS @@ -1252,7 +1253,13 @@ def __init__(self, name, component_manager, file_name, component_library): @property def props(self): - """Retrieve the component properties.""" + """Component properties.""" + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """Component properties.""" if not self._props: self._props = load_keyword_in_aedt_file(self.file_name, self.name) return self._props diff --git a/src/ansys/aedt/core/modeler/circuits/primitives_emit.py b/src/ansys/aedt/core/modeler/circuits/primitives_emit.py index 3f3aef61c98..70d065ea7ba 100644 --- a/src/ansys/aedt/core/modeler/circuits/primitives_emit.py +++ b/src/ansys/aedt/core/modeler/circuits/primitives_emit.py @@ -23,6 +23,7 @@ # SOFTWARE. from collections import defaultdict +import warnings from ansys.aedt.core.emit_core import emit_constants as emit_consts import ansys.aedt.core.generic.constants as consts @@ -1015,16 +1016,25 @@ def __init__(self, editor, design, parent_component, node_name): @property def props(self): - """Returns a dictionary of all the properties for this node. + """Node properties - Parameters - ---------- - None + Returns + ------- + Dict + Dictionary of all the properties for this node. + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """Node properties Returns ------- Dict - Dictionary of all the properties for this node.""" + Dictionary of all the properties for this node. + """ prop_list = self.odesign.GetComponentNodeProperties(self.parent_component.name, self.node_name) props = dict(p.split("=", 1) for p in prop_list) return props diff --git a/src/ansys/aedt/core/modules/boundary/common.py b/src/ansys/aedt/core/modules/boundary/common.py index c304f8e032d..fd75c23fc36 100644 --- a/src/ansys/aedt/core/modules/boundary/common.py +++ b/src/ansys/aedt/core/modules/boundary/common.py @@ -24,6 +24,8 @@ """This module contains these classes: ``BoundaryCommon`` and ``BoundaryObject``.""" +import warnings + from ansys.aedt.core.generic.data_handlers import _dict2arg from ansys.aedt.core.generic.general_methods import PropsManager from ansys.aedt.core.generic.general_methods import pyaedt_function_handler @@ -269,7 +271,18 @@ def props(self): Returns ------- - :class:BoundaryProps + :class:`ansys.aedt.core.modules.boundary.common.BoundaryProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """Boundary data. + + Returns + ------- + :class:`ansys.aedt.core.modules.boundary.common.BoundaryProps` """ if self.__props: return self.__props diff --git a/src/ansys/aedt/core/modules/boundary/hfss_boundary.py b/src/ansys/aedt/core/modules/boundary/hfss_boundary.py index 7cbab30d372..dfaf9a857b6 100644 --- a/src/ansys/aedt/core/modules/boundary/hfss_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/hfss_boundary.py @@ -22,6 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +import warnings + from ansys.aedt.core.generic.data_handlers import _dict2arg from ansys.aedt.core.generic.general_methods import _dim_arg from ansys.aedt.core.generic.general_methods import pyaedt_function_handler @@ -58,6 +60,23 @@ def __init__(self, app, component_name, props, component_type): @property def props(self): + """AEDT boundary component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.boundary.common.BoundaryProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """AEDT boundary component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.boundary.common.BoundaryProps` + """ if not self.__props and self._app.design_properties: if ( self.type == "FarFieldSphere" diff --git a/src/ansys/aedt/core/modules/boundary/icepak_boundary.py b/src/ansys/aedt/core/modules/boundary/icepak_boundary.py index 817b5e7265e..83d06e7d6f1 100644 --- a/src/ansys/aedt/core/modules/boundary/icepak_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/icepak_boundary.py @@ -23,6 +23,7 @@ # SOFTWARE. from abc import abstractmethod import copy +import warnings from ansys.aedt.core.application.variables import decompose_variable_value from ansys.aedt.core.generic.general_methods import generate_unique_name @@ -58,7 +59,23 @@ def __init__(self, assignment_type, function_type): @property def props(self): - """Dictionary that defines all the boundary condition properties.""" + """Dictionary that defines all the boundary condition properties. + + Returns + ------- + dict + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """Dictionary that defines all the boundary condition properties. + + Returns + ------- + dict + """ return { "Type": self.assignment_type, "Function": self.function_type, @@ -1056,8 +1073,21 @@ def _link_type(self): @property def props(self): + """Link properties. + + Returns + ------- + list + First two elements of the list are the node names that the link connects, + the third element is the link type while the fourth contains the value + associated with the link. """ - Get link properties. + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """Link properties. Returns ------- @@ -1114,7 +1144,19 @@ def node_type(self): @property def props(self): - """Get properties of the node. + """Node properties. + + Returns + ------- + dict + Node properties. + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """Node properties. Returns ------- @@ -1125,7 +1167,19 @@ def props(self): @props.setter def props(self, props): - """Set properties of the node. + """Node properties. + + Parameters + ---------- + props : dict + Node properties. + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + self.properties = props + + @properties.setter + def properties(self, props): + """Node properties. Parameters ---------- diff --git a/src/ansys/aedt/core/modules/boundary/layout_boundary.py b/src/ansys/aedt/core/modules/boundary/layout_boundary.py index 41df52a5e97..60ce70e1558 100644 --- a/src/ansys/aedt/core/modules/boundary/layout_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/layout_boundary.py @@ -22,6 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +import warnings + from ansys.aedt.core.generic.data_handlers import _dict2arg from ansys.aedt.core.generic.data_handlers import random_string from ansys.aedt.core.generic.general_methods import GrpcApiError @@ -111,6 +113,17 @@ def __init__(self, app, component_type, component_name, props): @property def props(self): + """AEDT boundary component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.boundary.common.BoundaryProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): return self.__props @property @@ -331,7 +344,18 @@ def props(self): Returns ------- - :class:BoundaryProps + :class:`ansys.aedt.core.modules.boundary.common.BoundaryProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """Excitation data. + + Returns + ------- + :class:`ansys.aedt.core.modules.boundary.common.BoundaryProps` """ if self.__props: return self.__props diff --git a/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py b/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py index a95c7b6e8e3..a29b1836db2 100644 --- a/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py @@ -22,6 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +import warnings + from ansys.aedt.core.generic.data_handlers import _dict2arg from ansys.aedt.core.generic.general_methods import generate_unique_name from ansys.aedt.core.generic.general_methods import pyaedt_function_handler @@ -110,6 +112,17 @@ def _child_object(self): def props(self): """Maxwell parameter data. + Returns + ------- + :class:`ansys.aedt.core.modules.boundary.common.BoundaryProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """Maxwell parameter data. + Returns ------- :class:BoundaryProps diff --git a/src/ansys/aedt/core/modules/mesh.py b/src/ansys/aedt/core/modules/mesh.py index 7f79e5e4d37..6bf52279556 100644 --- a/src/ansys/aedt/core/modules/mesh.py +++ b/src/ansys/aedt/core/modules/mesh.py @@ -28,6 +28,7 @@ import os import shutil +import warnings from ansys.aedt.core.application.design_solutions import model_names from ansys.aedt.core.generic.data_handlers import _dict2arg @@ -139,9 +140,26 @@ def type(self): @property def props(self): + """AEDT mesh component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.mesh.MeshProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """AEDT mesh component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.mesh.MeshProps` + """ if not self._legacy_props: props = {} - for k, v in self.properties.items(): + for k, v in super().properties.items(): props[k] = v if "Assignment" in props: assignment = props["Assignment"] diff --git a/src/ansys/aedt/core/modules/solve_setup.py b/src/ansys/aedt/core/modules/solve_setup.py index 181edf207ad..2f0d8f2dd61 100644 --- a/src/ansys/aedt/core/modules/solve_setup.py +++ b/src/ansys/aedt/core/modules/solve_setup.py @@ -207,6 +207,23 @@ def analyze( @property def props(self): + """AEDT boundary component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.solve_sweeps.SetupProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """AEDT boundary component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.solve_sweeps.SetupProps` + """ if self._legacy_props: return self._legacy_props if self._is_new_setup: @@ -230,6 +247,13 @@ def props(self): @props.setter def props(self, value): + """AEDT boundary component internal properties.""" + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + self.properties = value + + @properties.setter + def properties(self, value): + """AEDT boundary component internal properties.""" self._legacy_props = SetupProps(self, value) @property @@ -1104,6 +1128,23 @@ def __init__(self, app, solution_type, name="MySetupAuto", is_new_setup=True): @property def props(self): + """AEDT boundary component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.solve_sweeps.SetupProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """AEDT boundary component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.solve_sweeps.SetupProps` + """ if self._legacy_props: return self._legacy_props if self._is_new_setup: @@ -1807,6 +1848,23 @@ def sweeps(self): @property def props(self): + """AEDT boundary component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.solve_sweeps.SetupProps` + """ + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + return self.properties + + @property + def properties(self): + """AEDT boundary component internal properties. + + Returns + ------- + :class:`ansys.aedt.core.modules.solve_sweeps.SetupProps` + """ if self._legacy_props: return self._legacy_props if self._is_new_setup: @@ -1828,6 +1886,13 @@ def props(self): @props.setter def props(self, value): + """AEDT boundary component internal properties.""" + warnings.warn("This method is deprecated. Use properties instead.", DeprecationWarning) + self.properties = value + + @properties.setter + def properties(self, value): + """AEDT boundary component internal properties.""" self._legacy_props = SetupProps(self, value) @property