diff --git a/LICENSE b/LICENSE index 6a949e7fd8c..4a8652561be 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +Copyright (c) 2021 - 2025 ANSYS, Inc. and/or its affiliates. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/doc/source/Getting_started/Installation.rst b/doc/source/Getting_started/Installation.rst index ff37cae9cc9..0d47a178d1b 100644 --- a/doc/source/Getting_started/Installation.rst +++ b/doc/source/Getting_started/Installation.rst @@ -14,7 +14,7 @@ requires Ansys Electronics Desktop (AEDT) 2022 R1 or later. The AEDT Student Ver Install from PyAEDT installer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following python script automatically installs PyAEDT from AEDT, +The following Python script automatically installs PyAEDT from AEDT, using the CPython interpreter included in the AEDT installation. In order to do that you can: @@ -23,7 +23,7 @@ In order to do that you can: - Open an Electronics Desktop Session and click on Tools->Run Script and execute the file. -- Offline install is also possible using wheelhouses. +- Offline installation is also possible using wheelhouses. .. note:: A wheelhouse is a zip containing all needed packages that can be installed offline. @@ -103,7 +103,7 @@ If you want to install the PyAEDT panels in the AEDT Automation tab, use the fol pip install pyaedt[installer] -Finally, in the python console, run the following commands: +Finally, in the Python console, run the following commands: .. code:: @@ -114,10 +114,10 @@ You can also install the PyAEDT panels using the following steps, this is also u - Download the following file: :download:`PyAEDT panel Installer Python file <../Resources/toolkit_installer_from_aedt.py>` -- Define an environment variable called `PYAEDT_INTERPRETER` with the path of the python interpreter in which PyAEDT is installed. +- Define an environment variable called `PYAEDT_INTERPRETER` with the path of the Python interpreter in which PyAEDT is installed. - Open an Electronics Desktop Session and click on Tools->Run Script and execute the file. You do not need the previous step if -you pass as an argument the path of the python interpreter. +you pass as an argument the path of the Python interpreter. Linux support @@ -141,7 +141,7 @@ From the `Releases `_ page in the PyAEDT repository, you can find the wheelhouses for a particular release in its assets and download the wheelhouse specific to your setup. -There are two kind of wheelhouses: `all` and `installer`. +There are two kinds of wheelhouses: `all` and `installer`. The `all` wheelhouse contains all PyAEDT dependencies. And the `installer` one includes `ipython` and `jupyter lab`. @@ -160,7 +160,7 @@ If you want to add the PyAEDT panels in the AEDT Automation tab, you need first pip install --no-cache-dir --no-index --find-links=file:////PyAEDT-v-wheelhouse-Windows-3.10 pyaedt[installer] -Finally, in the python console, run the following commands: +Finally, in the Python console, run the following commands: .. code:: diff --git a/doc/source/Resources/pyaedt_installer_from_aedt.py b/doc/source/Resources/pyaedt_installer_from_aedt.py index 6b4451a9c00..12abb5d58e7 100644 --- a/doc/source/Resources/pyaedt_installer_from_aedt.py +++ b/doc/source/Resources/pyaedt_installer_from_aedt.py @@ -39,6 +39,20 @@ VENV_DIR_PREFIX = ".pyaedt_env" + +""" +It is possible create Python virtual environment in a specific directory by setting variable VENV_DIR. +For example, +VENV_DIR = "e:/pyaedt_env" +""" +VENV_DIR = None +if not VENV_DIR: + if is_windows: + VENV_DIR = os.path.join(os.environ["APPDATA"], VENV_DIR_PREFIX) + else: + VENV_DIR = os.path.join(os.environ["HOME"], VENV_DIR_PREFIX) + + DISCLAIMER = ( "This script will download and install certain third-party software and/or " "open-source software (collectively, 'Third-Party Software'). Such Third-Party " @@ -99,10 +113,10 @@ def run_pyinstaller_from_c_python(oDesktop): # Add PyAEDT tabs in AEDT # Virtual environment path and Python executable if is_windows: - venv_dir = os.path.join(os.environ["APPDATA"], VENV_DIR_PREFIX, python_version_new) + venv_dir = os.path.join(VENV_DIR, python_version_new) python_exe = os.path.join(venv_dir, "Scripts", "python.exe") else: - venv_dir = os.path.join(os.environ["HOME"], VENV_DIR_PREFIX, python_version_new) + venv_dir = os.path.join(VENV_DIR, python_version_new) python_exe = os.path.join(venv_dir, "bin", "python") pyaedt_path = os.path.join(venv_dir, "Lib", "site-packages", "ansys", "aedt", "core") if is_linux: @@ -207,11 +221,11 @@ def install_pyaedt(): python_version = "3_7" if is_windows: - venv_dir = Path(os.environ["APPDATA"], VENV_DIR_PREFIX, python_version) + venv_dir = Path(VENV_DIR, python_version) python_exe = venv_dir / "Scripts" / "python.exe" pip_exe = venv_dir / "Scripts" / "pip.exe" else: - venv_dir = Path(os.environ["HOME"], VENV_DIR_PREFIX, python_version) + venv_dir = Path(VENV_DIR, python_version) python_exe = venv_dir / "bin" / "python" pip_exe = venv_dir / "bin" / "pip" os.environ["ANSYSEM_ROOT{}".format(args.version)] = args.edt_root diff --git a/src/ansys/aedt/core/__init__.py b/src/ansys/aedt/core/__init__.py index e0c8111cb18..2b3d78a9d33 100644 --- a/src/ansys/aedt/core/__init__.py +++ b/src/ansys/aedt/core/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/aedt_logger.py b/src/ansys/aedt/core/aedt_logger.py index b49b4a8664f..4a8011a99c3 100644 --- a/src/ansys/aedt/core/aedt_logger.py +++ b/src/ansys/aedt/core/aedt_logger.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/application/__init__.py b/src/ansys/aedt/core/application/__init__.py index a83f6a966d8..898778ba6a4 100644 --- a/src/ansys/aedt/core/application/__init__.py +++ b/src/ansys/aedt/core/application/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/application/aedt_file_management.py b/src/ansys/aedt/core/application/aedt_file_management.py index a7cc998f120..e2af1362e74 100644 --- a/src/ansys/aedt/core/application/aedt_file_management.py +++ b/src/ansys/aedt/core/application/aedt_file_management.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/application/aedt_objects.py b/src/ansys/aedt/core/application/aedt_objects.py index 51e79a7f568..46c92d2436d 100644 --- a/src/ansys/aedt/core/application/aedt_objects.py +++ b/src/ansys/aedt/core/application/aedt_objects.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -81,6 +81,7 @@ def __init__(self, desktop=None, project=None, design=None, is_inherithed=False) self._o_symbol_manager = None self._opadstackmanager = None self._oradfield = None + self._onetwork_data_explorer = None @property def oradfield(self): @@ -429,3 +430,15 @@ def o_model_manager(self): if not self._o_model_manager and self.odefinition_manager: self._o_model_manager = self.odefinition_manager.GetManager("Model") return self._o_model_manager + + @property + def onetwork_data_explorer(self): + """Network data explorer module. + + References + ---------- + >>> oDesktop.GetTool("NdExplorer") + """ + if not self._onetwork_data_explorer: + self._onetwork_data_explorer = self._odesktop.GetTool("NdExplorer") + return self._onetwork_data_explorer diff --git a/src/ansys/aedt/core/application/analysis.py b/src/ansys/aedt/core/application/analysis.py index 494e4b58d8c..c0e1ca8e508 100644 --- a/src/ansys/aedt/core/application/analysis.py +++ b/src/ansys/aedt/core/application/analysis.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -1542,7 +1542,6 @@ def get_setup(self, name): def create_output_variable(self, variable, expression, solution=None, context=None): """Create or modify an output variable. - Parameters ---------- variable : str, optional diff --git a/src/ansys/aedt/core/application/analysis_3d.py b/src/ansys/aedt/core/application/analysis_3d.py index 58377f595e5..7a57c987a98 100644 --- a/src/ansys/aedt/core/application/analysis_3d.py +++ b/src/ansys/aedt/core/application/analysis_3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -1472,12 +1472,14 @@ def import_gds_3d(self, input_file: str, mapping_layers: dict, units: str = "um" def _find_indices(self, list_to_check, item_to_find): # type: (list, str|int) -> list """Given a list, returns the list of indices for all occurrences of a given element. + Parameters ---------- list_to_check: list List to check. item_to_find: str, int Element to search for in the list. + Returns ------- list diff --git a/src/ansys/aedt/core/application/analysis_3d_layout.py b/src/ansys/aedt/core/application/analysis_3d_layout.py index 796953d1bee..a54fd0aeab6 100644 --- a/src/ansys/aedt/core/application/analysis_3d_layout.py +++ b/src/ansys/aedt/core/application/analysis_3d_layout.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/application/analysis_circuit_netlist.py b/src/ansys/aedt/core/application/analysis_circuit_netlist.py index 95103c9accd..3e3907fc0d8 100644 --- a/src/ansys/aedt/core/application/analysis_circuit_netlist.py +++ b/src/ansys/aedt/core/application/analysis_circuit_netlist.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/application/analysis_hf.py b/src/ansys/aedt/core/application/analysis_hf.py index 7d0ba7dea71..3cb7e850deb 100644 --- a/src/ansys/aedt/core/application/analysis_hf.py +++ b/src/ansys/aedt/core/application/analysis_hf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/application/analysis_icepak.py b/src/ansys/aedt/core/application/analysis_icepak.py index d4c1400bce6..3a4cad4c065 100644 --- a/src/ansys/aedt/core/application/analysis_icepak.py +++ b/src/ansys/aedt/core/application/analysis_icepak.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/application/analysis_maxwell_circuit.py b/src/ansys/aedt/core/application/analysis_maxwell_circuit.py index 4a58ff6879b..41a18fe8457 100644 --- a/src/ansys/aedt/core/application/analysis_maxwell_circuit.py +++ b/src/ansys/aedt/core/application/analysis_maxwell_circuit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -28,6 +28,7 @@ class AnalysisMaxwellCircuit(Analysis): """Provides the Maxwell Circuit (MaxwellCircuit) interface. + Maxwell Circuit Editor has no setup, solution, analysis or postprocessor It is automatically initialized by Application call (Maxwell Circuit). Refer to Application function for inputs definition diff --git a/src/ansys/aedt/core/application/analysis_nexxim.py b/src/ansys/aedt/core/application/analysis_nexxim.py index c5e653e257d..9176d328c39 100644 --- a/src/ansys/aedt/core/application/analysis_nexxim.py +++ b/src/ansys/aedt/core/application/analysis_nexxim.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/application/analysis_r_m_xprt.py b/src/ansys/aedt/core/application/analysis_r_m_xprt.py index e8f7f3f8d7f..e2ad0e6e68f 100644 --- a/src/ansys/aedt/core/application/analysis_r_m_xprt.py +++ b/src/ansys/aedt/core/application/analysis_r_m_xprt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/application/analysis_twin_builder.py b/src/ansys/aedt/core/application/analysis_twin_builder.py index d2008966d90..dbc6c33b1ca 100644 --- a/src/ansys/aedt/core/application/analysis_twin_builder.py +++ b/src/ansys/aedt/core/application/analysis_twin_builder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -31,14 +31,12 @@ class AnalysisTwinBuilder(Analysis): """Provides the Twin Builder Analysis Setup (TwinBuilder). + It is automatically initialized by Application call (Twin Builder). Refer to Application function for inputs definition Parameters ---------- - Returns - ------- - """ @property diff --git a/src/ansys/aedt/core/application/design.py b/src/ansys/aedt/core/application/design.py index 8bd231884eb..e5b9c1d2b83 100644 --- a/src/ansys/aedt/core/application/design.py +++ b/src/ansys/aedt/core/application/design.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -386,7 +386,6 @@ def design_datasets(self) -> Dict[str, DataSet]: def boundaries(self) -> List[BoundaryObject]: """Design boundaries and excitations. - Returns ------- list[:class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`] @@ -1026,7 +1025,6 @@ def temp_directory(self) -> str: def toolkit_directory(self) -> str: """Path to the toolkit directory. - Returns ------- str diff --git a/src/ansys/aedt/core/application/design_solutions.py b/src/ansys/aedt/core/application/design_solutions.py index 8531a688e7b..cfb31b795ce 100644 --- a/src/ansys/aedt/core/application/design_solutions.py +++ b/src/ansys/aedt/core/application/design_solutions.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -884,6 +884,7 @@ def __init__(self, odesign, design_type, aedt_version): @property def problem_type(self): """Get/Set the problem type of the icepak Design. + It can be any of`"TemperatureAndFlow"`, `"TemperatureOnly"`,`"FlowOnly"`. """ if self._odesign: diff --git a/src/ansys/aedt/core/application/job_manager.py b/src/ansys/aedt/core/application/job_manager.py index 67f2777b570..f7f141a7f69 100644 --- a/src/ansys/aedt/core/application/job_manager.py +++ b/src/ansys/aedt/core/application/job_manager.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/application/variables.py b/src/ansys/aedt/core/application/variables.py index ff951562e54..84a545533fb 100644 --- a/src/ansys/aedt/core/application/variables.py +++ b/src/ansys/aedt/core/application/variables.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/circuit.py b/src/ansys/aedt/core/circuit.py index c7917d140b5..63edd35b2a5 100644 --- a/src/ansys/aedt/core/circuit.py +++ b/src/ansys/aedt/core/circuit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -192,7 +192,6 @@ def __init__( remove_lock=remove_lock, ) ScatteringMethods.__init__(self, self) - self.onetwork_data_explorer = self._desktop.GetTool("NdExplorer") def _init_from_design(self, *args, **kwargs): self.__init__(*args, **kwargs) @@ -1707,11 +1706,15 @@ def create_tdr_schematic_from_snp( center_y = sub.location[1] left = 0 delta_y = -1 * sub.location[1] - 2000 - 50 * len(tx_schematic_pins) + if differential: tdr_probe = self.modeler.components.components_catalog["TDR_Differential_Ended"] else: tdr_probe = self.modeler.components.components_catalog["TDR_Single_Ended"] + tdr_probe_names = [] + n_pin = None + for i, probe_pin in enumerate(tx_schematic_pins): pos_y = unit_converter(delta_y - left * 1000, input_units="mil", output_units=self.modeler.schematic_units) left += 1 diff --git a/src/ansys/aedt/core/circuit_netlist.py b/src/ansys/aedt/core/circuit_netlist.py index b5b4579ba1b..32a2ca72e58 100644 --- a/src/ansys/aedt/core/circuit_netlist.py +++ b/src/ansys/aedt/core/circuit_netlist.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/common_rpc.py b/src/ansys/aedt/core/common_rpc.py index 7673a04fe3e..ea0b93a4e75 100644 --- a/src/ansys/aedt/core/common_rpc.py +++ b/src/ansys/aedt/core/common_rpc.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/desktop.py b/src/ansys/aedt/core/desktop.py index f25703d17bb..c7df255fc9f 100644 --- a/src/ansys/aedt/core/desktop.py +++ b/src/ansys/aedt/core/desktop.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -22,8 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" -This module contains the ``Desktop`` class. +"""This module contains the ``Desktop`` class. + This module is used to initialize AEDT and the message manager for managing AEDT. You can initialize this module before launching an app or have the app automatically initialize it to the latest installed AEDT version. @@ -378,8 +378,10 @@ def is_student_version(oDesktop): def _init_desktop_from_design(*args, **kwargs): - """Distinguishes if the ``Desktop`` class is initialized internally from the ``Design`` - class or directly from the user. For example, ``desktop=Desktop()``).""" + """Distinguishes if the ``Desktop`` class is initialized internally. + + It can be initialized from the ``Design`` class or directly from the user. + For example, ``desktop=Desktop()``).""" Desktop._invoked_from_design = True return Desktop(*args, **kwargs) @@ -514,8 +516,8 @@ def __init__( if getattr(self, "_initialized", None) is not None and self._initialized: try: self.grpc_plugin.recreate_application(True) - except Exception: # nosec - pass + except Exception: + pyaedt_logger.debug("Failed to recreate application.") return else: self._initialized = True diff --git a/src/ansys/aedt/core/downloads.py b/src/ansys/aedt/core/downloads.py index 9929387b0f3..7ca057ae820 100644 --- a/src/ansys/aedt/core/downloads.py +++ b/src/ansys/aedt/core/downloads.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -226,6 +226,7 @@ def download_edb_merge_utility(force_download=False, destination=None): def download_netlist(destination=None): """Download an example of netlist File and return the def path. + Examples files are downloaded to a persistent cache to avoid re-downloading the same file twice. diff --git a/src/ansys/aedt/core/edb.py b/src/ansys/aedt/core/edb.py index c6934a099b0..4bfc71680ba 100644 --- a/src/ansys/aedt/core/edb.py +++ b/src/ansys/aedt/core/edb.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/emit.py b/src/ansys/aedt/core/emit.py index 46eb22676ea..e055069d053 100644 --- a/src/ansys/aedt/core/emit.py +++ b/src/ansys/aedt/core/emit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/emit_core/__init__.py b/src/ansys/aedt/core/emit_core/__init__.py index ee70a199e8d..1bd5357b690 100644 --- a/src/ansys/aedt/core/emit_core/__init__.py +++ b/src/ansys/aedt/core/emit_core/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/emit_core/couplings.py b/src/ansys/aedt/core/emit_core/couplings.py index 738101b04a1..2b66c40fc1b 100644 --- a/src/ansys/aedt/core/emit_core/couplings.py +++ b/src/ansys/aedt/core/emit_core/couplings.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -22,8 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" -This module contains these classes: `CouplingsEmit`. +"""This module contains these classes: `CouplingsEmit`. + This module provides for interacting with EMIT Analysis and Results windows. """ diff --git a/src/ansys/aedt/core/emit_core/emit_constants.py b/src/ansys/aedt/core/emit_core/emit_constants.py index 108bc579bf5..08315e27803 100644 --- a/src/ansys/aedt/core/emit_core/emit_constants.py +++ b/src/ansys/aedt/core/emit_core/emit_constants.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -22,8 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" -Enums from the ``EmitApiPython`` module are defined as ``None`` until this module initializes. +"""Enums from the ``EmitApiPython`` module are defined as ``None`` until this module initializes. + This allows IDE auto-complete to find them and ``emit_constants`` to import before the ``EmitApiPython`` module has loaded (typically when a ``ansys.aedt.core.Emit()`` object is created). diff --git a/src/ansys/aedt/core/emit_core/results/__init__.py b/src/ansys/aedt/core/emit_core/results/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/emit_core/results/__init__.py +++ b/src/ansys/aedt/core/emit_core/results/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/emit_core/results/results.py b/src/ansys/aedt/core/emit_core/results/results.py index a3e358fcb7b..4c7265cd16e 100644 --- a/src/ansys/aedt/core/emit_core/results/results.py +++ b/src/ansys/aedt/core/emit_core/results/results.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/emit_core/results/revision.py b/src/ansys/aedt/core/emit_core/results/revision.py index fa42e4d732a..05188a58616 100644 --- a/src/ansys/aedt/core/emit_core/results/revision.py +++ b/src/ansys/aedt/core/emit_core/results/revision.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -429,8 +429,7 @@ def n_to_1_limit(self, max_instances): @pyaedt_function_handler() def interference_type_classification(self, domain, use_filter=False, filter_list=None): # pragma: no cover - """ - Classify interference type as according to inband/inband, + """Classify interference type as according to inband/inband, out of band/in band, inband/out of band, and out of band/out of band. Parameters diff --git a/src/ansys/aedt/core/filtersolutions.py b/src/ansys/aedt/core/filtersolutions.py index edc830d7012..54574dd88f1 100644 --- a/src/ansys/aedt/core/filtersolutions.py +++ b/src/ansys/aedt/core/filtersolutions.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/filtersolutions_core/__init__.py b/src/ansys/aedt/core/filtersolutions_core/__init__.py index 6d4c9c6d0cd..0839d1c1e95 100644 --- a/src/ansys/aedt/core/filtersolutions_core/__init__.py +++ b/src/ansys/aedt/core/filtersolutions_core/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/filtersolutions_core/attributes.py b/src/ansys/aedt/core/filtersolutions_core/attributes.py index 0d616a2dfb1..6db2cbcc8ae 100644 --- a/src/ansys/aedt/core/filtersolutions_core/attributes.py +++ b/src/ansys/aedt/core/filtersolutions_core/attributes.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -636,6 +636,7 @@ def filter_type(self, filter_type: FilterType): @property def filter_class(self) -> FilterClass: """Class (band definition) of the filter. The default is ``LOW_PASS``. + The ``FilterClass`` enum provides a list of all classes. Returns @@ -654,6 +655,7 @@ def filter_class(self, filter_class: FilterClass): @property def filter_implementation(self) -> FilterImplementation: """Technology for implementing the filter. The default is ``LUMPED``. + The ``FilterImplementation`` enum provides a list of all implementations. Returns @@ -770,6 +772,7 @@ def filter_order(self, filter_order: int): @property def minimum_order_stop_band_attenuation_db(self) -> str: """Filter stop band attenuation in dB for calculation of the filter minimum order. + The default is ``50``. Returns @@ -791,6 +794,7 @@ def minimum_order_stop_band_attenuation_db(self, minimum_order_stop_band_attenua @property def minimum_order_stop_band_frequency(self) -> str: """Filter stop band frequency for calculation of the filter minimum order. + The default is ``10 GHz``. Returns @@ -812,6 +816,7 @@ def minimum_order_stop_band_frequency(self, minimum_order_stop_band_frequency_st @property def minimum_order_group_delay_error_percent(self) -> str: """Filter maximum group delay in % for calculation of the filter minimum order. + The default is ``5``. Returns @@ -868,6 +873,7 @@ def ideal_minimum_order(self) -> int: @property def delay_time(self) -> str: """Filter delay time. + The default is ``1 ns``. Returns @@ -884,6 +890,7 @@ def delay_time(self, delay_time_string): @property def pass_band_definition(self) -> PassbandDefinition: """Pass band frequency entry options. + The default is ``CENTER_FREQUENCY``. Returns @@ -938,6 +945,7 @@ def pass_band_width_frequency(self, pass_band_freq_string): @property def lower_frequency(self) -> str: """Filter lower corner frequency. + The default is ``905 MHz``. Returns @@ -954,6 +962,7 @@ def lower_frequency(self, lower_freq_string): @property def upper_frequency(self) -> str: """Filter upper corner frequency. + The default is ``1.105 MHz``. Returns @@ -987,6 +996,7 @@ def diplexer_inner_band_width(self, diplexer_inner_band_width_string): @property def diplexer_outer_band_width(self) -> str: """Diplexer outer band width for ``BP1`` and ``Triplexer1`` diplexer types. + The default is ``2 GHz``. Returns @@ -1003,6 +1013,7 @@ def diplexer_outer_band_width(self, diplexer_outer_band_width_string): @property def diplexer_lower_center_frequency(self) -> str: """Diplexer lower center frequency for ``BP2`` and ``Triplexer2`` diplexer types. + The default is ``500 MHz``. Returns @@ -1078,6 +1089,7 @@ def diplexer_upper_band_width(self, diplexer_upper_band_width_string): @property def stop_band_definition(self) -> StopbandDefinition: """Stop band parameter entry option. + The default is ``RATIO``. Returns @@ -1099,6 +1111,7 @@ def stop_band_definition(self, column: StopbandDefinition): @property def stop_band_ratio(self) -> str: """Filter stop band ratio. + The default is ``1.2``. Returns @@ -1115,6 +1128,7 @@ def stop_band_ratio(self, stop_band_ratio_string): @property def stop_band_frequency(self) -> str: """Filter stop band frequency. + The default is ``1.2 GHz``. Returns @@ -1202,6 +1216,7 @@ def data_transmission_filter(self, data_transmission_filter: bool): @property def raised_cosine_alpha_percentage(self) -> RaisedCosineAlphaPercentage: """Raised cosine alpha percentage. + The default is ''FORTY''. Returns @@ -1241,6 +1256,7 @@ def equiripple_delay(self, equiripple_delay: bool): @property def group_delay_ripple_period(self) -> str: """Filter approximate normalized group delay ripple period. + The default is ''2''. Returns @@ -1260,6 +1276,7 @@ def group_delay_ripple_period(self, group_delay_ripple_period_string): @property def normalized_group_delay_percentage(self) -> int: """Normalized group delay percentage. + The default is ''0''. Returns @@ -1321,6 +1338,7 @@ def bessel_normalized_delay(self, bessel_normalized_delay: bool): @property def bessel_normalized_delay_period(self) -> str: """Bessel filter normalized delay period. + The default is ''2''. Returns @@ -1340,6 +1358,7 @@ def bessel_normalized_delay_period(self, bessel_normalized_delay_period_string): @property def bessel_normalized_delay_percentage(self) -> int: """Bessel filter ripple percentage. + The default is ''0''. Returns @@ -1361,6 +1380,7 @@ def bessel_normalized_delay_percentage(self, column: BesselRipplePercentage): @property def pass_band_ripple(self) -> str: """Filter pass band ripple in dB. + The default is ''0.05 dB''. Returns @@ -1473,6 +1493,7 @@ def asymmetric_low_stop_band_ratio(self, asymmetric_low_stop_band_ratio_string): @property def asymmetric_high_stop_band_ratio(self) -> str: """Stop-band ratio for high side of an asymmetric filter. + The default is ''1.2''. Returns @@ -1494,6 +1515,7 @@ def asymmetric_high_stop_band_ratio(self, asymmetric_high_stop_band_ratio_string @property def asymmetric_low_stop_band_attenuation_db(self) -> str: """Stop-band attenuation for low side of an asymmetric filter. + The default is ''60 dB''. Returns @@ -1537,6 +1559,7 @@ def asymmetric_high_stop_band_attenuation_db(self, asymmetric_high_stop_band_att @property def gaussian_transition(self) -> GaussianTransition: """Gaussian filter transition option. + The default is ''TRANSITION_NONE''. Returns @@ -1683,6 +1706,7 @@ def half_band_ripple(self, half_band_ripple: bool): @property def constrict_ripple_percent(self) -> str: """Filter ripple constriction percentage. + The default is ''50%''. Returns @@ -1717,6 +1741,7 @@ def ripple_constriction_band(self, ripple_constriction_band: RippleConstrictionB @property def single_point_ripple_inf_zeros(self) -> SinglePointRippleInfZeros: """Filter number of single point ripple infinite zeros. + The default is ''RIPPLE_INF_ZEROS_1''. Returns diff --git a/src/ansys/aedt/core/filtersolutions_core/dll_interface.py b/src/ansys/aedt/core/filtersolutions_core/dll_interface.py index f2528221887..dbd6fad143f 100644 --- a/src/ansys/aedt/core/filtersolutions_core/dll_interface.py +++ b/src/ansys/aedt/core/filtersolutions_core/dll_interface.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/filtersolutions_core/export_to_aedt.py b/src/ansys/aedt/core/filtersolutions_core/export_to_aedt.py index 1e1db5c7b8f..77a4972e21d 100644 --- a/src/ansys/aedt/core/filtersolutions_core/export_to_aedt.py +++ b/src/ansys/aedt/core/filtersolutions_core/export_to_aedt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -500,8 +500,8 @@ def _open_aedt_export(self): @property def schematic_name(self) -> str: """Name of the exported schematic in ``AEDT``, displayed as the project and design names. - The default name is ``FilterSolutions`` if not specified. + The default name is ``FilterSolutions`` if not specified. Returns ------- @@ -552,8 +552,7 @@ def include_group_delay_enabled(self, include_group_delay_enabled: bool): @property def include_gt_gain_enabled(self) -> bool: - """Flag indicating if the total voltage gain report will be created upon - export to ``AEDT``. + """Flag indicating if the total voltage gain report will be created upon export to ``AEDT``. Returns ------- @@ -644,8 +643,7 @@ def include_forward_transfer_s21_enabled(self, include_forward_transfer_s21_enab @property def include_reverse_transfer_s12_enabled(self) -> bool: - """Flag indicating if the reverse transfer gain report will be created upon - export to ``AEDT``. + """Flag indicating if the reverse transfer gain report will be created upon export to ``AEDT``. Returns ------- @@ -663,8 +661,7 @@ def include_reverse_transfer_s12_enabled(self, include_reverse_transfer_s12_enab @property def include_output_return_loss_s22_enabled(self) -> bool: - """Flag indicating if the output return loss report will be created upon - export to ``AEDT``. + """Flag indicating if the output return loss report will be created upon export to ``AEDT``. Returns ------- @@ -682,8 +679,7 @@ def include_output_return_loss_s22_enabled(self, include_output_return_loss_s22_ @property def db_format_enabled(self) -> bool: - """Flag indicating if the report format in dB in the - exported filter to ``AEDT`` is enabled. + """Flag indicating if the report format in dB in the exported filter to ``AEDT`` is enabled. Returns ------- @@ -1046,6 +1042,7 @@ def interconnect_length_value(self, interconnect_length_value_string): @property def interconnect_minimum_length_value(self) -> str: """Minimum value of interconnect physical length. + The minimum value of the interconnect physical length represents the smallest length that the interconnect line can have in the design. This value is used to determine the minimum dimensions of interconnect lines for optimization purposes. @@ -1092,6 +1089,7 @@ def interconnect_maximum_length_value(self, interconnect_maximum_length_value_st @property def interconnect_line_width_value(self) -> str: """Interconnect conductor width value. + The interconnect conductor width value represents the actual width of the interconnect line in the design. This value is crucial for determining the electrical characteristics of the interconnect, such as impedance, signal integrity, and potential signal loss. Accurate width measurements are essential for ensuring that the @@ -1116,6 +1114,7 @@ def interconnect_line_width_value(self, interconnect_line_width_value_string): @property def interconnect_minimum_width_value(self) -> str: """Minimum value of interconnect conductor width. + The minimum value of the interconnect conductor width represents the smallest width that the interconnect line can have in the design. This value is used to determine the minimum dimensions of interconnect lines for optimization purposes. @@ -1139,6 +1138,7 @@ def interconnect_minimum_width_value(self, interconnect_minimum_width_value_stri @property def interconnect_maximum_width_value(self) -> str: """Maximum value of interconnect conductor width. + The maximum value of the interconnect conductor width represents the largest width that the interconnect line can have in the design. This value is used to determine the maximum dimensions of interconnect lines for optimization purposes. @@ -1162,6 +1162,7 @@ def interconnect_maximum_width_value(self, interconnect_maximum_width_value_stri @property def interconnect_inductor_tolerance_value(self) -> str: """Tolerance value of interconnect inductor in ``%``. + The default is ``1``. Returns @@ -1182,6 +1183,7 @@ def interconnect_inductor_tolerance_value(self, interconnect_inductor_tolerance_ @property def interconnect_capacitor_tolerance_value(self) -> str: """Tolerance value of interconnect capacitor in ``%``. + The default is ``1``. Returns @@ -1230,6 +1232,7 @@ def update_inductor_capacitor_tolerances(self): @property def substrate_type(self) -> SubstrateType: """Subctrate type of the filter. + The ``SubstrateType`` enum provides a list of all substrate types. Returns @@ -1248,6 +1251,7 @@ def substrate_type(self, substrate_type: SubstrateType): @property def substrate_er(self) -> Union[SubstrateType, str]: """Substrate's relative permittivity ``Er``. + The value can be either a string or an instance of the ``SubstrateEr`` enum. The default is ``9.8`` for ``SubstrateEr.ALUMINA``. @@ -1283,6 +1287,7 @@ def substrate_er(self, substrate_input): @property def substrate_resistivity(self) -> Union[SubstrateResistivity, str]: """Substrate's resistivity. + The value can be either a string or an instance of the ``SubstrateResistivity`` enum. The default is ``1.43`` for ``SubstrateResistivity.GOLD``. @@ -1316,6 +1321,7 @@ def substrate_resistivity(self, substrate_input): @property def substrate_loss_tangent(self) -> Union[SubstrateEr, str]: """Substrate's loss tangent. + The value can be either a string or an instance of the ``SubstrateEr`` enum. The default is ``0.0005`` for ``SubstrateEr.ALUMINA``. @@ -1349,6 +1355,7 @@ def substrate_loss_tangent(self, substrate_input): @property def substrate_conductor_thickness(self) -> str: """Substrate's conductor thickness. + The default is ``2.54 um``. Returns @@ -1365,6 +1372,7 @@ def substrate_conductor_thickness(self, substrate_conductor_thickness_string): @property def substrate_dielectric_height(self) -> str: """Substrate's dielectric height. + The default is ``1.27 mm``. Returns @@ -1381,6 +1389,7 @@ def substrate_dielectric_height(self, substrate_dielectric_height_string): @property def substrate_unbalanced_lower_dielectric_height(self) -> str: """Substrate's lower dielectric height for unbalanced stripline substrate type. + The default is ``6.35 mm``. Returns @@ -1401,6 +1410,7 @@ def substrate_unbalanced_lower_dielectric_height(self, substrate_unbalanced_lowe @property def substrate_suspend_dielectric_height(self) -> str: """Substrate's suspend dielectric height above ground plane for suspend and inverted substrate types. + The default is ``1.27 mm``. Returns @@ -1517,6 +1527,7 @@ def modelithics_inductor_list(self, row_index) -> str: @property def modelithics_inductor_selection(self) -> str: """Selected ``Modelithics`` inductor family from the loaded list. + The Modelithics inductor family selection allows you to choose a specific inductor model from the Modelithics library. @@ -1608,6 +1619,7 @@ def modelithics_capacitor_list(self, row_index) -> str: @property def modelithics_capacitor_selection(self) -> str: """Selected ``Modelithics`` capacitor family from the loaded list. + The Modelithics capacitor family selection allows you to choose a specific capacitor model from the Modelithics library. diff --git a/src/ansys/aedt/core/filtersolutions_core/graph_setup.py b/src/ansys/aedt/core/filtersolutions_core/graph_setup.py index 98a64b4efaf..145822c00a2 100644 --- a/src/ansys/aedt/core/filtersolutions_core/graph_setup.py +++ b/src/ansys/aedt/core/filtersolutions_core/graph_setup.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/filtersolutions_core/ideal_response.py b/src/ansys/aedt/core/filtersolutions_core/ideal_response.py index 758116df5e6..2fe400c0252 100644 --- a/src/ansys/aedt/core/filtersolutions_core/ideal_response.py +++ b/src/ansys/aedt/core/filtersolutions_core/ideal_response.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/filtersolutions_core/lumped_nodes_and_leads.py b/src/ansys/aedt/core/filtersolutions_core/lumped_nodes_and_leads.py index b474ce4bc22..fddc096c5c0 100644 --- a/src/ansys/aedt/core/filtersolutions_core/lumped_nodes_and_leads.py +++ b/src/ansys/aedt/core/filtersolutions_core/lumped_nodes_and_leads.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -120,6 +120,7 @@ def c_lead_inductor(self, c_lead_inductor): @property def l_node_capacitor(self) -> str: """Shunt capacitance assigned to each inductor node. + The default is` ``0``. Returns @@ -136,6 +137,7 @@ def l_node_capacitor(self, l_node_capacitor): @property def l_lead_inductor(self) -> str: """Series inductance assigned to each inductor lead. + The default is ``0``. Returns @@ -168,6 +170,7 @@ def r_node_capacitor(self, r_node_capacitor): @property def r_lead_inductor(self) -> str: """Series inductance assigned to each resistor lead. + The default is ``0``. Returns diff --git a/src/ansys/aedt/core/filtersolutions_core/lumped_parasitics.py b/src/ansys/aedt/core/filtersolutions_core/lumped_parasitics.py index 3f57e77686e..c868b5322cc 100644 --- a/src/ansys/aedt/core/filtersolutions_core/lumped_parasitics.py +++ b/src/ansys/aedt/core/filtersolutions_core/lumped_parasitics.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -85,6 +85,7 @@ def _define_parasitics_dll_functions(self): @property def capacitor_q(self) -> str: """Q factor value of non-ideal capacitors in the synthesized circuit. + The default is ``infinite``. Returns @@ -101,6 +102,7 @@ def capacitor_q(self, capacitor_q_string): @property def capacitor_rs(self) -> str: """Series resistor value of non-ideal capacitors in the synthesized circuit. + The default is ``0``. Returns @@ -133,6 +135,7 @@ def capacitor_rp(self, capacitor_rp_string): @property def capacitor_ls(self) -> str: """Series inductance value of non-ideal capacitors in the synthesized circuit. + The default is ``0``. Returns @@ -165,6 +168,7 @@ def inductor_q(self, inductor_q_string): @property def inductor_rs(self) -> str: """Series resistor value of non-ideal inductors in the synthesized circuit. + The default is` ``0``. Returns @@ -181,6 +185,7 @@ def inductor_rs(self, inductor_rs_string): @property def inductor_rp(self) -> str: """Shunt resistor value of non-ideal inductors in the synthesized circuit. + The default is ``infinite``. Returns @@ -197,6 +202,7 @@ def inductor_rp(self, inductor_rp_string): @property def inductor_cp(self) -> str: """Shunt capacitor value of non-ideal inductors in the synthesized circuit. + The default is ``0``. Returns diff --git a/src/ansys/aedt/core/filtersolutions_core/lumped_termination_impedance_table.py b/src/ansys/aedt/core/filtersolutions_core/lumped_termination_impedance_table.py index 31561639a9c..9fe6a80fd9d 100644 --- a/src/ansys/aedt/core/filtersolutions_core/lumped_termination_impedance_table.py +++ b/src/ansys/aedt/core/filtersolutions_core/lumped_termination_impedance_table.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -172,6 +172,7 @@ def table_type_to_bool(self): @property def row_count(self) -> int: """Count of the accumulated complex impedances in the complex impedances's table. + The default is ``3``. Returns @@ -332,13 +333,13 @@ def complex_definition(self, complex_definition: ComplexTerminationDefinition): @property def reactance_type(self) -> ComplexReactanceType: """Reactance type of complex impedance in the complex impedance table. + The default is ``reactance``. Returns ------- :enum:`ComplexReactanceType` """ - type_string_buffer = create_string_buffer(100) status = self._dll.getLumpedComplexReactanceType( type_string_buffer, @@ -377,6 +378,7 @@ def compensation_enabled(self, compensation_enabled: bool): @property def compensation_order(self) -> int: """Order of impedance compensation. + The default is` ``2``. Returns diff --git a/src/ansys/aedt/core/filtersolutions_core/lumped_topology.py b/src/ansys/aedt/core/filtersolutions_core/lumped_topology.py index 1df310d3924..f3a548b51a5 100644 --- a/src/ansys/aedt/core/filtersolutions_core/lumped_topology.py +++ b/src/ansys/aedt/core/filtersolutions_core/lumped_topology.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -205,6 +205,7 @@ def current_source(self, current_source: bool): @property def first_shunt(self) -> bool: """Flag indicating if shunt elements are first in the synthesized circuit. + If ``False``, series elements are first. Returns diff --git a/src/ansys/aedt/core/filtersolutions_core/multiple_bands_table.py b/src/ansys/aedt/core/filtersolutions_core/multiple_bands_table.py index c5d0b1b52df..f5db02e7523 100644 --- a/src/ansys/aedt/core/filtersolutions_core/multiple_bands_table.py +++ b/src/ansys/aedt/core/filtersolutions_core/multiple_bands_table.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -68,6 +68,7 @@ def _define_multiple_bands_dll_functions(self): @property def row_count(self) -> int: """Total number of rows present in the multiple bands table. + The default is ``2``. Returns diff --git a/src/ansys/aedt/core/filtersolutions_core/optimization_goals_table.py b/src/ansys/aedt/core/filtersolutions_core/optimization_goals_table.py index 242ec992512..d15e3d1f15c 100644 --- a/src/ansys/aedt/core/filtersolutions_core/optimization_goals_table.py +++ b/src/ansys/aedt/core/filtersolutions_core/optimization_goals_table.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -110,6 +110,7 @@ def _bytes_or_none(self, str_value): @property def row_count(self) -> int: """Number of golas in the optimization goals table. + The default is `0`. Returns @@ -123,6 +124,7 @@ def row_count(self) -> int: def row(self, row_index) -> list: """Get the values for one row of the optimization goals table. + The values are returned as a list: [value1, value2, ..., value7]. Parameters diff --git a/src/ansys/aedt/core/filtersolutions_core/transmission_zeros.py b/src/ansys/aedt/core/filtersolutions_core/transmission_zeros.py index 18fe4233244..38ebbb38ae7 100644 --- a/src/ansys/aedt/core/filtersolutions_core/transmission_zeros.py +++ b/src/ansys/aedt/core/filtersolutions_core/transmission_zeros.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -126,6 +126,7 @@ def table_format_to_bool(self): @property def row_count(self) -> int: """Number of transmission zeros in the transmission zeros table. + The default is ``2``. Returns @@ -167,8 +168,7 @@ def row(self, row_index): return zero_value_string, position_value_string def update_row(self, row_index, zero="", position=""): - """Update the transmission zero ratio or bandwidth and its position - for a row in the transmission zeros table. + """Update the transmission zero ratio or bandwidth and its position for a row in the transmission zeros table. Parameters ---------- diff --git a/src/ansys/aedt/core/generic/__init__.py b/src/ansys/aedt/core/generic/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/generic/__init__.py +++ b/src/ansys/aedt/core/generic/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/generic/aedt_versions.py b/src/ansys/aedt/core/generic/aedt_versions.py index 187296bb304..28baa55b133 100644 --- a/src/ansys/aedt/core/generic/aedt_versions.py +++ b/src/ansys/aedt/core/generic/aedt_versions.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -23,6 +23,7 @@ # SOFTWARE. """This module contains the ``AedtVersions`` class. + The constant ``CURRENT_STABLE_AEDT_VERSION`` set in this module should be updated every time a new stable version is released. Ideally, it should be the same as ``conftest.default_version``""" @@ -35,6 +36,7 @@ class AedtVersions: """Class to get the AEDT versions on the system. + It caches the data to avoid inspecting the environment variables multiple times.""" def __init__(self): @@ -48,6 +50,7 @@ def __init__(self): @property def list_installed_ansysem(self): """Return a list of installed AEDT versions on ``ANSYSEM_ROOT``. + The list is ordered: first normal versions, then client versions, finally student versions.""" if self._list_installed_ansysem is None: aedt_env_var_prefix = "ANSYSEM_ROOT" diff --git a/src/ansys/aedt/core/generic/clr_module.py b/src/ansys/aedt/core/generic/clr_module.py index 357250f6d52..99d0424c45b 100644 --- a/src/ansys/aedt/core/generic/clr_module.py +++ b/src/ansys/aedt/core/generic/clr_module.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/generic/configurations.py b/src/ansys/aedt/core/generic/configurations.py index 909a79c2b12..d0fe6354e26 100644 --- a/src/ansys/aedt/core/generic/configurations.py +++ b/src/ansys/aedt/core/generic/configurations.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -1044,8 +1044,9 @@ def _update_datasets(self, data_dict): @pyaedt_function_handler() def validate(self, config): - """Validate a configuration file against the schema. The default schema - can be found in ``pyaedt/misc/config.schema.json``. + """Validate a configuration file against the schema. + + The default schema can be found in ``pyaedt/misc/config.schema.json``. Parameters ---------- @@ -1082,6 +1083,7 @@ def validate(self, config): @pyaedt_function_handler() def import_config(self, config_file, *args): """Import configuration settings from a JSON or TOML file and apply it to the current design. + The sections to be applied are defined with the ``configuration.options`` class. The import operation result is saved in the ``configuration.results`` class. @@ -1567,9 +1569,7 @@ def __init__(self, app): class Configurations3DLayout(Configurations): - """Enables export and import configuration options to be applied to a - new or existing 3DLayout design. - """ + """Enables export and import configuration options to be applied to a new or existing 3DLayout design.""" def __init__(self, app): Configurations.__init__(self, app) @@ -1802,6 +1802,7 @@ def _monitor_assignment_finder(self, dict_in, monitor_obj, exclude_set): @pyaedt_function_handler() def import_config(self, config_file, *args): """Import configuration settings from a JSON or TOML file and apply it to the current design. + The sections to be applied are defined with ``configuration.options`` class. The import operation result is saved in the ``configuration.results`` class. diff --git a/src/ansys/aedt/core/generic/constants.py b/src/ansys/aedt/core/generic/constants.py index 0598c66191c..b016e872991 100644 --- a/src/ansys/aedt/core/generic/constants.py +++ b/src/ansys/aedt/core/generic/constants.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -718,7 +718,6 @@ class SweepType(object): class BasisOrder(object): """Enumeration-class for HFSS basis order settings. - Warning: the value ``single`` has been renamed to ``Single`` for consistency. Please update references to ``single``. """ diff --git a/src/ansys/aedt/core/generic/data_handlers.py b/src/ansys/aedt/core/generic/data_handlers.py index 225507fb64b..df6cc7cfc23 100644 --- a/src/ansys/aedt/core/generic/data_handlers.py +++ b/src/ansys/aedt/core/generic/data_handlers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -227,16 +227,16 @@ def _arg2dict(arg, dict_out): @pyaedt_function_handler() def format_decimals(el): - """ + """Provide a formatted string for a decimal number. Parameters ---------- - el : - + el : float, int, str + Decimal number to be formatted. Returns ------- - + str """ if float(el) > 1000: num = f"{Decimal(el):,.0f}" @@ -249,7 +249,7 @@ def format_decimals(el): @pyaedt_function_handler() def random_string(length=6, only_digits=False, char_set=None): - """Generate a random string + """Generate a random string. Parameters ---------- @@ -313,15 +313,18 @@ def unique_string_list(element_list, only_string=True): @pyaedt_function_handler() def string_list(element_list): - """ + """Convert a string to a list if it is not already a list. + + Input must be a list or a string. Parameters ---------- - element_list : - + element_list : list, str + List or strings to be converted to a list. Returns ------- + list """ if isinstance(element_list, str): @@ -333,16 +336,18 @@ def string_list(element_list): @pyaedt_function_handler() def ensure_list(element_list): - """ + """Ensure that an object is a list. + + If it is not, it will be converted to a list. Parameters ---------- - element_list : - + element_list : object + Object to be checked. Returns ------- - + None """ if not isinstance(element_list, list): element_list = [element_list] diff --git a/src/ansys/aedt/core/generic/design_types.py b/src/ansys/aedt/core/generic/design_types.py index 3fe5c007376..f549925844e 100644 --- a/src/ansys/aedt/core/generic/design_types.py +++ b/src/ansys/aedt/core/generic/design_types.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/generic/desktop_sessions.py b/src/ansys/aedt/core/generic/desktop_sessions.py index d348a47d551..b3ae6ff05ae 100644 --- a/src/ansys/aedt/core/generic/desktop_sessions.py +++ b/src/ansys/aedt/core/generic/desktop_sessions.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/generic/filesystem.py b/src/ansys/aedt/core/generic/filesystem.py index 506b4a6fa07..a2f7811163f 100644 --- a/src/ansys/aedt/core/generic/filesystem.py +++ b/src/ansys/aedt/core/generic/filesystem.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/generic/general_methods.py b/src/ansys/aedt/core/generic/general_methods.py index b5dcd1ddb91..5bdf80d4933 100644 --- a/src/ansys/aedt/core/generic/general_methods.py +++ b/src/ansys/aedt/core/generic/general_methods.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -404,7 +404,7 @@ def open_file(file_path, file_options="r", encoding=None, override_existing=True Parameters ---------- - file_path : str + file_path : str or Path Full absolute path to the file (either local or remote). file_options : str, optional Options for opening the file. @@ -802,22 +802,22 @@ def generate_unique_project_name(root_name=None, folder_name=None, project_name= def _retry_ntimes(n, function, *args, **kwargs): - """ + """Retry a function several times. Parameters ---------- n : int - - function : - - *args : - - **kwargs : - + The number of retries. + function : function + Function to retry. + *args : tuple + Arguments for the function. + **kwargs : dict + Keyword arguments for the function. Returns ------- - + None """ func_name = None try: @@ -2188,6 +2188,7 @@ def _check_installed_version(install_path, long_version): @pyaedt_function_handler() def install_with_pip(package_name, package_path=None, upgrade=False, uninstall=False): # pragma: no cover """Install a new package using pip. + This method is useful for installing a package from the AEDT Console without launching the Python environment. Parameters diff --git a/src/ansys/aedt/core/generic/grpc_plugin_dll_class.py b/src/ansys/aedt/core/generic/grpc_plugin_dll_class.py index 822ee78e5de..de715b3d428 100644 --- a/src/ansys/aedt/core/generic/grpc_plugin_dll_class.py +++ b/src/ansys/aedt/core/generic/grpc_plugin_dll_class.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/generic/ibis_reader.py b/src/ansys/aedt/core/generic/ibis_reader.py index 0cc4ea19977..217fc9c3527 100644 --- a/src/ansys/aedt/core/generic/ibis_reader.py +++ b/src/ansys/aedt/core/generic/ibis_reader.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -762,6 +762,7 @@ def buffers(self, value): class IbisReader(object): """Reads *.ibis file content. + Setup an Ibis object exposing all the extracted data. Parameters diff --git a/src/ansys/aedt/core/generic/load_aedt_file.py b/src/ansys/aedt/core/generic/load_aedt_file.py index 4ba4ce73cf2..e724674f792 100644 --- a/src/ansys/aedt/core/generic/load_aedt_file.py +++ b/src/ansys/aedt/core/generic/load_aedt_file.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -151,7 +151,7 @@ def _separate_list_elements(v): def _decode_recognized_subkeys(sk, d): - """Special decodings for sub-keys belonging to _recognized_subkeys + """Special decodings for sub-keys belonging to _recognized_subkeys. Parameters ---------- @@ -165,7 +165,6 @@ def _decode_recognized_subkeys(sk, d): ------- bool Returns ``True`` if it finds and decodes a recognized value, ``False`` otherwise. - """ if sk.startswith(_recognized_subkeys[0]): # 'simple(' is at the beginning of the value m = _round_bracket_list.search(sk) @@ -456,7 +455,7 @@ def _walk_through_structure(keyword, save_dict, design_name=None): def _read_aedt_file(filename): - """Read the entire AEDT file discard binary and put ascii line in a list + """Read the entire AEDT file discard binary and put ascii line in a list. Parameters ---------- @@ -488,7 +487,7 @@ def _read_aedt_file(filename): def _load_entire_aedt_file(filename): - """Load the entire AEDT file and return the dictionary + """Load the entire AEDT file and return the dictionary. Parameters ---------- @@ -519,7 +518,7 @@ def _load_entire_aedt_file(filename): def _load_keyword_in_aedt_file(filename, keyword, design_name=None): - """Load a specific keyword in the AEDT file and return the dictionary + """Load a specific keyword in the AEDT file and return the dictionary. Parameters ---------- @@ -527,12 +526,13 @@ def _load_keyword_in_aedt_file(filename, keyword, design_name=None): AEDT filename with path keyword : keyword to search and load + design_name : str, optional + Name of the design. Default value is ``None``. Returns ------- type dictionary containing the decoded AEDT file - """ _read_aedt_file(filename) # load the aedt file diff --git a/src/ansys/aedt/core/generic/python_optimizers.py b/src/ansys/aedt/core/generic/python_optimizers.py index 692b1231838..57b9b4a149b 100644 --- a/src/ansys/aedt/core/generic/python_optimizers.py +++ b/src/ansys/aedt/core/generic/python_optimizers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/generic/settings.py b/src/ansys/aedt/core/generic/settings.py index 02b6ed9f889..f6e561bb4b9 100644 --- a/src/ansys/aedt/core/generic/settings.py +++ b/src/ansys/aedt/core/generic/settings.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -236,6 +236,7 @@ def logger(self, val): @property def block_figure_plot(self): """Block matplotlib figure plot during python script run until the user close it manually. + Default is ``False``.""" return self.__block_figure_plot @@ -264,6 +265,7 @@ def global_log_file_size(self, value): @property def enable_global_log_file(self): """Enable or disable the global PyAEDT log file located in the global temp folder. + The default is ``True``.""" return self.__enable_global_log_file @@ -274,6 +276,7 @@ def enable_global_log_file(self, value): @property def enable_local_log_file(self): """Enable or disable the local PyAEDT log file located in the ``projectname.pyaedt`` project folder. + The default is ``True``.""" return self.__enable_local_log_file @@ -294,6 +297,7 @@ def global_log_file_name(self, value): @property def enable_debug_methods_argument_logger(self): """Flag for whether to write out the method's arguments in the debug logger. + The default is ``False``.""" return self.__enable_debug_methods_argument_logger @@ -340,7 +344,8 @@ def logger_file_path(self, val): @property def logger_formatter(self): """Message format of the log entries. - The default is ``'%(asctime)s:%(destination)s:%(extra)s%(levelname)-8s:%(message)s'``""" + + The default is ``'%(asctime)s:%(destination)s:%(extra)s%(levelname)-8s:%(message)s'``.""" return self.__logger_formatter @logger_formatter.setter @@ -350,6 +355,7 @@ def logger_formatter(self, val): @property def logger_datefmt(self): """Date format of the log entries. + The default is ``'%Y/%m/%d %H.%M.%S'``""" return self.__logger_datefmt @@ -378,7 +384,9 @@ def enable_debug_grpc_api_logger(self, val): @property def enable_debug_geometry_operator_logger(self): """Enable or disable the logging for the geometry operators. - This setting is useful for debug purposes.""" + + This setting is useful for debug purposes. + """ return self.__enable_debug_geometry_operator_logger @enable_debug_geometry_operator_logger.setter @@ -388,7 +396,9 @@ def enable_debug_geometry_operator_logger(self, val): @property def enable_debug_internal_methods_logger(self): """Enable or disable the logging for internal methods. - This setting is useful for debug purposes.""" + + This setting is useful for debug purposes. + """ return self.__enable_debug_internal_methods_logger @enable_debug_internal_methods_logger.setter @@ -420,8 +430,9 @@ def aedt_log_file(self, value: str): @property def lsf_queue(self): - """LSF queue name. This attribute is valid only on Linux - systems running LSF Scheduler.""" + """LSF queue name. + + This attribute is valid only on Linux systems running LSF Scheduler.""" return self.__lsf_queue @lsf_queue.setter @@ -430,8 +441,9 @@ def lsf_queue(self, value): @property def use_lsf_scheduler(self): - """Whether to use LSF Scheduler. This attribute is valid only on Linux - systems running LSF Scheduler.""" + """Whether to use LSF Scheduler. + + This attribute is valid only on Linux systems running LSF Scheduler.""" return self.__use_lsf_scheduler @use_lsf_scheduler.setter @@ -609,6 +621,7 @@ def lazy_load(self, value): @property def wait_for_license(self): """Enable or disable the use of the flag `-waitforlicense` when launching Electronic Desktop. + The default value is ``False``.""" return self.__wait_for_license @@ -669,8 +682,8 @@ def aedt_install_dir(self, value): @property def use_multi_desktop(self): """Flag indicating if multiple desktop sessions are enabled in the same Python script. - Current limitations follow: + Current limitations follow: - Release without closing the desktop is not possible, - The first desktop created must be the last to be closed. @@ -695,9 +708,12 @@ def edb_dll_path(self, value): @property def enable_pandas_output(self): - """Flag for whether Pandas is being used to export dictionaries and lists. This attribute - applies to Solution data output. The default is ``False``. If ``True``, the property or - method returns a Pandas object. This property is valid only in the CPython environment.""" + """Flag for whether Pandas is being used to export dictionaries and lists. + + This attribute applies to Solution data output. + The default is ``False``. If ``True``, the property or method returns a Pandas object. + This property is valid only in the CPython environment. + """ return self.__enable_pandas_output @enable_pandas_output.setter @@ -706,9 +722,12 @@ def enable_pandas_output(self, val): @property def force_error_on_missing_project(self): - """Flag for whether to check the project path. The default is ``False``. If - ``True``, when passing a project path, the project has to exist. Otherwise, an - error is raised.""" + """Flag for whether to check the project path. + + The default is ``False``. + If ``True``, when passing a project path, the project has to exist. + Otherwise, an error is raised. + """ return self.__force_error_on_missing_project @force_error_on_missing_project.setter diff --git a/src/ansys/aedt/core/hfss.py b/src/ansys/aedt/core/hfss.py index 3183bbaa4cf..70a5d3a7feb 100644 --- a/src/ansys/aedt/core/hfss.py +++ b/src/ansys/aedt/core/hfss.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -232,7 +232,6 @@ def __init__( remove_lock=remove_lock, ) ScatteringMethods.__init__(self, self) - self.onetwork_data_explorer = self.odesktop.GetTool("NdExplorer") self._field_setups = [] self.component_array = {} self.component_array_names = list(self.get_oo_name(self.odesign, "Model")) @@ -795,6 +794,7 @@ def assign_coating( @pyaedt_function_handler(setupname="name", setuptype="setup_type") def create_setup(self, name="MySetupAuto", setup_type=None, **kwargs): """Create an analysis setup for HFSS. + Optional arguments are passed along with ``setup_type`` and ``name``. Keyword names correspond to the ``setup_type`` corresponding to the native AEDT API. The list of keywords here is not exhaustive. @@ -3092,9 +3092,10 @@ def create_impedance_between_objects( def create_boundary( self, boundary_type=BoundaryType.PerfectE, assignment=None, name=None, is_inifinite_ground=False ): - """Assign a boundary condition to a sheet or surface. This method is generally - used by other methods in the ``Hfss`` class such as the :meth:``Hfss.assign_febi`` - or :meth:``Hfss.assign_radiation_boundary_to_faces`` method. + """Assign a boundary condition to a sheet or surface. + + This method is generally used by other methods in the ``Hfss`` class such as the + :meth:``Hfss.assign_febi`` or :meth:``Hfss.assign_radiation_boundary_to_faces`` method. Parameters ---------- @@ -3125,7 +3126,6 @@ def create_boundary( Boundary object. """ - props = {} assignment = self.modeler.convert_to_selections(assignment, True) if type(assignment) is list: @@ -3222,7 +3222,6 @@ def assign_voltage_source_to_sheet(self, assignment, start_direction=0, name=Non Examples -------- - Create a sheet and assign to it some voltage. >>> sheet = hfss.modeler.create_rectangle(hfss.PLANE.XY,[0, 0, -70],[10, 2], @@ -3232,7 +3231,6 @@ def assign_voltage_source_to_sheet(self, assignment, start_direction=0, name=Non ... sheet.bottom_edge_y.midpoint],50) """ - if self.solution_type in ["Modal", "Terminal", "Transient Network"]: if isinstance(start_direction, list): if len(start_direction) != 2 or len(start_direction[0]) != len(start_direction[1]): @@ -3610,6 +3608,7 @@ def create_circuit_port_from_edges( deembed=False, ): """Create a circuit port from two edges. + The integration line is from edge 2 to edge 1. .. deprecated:: 0.6.70 @@ -4195,7 +4194,6 @@ def thicken_port_sheets(self, assignment, value, extrude_internally=True, intern def validate_full_design(self, design=None, output_dir=None, ports=None): """Validate a design based on an expected value and save information to the log file. - Parameters ---------- design : str, optional @@ -4220,16 +4218,13 @@ def validate_full_design(self, design=None, output_dir=None, ports=None): Examples -------- - Validate the current design and save the log file in the current project directory. >>> validation = hfss.validate_full_design() PyAEDT INFO: Design Validation Checks >>> validation[1] False - """ - self.logger.info("Design validation checks.") validation_ok = True val_list = [] @@ -5530,6 +5525,7 @@ def set_differential_pair( @pyaedt_function_handler(array_name="name", json_file="input_data") def add_3d_component_array_from_json(self, input_data, name=None): """Add or edit a 3D component array from a JSON file, TOML file, or dictionary. + The 3D component is placed in the layout if it is not present. Parameters @@ -5895,6 +5891,7 @@ def get_rcs_data( variation_name=None, ): """Export the radar cross-section data. + This method returns an instance of the ``RcsSolutionDataExporter`` object. Parameters diff --git a/src/ansys/aedt/core/hfss3dlayout.py b/src/ansys/aedt/core/hfss3dlayout.py index 81243de5679..9bb05b7c92e 100644 --- a/src/ansys/aedt/core/hfss3dlayout.py +++ b/src/ansys/aedt/core/hfss3dlayout.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -187,7 +187,6 @@ def __init__( remove_lock=remove_lock, ) ScatteringMethods.__init__(self, self) - self.onetwork_data_explorer = self.odesktop.GetTool("NdExplorer") def _init_from_design(self, *args, **kwargs): self.__init__(*args, **kwargs) @@ -1883,7 +1882,6 @@ def get_differential_pairs(self): # type: () -> list """Get the list defined differential pairs. - Returns ------- list @@ -2157,6 +2155,7 @@ def edit_source_from_file( window="hamming", ): """Edit a source from file data. + File data is a csv containing either frequency data or time domain data that will be converted through FFT. Parameters @@ -2291,6 +2290,7 @@ def find_scale(data, header_line): @pyaedt_function_handler(setup_name="setup") def get_dcir_solution_data(self, setup, show="RL", category="Loop_Resistance"): """Retrieve dcir solution data. Available element_names are dependent on element_type as below. + Sources ["Voltage", "Current", "Power"] "RL" ['Loop Resistance', 'Path Resistance', 'Resistance', 'Inductance'] "Vias" ['X', 'Y', 'Current', 'Limit', 'Resistance', 'IR Drop', 'Power'] diff --git a/src/ansys/aedt/core/icepak.py b/src/ansys/aedt/core/icepak.py index 4547ab2b356..487abc7afb3 100644 --- a/src/ansys/aedt/core/icepak.py +++ b/src/ansys/aedt/core/icepak.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -207,8 +207,9 @@ def _init_from_design(self, *args, **kwargs): @property def problem_type(self): - """Problem type of the Icepak design. Options are ``"TemperatureAndFlow"``, ``"TemperatureOnly"``, - and ``"FlowOnly"``. + """Problem type of the Icepak design. + + Options are ``"TemperatureAndFlow"``, ``"TemperatureOnly"``, and ``"FlowOnly"``. """ return self.design_solutions.problem_type diff --git a/src/ansys/aedt/core/maxwell.py b/src/ansys/aedt/core/maxwell.py index 1f4ebca5d1f..97c8f0bed2c 100644 --- a/src/ansys/aedt/core/maxwell.py +++ b/src/ansys/aedt/core/maxwell.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -81,6 +81,7 @@ def design_file(self): @pyaedt_function_handler() def change_symmetry_multiplier(self, value=1): """Set the design symmetry multiplier to a specified value. + The symmetry multiplier is automatically applied to all input quantities. Parameters @@ -443,6 +444,7 @@ def setup_ctrlprog( self, setupname, file_str=None, keep_modifications=False, python_interpreter=None, aedt_lib_dir=None ): """Configure the transient design setup to run a specific control program. + The control program is executed from a temporary directory that Maxwell creates for every setup run. .. deprecated:: 0.6.71 diff --git a/src/ansys/aedt/core/maxwellcircuit.py b/src/ansys/aedt/core/maxwellcircuit.py index 033424e26f7..bf350befce7 100644 --- a/src/ansys/aedt/core/maxwellcircuit.py +++ b/src/ansys/aedt/core/maxwellcircuit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/mechanical.py b/src/ansys/aedt/core/mechanical.py index 26f26ad2e79..cd27f361fa3 100644 --- a/src/ansys/aedt/core/mechanical.py +++ b/src/ansys/aedt/core/mechanical.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/misc/__init__.py b/src/ansys/aedt/core/misc/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/misc/__init__.py +++ b/src/ansys/aedt/core/misc/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/misc/create_remote_dir.py b/src/ansys/aedt/core/misc/create_remote_dir.py index 2996053836f..7063056140d 100644 --- a/src/ansys/aedt/core/misc/create_remote_dir.py +++ b/src/ansys/aedt/core/misc/create_remote_dir.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/__init__.py b/src/ansys/aedt/core/modeler/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/modeler/__init__.py +++ b/src/ansys/aedt/core/modeler/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/advanced_cad/__init__.py b/src/ansys/aedt/core/modeler/advanced_cad/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/modeler/advanced_cad/__init__.py +++ b/src/ansys/aedt/core/modeler/advanced_cad/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/advanced_cad/actors.py b/src/ansys/aedt/core/modeler/advanced_cad/actors.py index fe150bdce75..e2848a903f1 100644 --- a/src/ansys/aedt/core/modeler/advanced_cad/actors.py +++ b/src/ansys/aedt/core/modeler/advanced_cad/actors.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/advanced_cad/multiparts.py b/src/ansys/aedt/core/modeler/advanced_cad/multiparts.py index dc8bfb72b26..5728362747c 100644 --- a/src/ansys/aedt/core/modeler/advanced_cad/multiparts.py +++ b/src/ansys/aedt/core/modeler/advanced_cad/multiparts.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/advanced_cad/oms.py b/src/ansys/aedt/core/modeler/advanced_cad/oms.py index 822c6c2454b..b301485e68f 100644 --- a/src/ansys/aedt/core/modeler/advanced_cad/oms.py +++ b/src/ansys/aedt/core/modeler/advanced_cad/oms.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/advanced_cad/parts.py b/src/ansys/aedt/core/modeler/advanced_cad/parts.py index dd6e4b1dbc2..cd1fb32e01e 100644 --- a/src/ansys/aedt/core/modeler/advanced_cad/parts.py +++ b/src/ansys/aedt/core/modeler/advanced_cad/parts.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/advanced_cad/stackup_3d.py b/src/ansys/aedt/core/modeler/advanced_cad/stackup_3d.py index e7e1258784e..97c88044ab7 100644 --- a/src/ansys/aedt/core/modeler/advanced_cad/stackup_3d.py +++ b/src/ansys/aedt/core/modeler/advanced_cad/stackup_3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -35,6 +35,7 @@ def _replace_by_underscore(character, string): """Replace each character of a string by underscores. + This method is used to create Hfss variable relative to a material, and so reformat the material name into the variable name format. @@ -53,7 +54,6 @@ def _replace_by_underscore(character, string): >>> name = _replace_by_underscore(" ", name) >>> name = _replace_by_underscore("(", name) >>> name = _replace_by_underscore(")", name) - """ if not isinstance(character, str): raise TypeError("character must be str") @@ -292,8 +292,10 @@ def magnetic_loss_tangent(self): class Layer3D(object): - """Provides a class for a management of a parametric layer in 3D Modeler. The Layer3D class is not intended - to be used with its constructor, but by using the method "add_layer" available in the Stackup3D class. + """Provides a class for a management of a parametric layer in 3D Modeler. + + The Layer3D class is not intended to be used with its constructor, + but by using the method "add_layer" available in the Stackup3D class. Parameters ---------- @@ -1522,6 +1524,7 @@ def add_layer( self, name, layer_type="S", material_name="copper", thickness=0.035, fill_material="FR4_epoxy", frequency=None ): """Add a new layer to the stackup. + The new layer can be a signal (S), ground (G), or dielectric (D). The layer is entirely filled with the specified fill material. Anything will be drawn material. @@ -1602,6 +1605,7 @@ def add_layer( @pyaedt_function_handler() def add_signal_layer(self, name, material="copper", thickness=0.035, fill_material="FR4_epoxy", frequency=None): """Add a new ground layer to the stackup. + A signal layer is positive. The layer is entirely filled with the fill material. Anything will be drawn material. @@ -1691,7 +1695,9 @@ def add_dielectric_layer(self, name, material="FR4_epoxy", thickness=0.035, freq @pyaedt_function_handler() def add_ground_layer(self, name, material="copper", thickness=0.035, fill_material="air", frequency=None): - """Add a new ground layer to the stackup. A ground layer is negative. + """Add a new ground layer to the stackup. + + A ground layer is negative. The layer is entirely filled with metal. Any polygon will draw a void in it. Parameters @@ -1734,7 +1740,7 @@ def add_ground_layer(self, name, material="copper", thickness=0.035, fill_materi @pyaedt_function_handler() def _layer_position_manager(self, layer): - """ + """Set the last layer of the stackup. Parameters ---------- @@ -2529,7 +2535,9 @@ def create_lumped_port(self, reference_layer, opposite_side=False, port_name=Non return port def quarter_wave_feeding_line(self, impedance_to_adapt=50): - """Create a Trace to feed the patch. The trace length is the quarter wavelength, and this width is calculated + """Create a Trace to feed the patch. + + The trace length is the quarter wavelength, and this width is calculated to return the desired impedance. Parameters @@ -2603,8 +2611,10 @@ def set_optimal_width(self): class Trace(CommonObject, object): - """Trace Class in Stackup3D. Create a parametrized trace. It is preferable to use the add_trace method - in the class Layer3D than directly the class constructor. + """Trace Class in Stackup3D. Create a parametrized trace. + + It is preferable to use the add_trace method in the class Layer3D + than directly the class constructor. Parameters ---------- diff --git a/src/ansys/aedt/core/modeler/cad/__init__.py b/src/ansys/aedt/core/modeler/cad/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/modeler/cad/__init__.py +++ b/src/ansys/aedt/core/modeler/cad/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/cad/component_array.py b/src/ansys/aedt/core/modeler/cad/component_array.py index 540ded9f2da..bd54b5caec7 100644 --- a/src/ansys/aedt/core/modeler/cad/component_array.py +++ b/src/ansys/aedt/core/modeler/cad/component_array.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/cad/components_3d.py b/src/ansys/aedt/core/modeler/cad/components_3d.py index 614c7526706..10cc88351fd 100644 --- a/src/ansys/aedt/core/modeler/cad/components_3d.py +++ b/src/ansys/aedt/core/modeler/cad/components_3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/cad/elements_3d.py b/src/ansys/aedt/core/modeler/cad/elements_3d.py index 78c25db6661..b40738742e6 100644 --- a/src/ansys/aedt/core/modeler/cad/elements_3d.py +++ b/src/ansys/aedt/core/modeler/cad/elements_3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -34,11 +34,11 @@ @pyaedt_function_handler() def _dict2arg(d, arg_out): - """ + """Convert a dictionary to an argument list. Parameters ---------- - d : + d : dict arg_out : @@ -416,6 +416,7 @@ def create_object(self, non_model=False): @pyaedt_function_handler() def move_along_normal(self, offset=1.0): """Move this edge. + This method moves an edge which belong to the same solid. Parameters @@ -431,7 +432,6 @@ def move_along_normal(self, offset=1.0): References ---------- >>> oEditor.MoveEdges - """ if self._object3d.object_type == "Solid": self._object3d.logger.error("Edge Movement applies only to 2D objects.") @@ -440,7 +440,13 @@ def move_along_normal(self, offset=1.0): class FacePrimitive(object): - """Contains the face object within the AEDT Desktop Modeler.""" + """Contains the face object within the AEDT Desktop Modeler. + + Parameters + ---------- + object3d : :class:`ansys.aedt.core.modeler.cad.object_3d.Object3d` + obj_id : int + """ def __str__(self): return str(self.id) @@ -449,13 +455,6 @@ def __repr__(self): return str(self.id) def __init__(self, object3d, obj_id): - """ - - Parameters - ---------- - object3d : :class:`ansys.aedt.core.modeler.cad.object_3d.Object3d` - obj_id : int - """ self._id = obj_id self._object3d = object3d self._is_planar = None diff --git a/src/ansys/aedt/core/modeler/cad/modeler.py b/src/ansys/aedt/core/modeler/cad/modeler.py index 41fcb489dd2..796d23029cf 100644 --- a/src/ansys/aedt/core/modeler/cad/modeler.py +++ b/src/ansys/aedt/core/modeler/cad/modeler.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -480,6 +480,7 @@ def create( self, assignment, origin, axis_position, axis="X", name=None, offset=None, rotation=0, always_move_to_end=True ): """Create a face coordinate system. + The face coordinate has always the Z axis parallel to face normal. The X and Y axis lie on the face plane. diff --git a/src/ansys/aedt/core/modeler/cad/object_3d.py b/src/ansys/aedt/core/modeler/cad/object_3d.py index 4dedb6e44a1..0a23e4e7a0a 100644 --- a/src/ansys/aedt/core/modeler/cad/object_3d.py +++ b/src/ansys/aedt/core/modeler/cad/object_3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -75,13 +75,6 @@ class Object3d(object): """ def __init__(self, primitives, name=None): - """ - Parameters - ---------- - primitives : :class:`ansys.aedt.core.modeler.cad.primitives_3d.Primitives3D` - Inherited parent object. - name : str - """ self._id = None if name: self._m_name = name @@ -282,7 +275,6 @@ def plot(self, show=True): def export_image(self, output_file=None): """Export the current object to a specified file path. - .. note:: Works from AEDT 2021.2 in CPython only. PyVista has to be installed. @@ -315,6 +307,7 @@ def export_image(self, output_file=None): @pyaedt_function_handler() def touching_conductors(self): """Get the conductors of given object. + See :func:`ansys.aedt.core.application.analysis_3d.FieldAnalysis3D.identify_touching_conductors`. Returns diff --git a/src/ansys/aedt/core/modeler/cad/polylines.py b/src/ansys/aedt/core/modeler/cad/polylines.py index 706bd3f4339..2ad98cca92e 100644 --- a/src/ansys/aedt/core/modeler/cad/polylines.py +++ b/src/ansys/aedt/core/modeler/cad/polylines.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -358,15 +358,16 @@ def __init__( @property def start_point(self): - """List of the ``[x, y, z]`` coordinates for the starting point in the polyline - object in the object's coordinate system. + """Get the starting point in the polyline object. + + This is a list of the ``[x, y, z]`` coordinates for the starting point in the polyline + object in the object's coordinate system Returns ------- list List of the ``[x, y, z]`` coordinates for the starting point in the polyline object. - """ return self.points[0] @@ -567,7 +568,6 @@ def _point_segment_string_array(self): Returns ------- list - """ position_list = self.points segment_types = self.segment_types @@ -644,6 +644,7 @@ def _point_segment_string_array(self): @pyaedt_function_handler() def _evaluate_arc_angle_extra_points(self, segment, start_point): """Evaluate the extra points for the ArcAngle segment type. + It also auto evaluates the arc_plane if it was not specified by the user. segment.extra_points[0] contains the arc mid point (on the arc). segment.extra_points[1] contains the arc end point. @@ -1034,12 +1035,13 @@ def set_crosssection_properties( @pyaedt_function_handler() def _get_point_slice_from_segment_id(self, segment_id, at_start=True): """Get the points belonging to the segment from the segment id. + The points are returned as list slice by returning the indexes. Parameters ---------- segment_id : int - segment id + Segment id. at_start : bool if ``True`` the slice includes the start point of the segment and not the end point. diff --git a/src/ansys/aedt/core/modeler/cad/primitives.py b/src/ansys/aedt/core/modeler/cad/primitives.py index 820eba9b6d0..7ccb9f8280f 100644 --- a/src/ansys/aedt/core/modeler/cad/primitives.py +++ b/src/ansys/aedt/core/modeler/cad/primitives.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -966,8 +966,7 @@ def _refresh_all_ids_from_aedt_file(self): @pyaedt_function_handler() def cleanup_objects(self): - """Clean up objects that no longer exist in the modeler because - they were removed by previous operations. + """Clean up objects that no longer exist in the modeler because they were removed by previous operations. This method also updates object IDs that may have changed via a modeler operation such as :func:`ansys.aedt.core.modeler.Model3D.Modeler3D.unite` @@ -1015,8 +1014,7 @@ def cleanup_solids(self): @pyaedt_function_handler() def cleanup_points(self): - """Clean up points that no longer exist in the modeler because - they were removed by previous operations. + """Clean up points that no longer exist in the modeler because they were removed by previous operations. This method also updates object IDs that may have changed via a modeler operation such as :func:`ansys.aedt.core.modeler.Model3D.Modeler3D.unite` @@ -1038,14 +1036,12 @@ def cleanup_points(self): @pyaedt_function_handler() def find_new_objects(self): - """Find any new objects in the modeler that were created - by previous operations. + """Find any new objects in the modeler that were created by previous operations. Returns ------- dict Dictionary of new objects. - """ new_objects = [] for obj_name in self.object_names: @@ -3598,7 +3594,6 @@ def purge_history(self, assignment): def get_model_bounding_box(self): """Retrieve the model bounding box. - Returns ------- List diff --git a/src/ansys/aedt/core/modeler/cad/primitives_2d.py b/src/ansys/aedt/core/modeler/cad/primitives_2d.py index 004de148811..fee3a4a67d9 100644 --- a/src/ansys/aedt/core/modeler/cad/primitives_2d.py +++ b/src/ansys/aedt/core/modeler/cad/primitives_2d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/cad/primitives_3d.py b/src/ansys/aedt/core/modeler/cad/primitives_3d.py index af17422ac1a..51fb08aebd7 100644 --- a/src/ansys/aedt/core/modeler/cad/primitives_3d.py +++ b/src/ansys/aedt/core/modeler/cad/primitives_3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/calculators.py b/src/ansys/aedt/core/modeler/calculators.py index 94fe8241ba9..626baae79df 100644 --- a/src/ansys/aedt/core/modeler/calculators.py +++ b/src/ansys/aedt/core/modeler/calculators.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/circuits/__init__.py b/src/ansys/aedt/core/modeler/circuits/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/modeler/circuits/__init__.py +++ b/src/ansys/aedt/core/modeler/circuits/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/circuits/object_3d_circuit.py b/src/ansys/aedt/core/modeler/circuits/object_3d_circuit.py index eccb274ea4d..204384e7661 100644 --- a/src/ansys/aedt/core/modeler/circuits/object_3d_circuit.py +++ b/src/ansys/aedt/core/modeler/circuits/object_3d_circuit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/circuits/primitives_circuit.py b/src/ansys/aedt/core/modeler/circuits/primitives_circuit.py index b5f32fc57d3..5a68c1c8ff5 100644 --- a/src/ansys/aedt/core/modeler/circuits/primitives_circuit.py +++ b/src/ansys/aedt/core/modeler/circuits/primitives_circuit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -191,6 +191,7 @@ def nets(self): @pyaedt_function_handler() def _convert_point_to_meter(self, point): """Convert numbers automatically to mils. + It is rounded to the nearest 100 mil which is minimum schematic snap unit. """ xpos = point[0] diff --git a/src/ansys/aedt/core/modeler/circuits/primitives_emit.py b/src/ansys/aedt/core/modeler/circuits/primitives_emit.py index 3f3aef61c98..fa0a17715ed 100644 --- a/src/ansys/aedt/core/modeler/circuits/primitives_emit.py +++ b/src/ansys/aedt/core/modeler/circuits/primitives_emit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -565,14 +565,15 @@ def get_connected_components(self): @pyaedt_function_handler() def get_type(self): - """ + """Get the property ``Type`` of a component. + Parameters ---------- None Returns ------- - Str + str Type property of self. """ properties = self.get_node_properties() diff --git a/src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py b/src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py index d5a815724bf..45172f45010 100644 --- a/src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py +++ b/src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/circuits/primitives_nexxim.py b/src/ansys/aedt/core/modeler/circuits/primitives_nexxim.py index e5afd8a57d0..284a623e6e7 100644 --- a/src/ansys/aedt/core/modeler/circuits/primitives_nexxim.py +++ b/src/ansys/aedt/core/modeler/circuits/primitives_nexxim.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -22,7 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import os +from pathlib import Path import re import secrets import time @@ -314,8 +314,9 @@ def connect_components_in_series(self, assignment, use_wire=True): if component in [cmp.id, cmp.name, cmp.composed_name]: comps.append(cmp) break + if len(comps) < 2: + raise RuntimeError("At least two components have to be passed.") i = 0 - assert len(comps) > 1, "At least two components have to be passed." while i < (len(comps) - 1): comps[i].pins[-1].connect_to_component(comps[i + 1].pins[0], use_wire=use_wire) i += 1 @@ -352,7 +353,8 @@ def connect_components_in_parallel(self, assignment): if component in [cmp.id, cmp.name, cmp.composed_name]: comps.append(cmp) break - assert len(comps) > 1, "At least two components have to be passed." + if len(comps) < 2: + raise RuntimeError("At least two components have to be passed.") comps[0].pins[0].connect_to_component([i.pins[0] for i in comps[1:]]) terminal_to_connect = [cmp for cmp in comps if len(cmp.pins) >= 2] if len(terminal_to_connect) > 1: @@ -1616,14 +1618,14 @@ def _add_subcircuit_link( Name of the subcircuit HFSS link. pin_names : list List of the pin names. - source_project_path : str + source_project_path : str or Path Path to the source project. source_design_name : str Name of the design. solution_name : str, optional Name of the solution and sweep. The default is ``"Setup1 : Sweep"``. - image_subcircuit_path : str, optional + image_subcircuit_path : str or Path or None Path of the Picture used in Circuit. Default is an HFSS Picture exported automatically. model_type : str, optional @@ -1647,6 +1649,8 @@ def _add_subcircuit_link( >>> oComponentManager.Add >>> oDesign.AddCompInstance """ + if isinstance(source_project_path, str): + source_project_path = Path(source_project_path) model = "hfss" owner = "HFSS" icon_file = "hfss.bmp" @@ -1668,19 +1672,20 @@ def _add_subcircuit_link( hspice_customization = self._get_comp_custom_settings(3, 1, 2, 3, 0, 0, "False", "", 3) if image_subcircuit_path: - _, file_extension = os.path.splitext(image_subcircuit_path) - if file_extension != ".gif" or file_extension != ".bmp" or file_extension != ".jpg": + if isinstance(image_subcircuit_path, str): + image_subcircuit_path = Path(image_subcircuit_path) + if image_subcircuit_path.suffix not in [".gif", ".bmp", ".jpg"]: image_subcircuit_path = None warnings.warn("Image extension is not valid. Use default image instead.") if not image_subcircuit_path: - image_subcircuit_path = os.path.normpath( - os.path.join(self._modeler._app.desktop_install_dir, "syslib", "Bitmaps", icon_file) - ) + image_subcircuit_path = ( + Path(self._modeler._app.desktop_install_dir) / "syslib" / "Bitmaps" / icon_file + ).resolve() filename = "" comp_name_aux = generate_unique_name(source_design_name) WB_SystemID = source_design_name - if not self._app.project_file == source_project_path: - filename = source_project_path + if Path(self._app.project_file) != source_project_path: + filename = str(source_project_path) comp_name_aux = comp_name WB_SystemID = "" @@ -1699,7 +1704,7 @@ def _add_subcircuit_link( "Description:=", "", "ImageFile:=", - image_subcircuit_path, + str(image_subcircuit_path), "SymbolPinConfiguration:=", 0, ["NAME:PortInfoBlk"], @@ -1946,7 +1951,7 @@ def set_sim_solution_on_hfss_subcircuit(self, component, solution_name="Setup1 : @pyaedt_function_handler() def _edit_link_definition_hfss_subcircuit(self, component, edited_prop): - """Generic function to set the link definition for an hfss subcircuit.""" + """Generic function to set the link definition for a HFSS subcircuit.""" if isinstance(component, str): complist = component.split(";") elif isinstance(component, CircuitComponent): @@ -1955,16 +1960,21 @@ def _edit_link_definition_hfss_subcircuit(self, component, edited_prop): complist = self.components[component].composed_name.split(";") else: raise AttributeError("Wrong Component Input") - complist2 = complist[0].split("@") - arg = ["NAME:AllTabs"] - arg1 = ["NAME:Model"] - arg2 = ["NAME:PropServers", "Component@" + str(complist2[1])] - arg3 = ["NAME:ChangedProps", edited_prop] - - arg1.append(arg2) - arg1.append(arg3) - arg.append(arg1) + arg = [ + "NAME:AllTabs", + [ + "NAME:Model", + [ + "NAME:PropServers", + "Component@" + str(complist[0].split("@")[1]), + ], + [ + "NAME:ChangedProps", + edited_prop, + ], + ], + ] self._app._oproject.ChangeProperty(arg) return True @@ -2016,7 +2026,7 @@ def create_component_from_spicemodel( Parameters ---------- - input_file : str + input_file : str or Path Path to .lib file. model : str, optional Model name to import. If `None` the first subckt in the lib file will be placed. @@ -2038,12 +2048,15 @@ def create_component_from_spicemodel( Examples -------- + >>> from pathlib import Path >>> from ansys.aedt.core import Circuit >>> cir = Circuit(version="2023.2") - >>> model = os.path.join("Your path", "test.lib") + >>> model = Path("Your path") / "test.lib" >>> cir.modeler.schematic.create_component_from_spicemodel(input_file=model,model="GRM1234",symbol="nexx_cap") >>> cir.release_desktop(False, False) """ + if isinstance(input_file, str): + input_file = Path(input_file) models = self._parse_spice_model(input_file) if not model and models: model = models[0] @@ -2061,12 +2074,11 @@ def create_component_from_spicemodel( else: arg2.append([False, "", "", False]) arg.append(arg2) - self.o_component_manager.ImportModelsFromFile(input_file.replace("\\", "/"), arg) + self.o_component_manager.ImportModelsFromFile(input_file.as_posix(), arg) if create_component: return self.create_component(None, component_library=None, component_name=model, location=location) - else: - return True + return True @pyaedt_function_handler(model_path="input_file", solution_name="solution") def add_siwave_dynamic_link(self, input_file, solution=None, simulate_solutions=False): @@ -2074,7 +2086,7 @@ def add_siwave_dynamic_link(self, input_file, solution=None, simulate_solutions= Parameters ---------- - input_file : str + input_file : str or Path Full path to the .siw file. solution : str, optional Solution name. @@ -2086,18 +2098,20 @@ def add_siwave_dynamic_link(self, input_file, solution=None, simulate_solutions= :class:`ansys.aedt.core.modeler.circuits.object_3d_circuit.CircuitComponent` Circuit Component Object. """ - assert os.path.exists(input_file), "Project file doesn't exist" - comp_name = os.path.splitext(os.path.basename(input_file))[0] - results_path = input_file + "averesults" - solution_path = os.path.join(results_path, comp_name + ".asol") - # out = load_entire_aedt_file(solution) + if isinstance(input_file, str): + input_file = Path(input_file) + if not input_file.exists(): + raise FileNotFoundError(f"Project file '{input_file}' doesn't exist") + comp_name = Path(input_file).stem + results_path = input_file.parent / f"{comp_name}.siwaveresults" + solution_path = results_path / f"{comp_name}.asol" out = load_keyword_in_aedt_file(solution_path, "Solutions") if not solution: solution = list(out["Solutions"]["SYZSolutions"].keys())[0] - results_folder = os.path.join( - results_path, - out["Solutions"]["SYZSolutions"][solution]["DiskName"], - out["Solutions"]["SYZSolutions"][solution]["DiskName"] + ".syzinfo", + results_folder = ( + results_path + / out["Solutions"]["SYZSolutions"][solution]["DiskName"] + / f"{out['Solutions']['SYZSolutions'][solution]['DiskName']}.syzinfo" ) pin_names = [] diff --git a/src/ansys/aedt/core/modeler/circuits/primitives_twin_builder.py b/src/ansys/aedt/core/modeler/circuits/primitives_twin_builder.py index 3e323a757aa..2c6e9006290 100644 --- a/src/ansys/aedt/core/modeler/circuits/primitives_twin_builder.py +++ b/src/ansys/aedt/core/modeler/circuits/primitives_twin_builder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/geometry_operators.py b/src/ansys/aedt/core/modeler/geometry_operators.py index 0b8394c37f3..c6a46272f14 100644 --- a/src/ansys/aedt/core/modeler/geometry_operators.py +++ b/src/ansys/aedt/core/modeler/geometry_operators.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -66,6 +66,7 @@ def List2list(input_list): @pyaedt_function_handler() def parse_dim_arg(string, scale_to_unit=None, variable_manager=None): """Convert a number and unit to a float. + Angles are converted in radians. Parameters @@ -1235,6 +1236,7 @@ def q_prod(p, q): @pyaedt_function_handler() def q_rotation(v, q): """Evaluate the rotation of a vector, defined by a quaternion. + Evaluated as: ``"q = q0 + q' = q0 + iq1 + jq2 + kq3"``, ``"w = qvq* = (q0^2 - |q'|^2)v + 2(q' • v)q' + 2q0(q' x v)"``. @@ -1334,12 +1336,11 @@ def get_polygon_centroid(pts): @staticmethod @pyaedt_function_handler() def cs_xy_pointing_expression(yaw, pitch, roll): - """Return x_pointing and y_pointing vectors as expressions from - the yaw, ptich, and roll input (as strings). + """Return x_pointing and y_pointing vectors as expressions from the yaw, pitch, and roll input (as strings). Parameters ---------- - yaw : str, required + yaw : str String expression for the yaw angle (rotation about Z-axis) pitch : str String expression for the pitch angle (rotation about Y-axis) @@ -1397,7 +1398,6 @@ def is_small(s): Returns ------- bool - """ n = GeometryOperators.get_numeric(s) return True if math.fabs(n) < 2.0 * abs(sys.float_info.epsilon) else False @@ -1426,8 +1426,9 @@ def numeric_cs(cs_in): @staticmethod @pyaedt_function_handler() def orient_polygon(x, y, clockwise=True): - """ - Orient a polygon clockwise or counterclockwise. The vertices should be already ordered either way. + """Orient a polygon clockwise or counterclockwise. + + The vertices should be already ordered either way. Use this function to change the orientation. The polygon is represented by its vertices coordinates. @@ -1503,6 +1504,7 @@ def orient_polygon(x, y, clockwise=True): @pyaedt_function_handler() def v_angle_sign(va, vb, vn, right_handed=True): """Evaluate the signed angle between two geometry vectors. + The sign is evaluated respect to the normal to the plane containing the two vectors as per the following rule. In case of opposite vectors, it returns an angle equal to 180deg (always positive). Assuming that the plane normal is normalized (vb == 1), the signed angle is simplified. @@ -1533,9 +1535,8 @@ def v_angle_sign(va, vb, vn, right_handed=True): cross = GeometryOperators.v_cross(va, vb) if GeometryOperators.v_norm(cross) < tol: return math.pi - assert GeometryOperators.is_collinear(cross, vn), ( - "vn must be the normal to the " "plane containing va and vb." - ) # pragma: no cover + if not GeometryOperators.is_collinear(cross, vn): + raise ValueError("vn must be the normal to the plane containing va and vb") # pragma: no cover vnn = GeometryOperators.normalize_vector(vn) if right_handed: @@ -1548,6 +1549,7 @@ def v_angle_sign(va, vb, vn, right_handed=True): @pyaedt_function_handler() def v_angle_sign_2D(va, vb, right_handed=True): """Evaluate the signed angle between two 2D geometry vectors. + Iit the 2D version of the ``GeometryOperators.v_angle_sign`` considering vn = [0,0,1]. In case of opposite vectors, it returns an angle equal to 180deg (always positive). @@ -1759,10 +1761,11 @@ def is_segment_intersecting_polygon(a, b, polygon): float ``True`` if the segment intersect the polygon. ``False`` otherwise. """ - assert len(a) == 2, "point must be a list in the form [x, y]" - assert len(b) == 2, "point must be a list in the form [x, y]" + if len(a) != 2 or len(b) != 2: + raise ValueError("Point must be a list in the form [x, y]") pl = len(polygon[0]) - assert len(polygon[1]) == pl, "Polygon x and y lists must be the same length" + if len(polygon[1]) != pl: + raise ValueError("The two sublists in polygon must have the same length") a_in = GeometryOperators.is_point_in_polygon(a, polygon) b_in = GeometryOperators.is_point_in_polygon(b, polygon) diff --git a/src/ansys/aedt/core/modeler/modeler_2d.py b/src/ansys/aedt/core/modeler/modeler_2d.py index 9476d7a78b9..e6ffde867d9 100644 --- a/src/ansys/aedt/core/modeler/modeler_2d.py +++ b/src/ansys/aedt/core/modeler/modeler_2d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/modeler_3d.py b/src/ansys/aedt/core/modeler/modeler_3d.py index 907d396a32c..820e74ba00b 100644 --- a/src/ansys/aedt/core/modeler/modeler_3d.py +++ b/src/ansys/aedt/core/modeler/modeler_3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -104,7 +104,7 @@ def create_3dcomponent( is_encrypted=False, allow_edit=False, security_message="", - password=None, + password=None, # nosec edit_password=None, password_type="UserSuppliedPassword", hide_contents=False, @@ -195,8 +195,10 @@ def create_3dcomponent( name = self._app.design_name dt_string = datetime.datetime.now().strftime("%H:%M:%S %p %b %d, %Y") if password_type not in ["UserSuppliedPassword", "InternalPassword"]: + self.logger.error("Password type must be 'UserSuppliedPassword' or 'InternalPassword'") return False if component_outline not in ["BoundingBox", "None"]: + self.logger.error("Component outline must be 'BoundingBox' or 'None'") return False if password is None: password = os.getenv("PYAEDT_ENCRYPTED_PASSWORD", "") @@ -262,19 +264,16 @@ def create_3dcomponent( for el in objs: if "CreateRegion:1" in self.oeditor.GetChildObject(el).GetChildNames(): objs.remove(el) - arg.append("IncludedParts:="), arg.append(objs) - arg.append("HiddenParts:=") - if not hide_contents_flag: - arg.append([]) - else: - arg.append(hide_contents) - if coordinate_systems: - allcs = coordinate_systems - else: - allcs = self.oeditor.GetCoordinateSystems() - arg.append("IncludedCS:="), arg.append(allcs) - arg.append("ReferenceCS:="), arg.append(reference_coordinate_system) - par_description = [] + arg += [ + "IncludedParts:=", + objs, + "HiddenParts:=", + hide_contents if hide_contents_flag else [], + "IncludedCS:=", + coordinate_systems if coordinate_systems else list(self.oeditor.GetCoordinateSystems()), + "ReferenceCS:=", + reference_coordinate_system, + ] variables = [] dependent_variables = [] if variables_to_include is not None and not variables_to_include == []: @@ -289,39 +288,34 @@ def create_3dcomponent( elif variables_to_include is None: variables = self._app._variable_manager.independent_variable_names dependent_variables = self._app._variable_manager.dependent_variable_names + arg += [ + "IncludedParameters:=", + variables, + "IncludedDependentParameters:=", + dependent_variables, + "ParameterDescription:=", + [item for el in variables for item in (el + ":=", "")], + "IsLicensed:=", + False, + "LicensingDllName:=", + "", + "VendorComponentIdentifier:=", + "", + "PublicKeyFile:=", + "", + ] - for el in variables: - par_description.append(el + ":=") - par_description.append("") - arg.append("IncludedParameters:="), arg.append(variables) - - arg.append("IncludedDependentParameters:="), arg.append(dependent_variables) - for el in variables: - par_description.append(el + ":=") - par_description.append("") - arg.append("ParameterDescription:="), arg.append(par_description) - arg.append("IsLicensed:="), arg.append(False) - arg.append("LicensingDllName:="), arg.append("") - arg.append("VendorComponentIdentifier:="), arg.append("") - arg.append("PublicKeyFile:="), arg.append("") arg2 = ["NAME:DesignData"] - if boundaries is not None: - boundaries = boundaries - else: + if not boundaries: boundaries = self.get_boundaries_name() - arg2.append("Boundaries:="), arg2.append(boundaries) + if boundaries: + arg2 += ["Boundaries:=", boundaries] if self._app.design_type == "Icepak": - meshregions = [mr.name for mr in self._app.mesh.meshregions] - try: - meshregions.remove("Global") - except Exception: - pass - if meshregions: - arg2.append("MeshRegions:="), arg2.append(meshregions) + mesh_regions = [mr.name for mr in self._app.mesh.meshregions if mr.name != "Global"] + if mesh_regions: + arg2 += ["MeshRegions:=", mesh_regions] else: - if excitations is not None: - excitations = excitations - else: + if excitations is None: excitations = self._app.excitations if self._app.design_type == "HFSS": exc = self._app.get_oo_name(self._app.odesign, "Excitations") @@ -329,7 +323,7 @@ def create_3dcomponent( excitations.extend(exc) excitations = list(set([i.split(":")[0] for i in excitations])) if excitations: - arg2.append("Excitations:="), arg2.append(excitations) + arg2 += ["Excitations:=", excitations] meshops = [el.name for el in self._app.mesh.meshoperations] if meshops: used_mesh_ops = [] @@ -342,9 +336,9 @@ def create_3dcomponent( mesh_comp.append(self.objects[item].name) if all(included_obj in objs for included_obj in mesh_comp): used_mesh_ops.append(self._app.mesh.meshoperations[mesh].name) - arg2.append("MeshOperations:="), arg2.append(used_mesh_ops) + arg2 += ["MeshOperations:=", used_mesh_ops] else: - arg2.append("MeshOperations:="), arg2.append(meshops) + arg2 += ["MeshOperations:=", meshops] arg3 = ["NAME:ImageFile", "ImageFile:=", ""] if export_auxiliary: if isinstance(export_auxiliary, bool): @@ -514,13 +508,16 @@ def replace_3dcomponent( for el in objs: if "CreateRegion:1" in self.oeditor.GetChildObject(el).GetChildNames(): objs.remove(el) - arg.append("IncludedParts:="), arg.append(objs) - arg.append("HiddenParts:="), arg.append([]) - if not coordinate_systems: - coordinate_systems = list(self.oeditor.GetCoordinateSystems()) - arg.append("IncludedCS:="), arg.append(coordinate_systems) - arg.append("ReferenceCS:="), arg.append(reference_coordinate_system) - par_description = [] + arg += [ + "IncludedParts:=", + objs, + "HiddenParts:=", + [], + "IncludedCS:=", + coordinate_systems if coordinate_systems else list(self.oeditor.GetCoordinateSystems()), + "ReferenceCS:=", + reference_coordinate_system, + ] variables = [] if variables_to_include: dependent_variables = [] @@ -535,34 +532,24 @@ def replace_3dcomponent( else: variables = self._app._variable_manager.independent_variable_names dependent_variables = self._app._variable_manager.dependent_variable_names - - for el in variables: - par_description.append(el + ":=") - par_description.append("") - arg.append("IncludedParameters:="), arg.append(variables) - - arg.append("IncludedDependentParameters:="), arg.append(dependent_variables) - - for el in variables: - par_description.append(el + ":=") - par_description.append("") - arg.append("ParameterDescription:="), arg.append(par_description) + arg += [ + "IncludedParameters:=", + variables, + "IncludedDependentParameters:=", + dependent_variables, + "ParameterDescription:=", + [item for el in variables for item in (el + ":=", "")], + ] arg2 = ["NAME:DesignData"] - if boundaries: - boundaries = boundaries - else: + if not boundaries: boundaries = self.get_boundaries_name() if boundaries: - arg2.append("Boundaries:="), arg2.append(boundaries) + arg2 += ["Boundaries:=", boundaries] if self._app.design_type == "Icepak": - meshregions = [mr.name for mr in self._app.mesh.meshregions] - try: - meshregions.remove("Global") - except Exception: - pass - if meshregions: - arg2.append("MeshRegions:="), arg2.append(meshregions) + mesh_regions = [mr.name for mr in self._app.mesh.meshregions if mr.name != "Global"] + if mesh_regions: + arg2 += ["MeshRegions:=", mesh_regions] else: if excitations: excitations = excitations @@ -574,7 +561,7 @@ def replace_3dcomponent( excitations.extend(exc) excitations = list(set([i.split(":")[0] for i in excitations])) if excitations: - arg2.append("Excitations:="), arg2.append(excitations) + arg2 += ["Excitations:=", excitations] meshops = [el.name for el in self._app.mesh.meshoperations] if meshops: used_mesh_ops = [] @@ -587,9 +574,9 @@ def replace_3dcomponent( mesh_comp.append(self.objects[item].name) if all(included_obj in objs for included_obj in mesh_comp): used_mesh_ops.append(self._app.mesh.meshoperations[mesh].name) - arg2.append("MeshOperations:="), arg2.append(used_mesh_ops) + arg2 += ["MeshOperations:=", used_mesh_ops] else: - arg2.append("MeshOperations:="), arg2.append(meshops) + arg2 += ["MeshOperations:=", meshops] arg3 = ["NAME:ImageFile", "ImageFile:=", ""] old_components = self.user_defined_component_names self.oeditor.ReplaceWith3DComponent(arg, arg2, arg3) diff --git a/src/ansys/aedt/core/modeler/modeler_pcb.py b/src/ansys/aedt/core/modeler/modeler_pcb.py index c133eab086e..4243ff77c6e 100644 --- a/src/ansys/aedt/core/modeler/modeler_pcb.py +++ b/src/ansys/aedt/core/modeler/modeler_pcb.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -41,6 +41,7 @@ class Modeler3DLayout(Modeler, Primitives3DLayout): """Manages Modeler 3D layouts. + This class is inherited in the caller application and is accessible through the modeler variable object (for example, ``hfss3dlayout.modeler``). @@ -175,7 +176,8 @@ def model_units(self): @model_units.setter def model_units(self, units): - assert units in AEDT_UNITS["Length"], f"Invalid units string {units}." + if not units in AEDT_UNITS["Length"]: + raise ValueError(f"Invalid units '{units}'") self.oeditor.SetActiveUnits(units) self._model_units = units @@ -356,7 +358,7 @@ def merge_design(self, merged_design=None, x="0.0", y="0.0", z="0.0", rotation=" comp_name = str(i) break except Exception: - continue + self.logger.debug(f"Couldn't get component name from component {i}") if not comp_name: return False comp = ComponentsSubCircuit3DLayout(self, comp_name) @@ -647,8 +649,6 @@ def convert_to_selections(self, assignment, return_list=False): objnames.append(el) elif "name" in dir(el): objnames.append(el.name) - else: - pass if return_list: return objnames else: diff --git a/src/ansys/aedt/core/modeler/pcb/__init__.py b/src/ansys/aedt/core/modeler/pcb/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/modeler/pcb/__init__.py +++ b/src/ansys/aedt/core/modeler/pcb/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modeler/pcb/object_3d_layout.py b/src/ansys/aedt/core/modeler/pcb/object_3d_layout.py index 2c486165bff..61ff2a36901 100644 --- a/src/ansys/aedt/core/modeler/pcb/object_3d_layout.py +++ b/src/ansys/aedt/core/modeler/pcb/object_3d_layout.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -22,10 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" -This module provides methods and data structures for managing all properties of +"""This module provides methods and data structures for managing all properties of objects (points, lines, sheeets, and solids) within the AEDT 3D Layout Modeler. - """ from __future__ import absolute_import # noreorder @@ -1066,12 +1064,12 @@ def name(self): def name(self, value): try: del self._primitives._lines[self.name] - vMaterial = ["NAME:Name", "Value:=", value] - self.change_property(vMaterial) + args = ["NAME:Name", "Value:=", value] + self.change_property(args) self._name = value self._primitives._lines[self._name] = self except Exception: - pass + self.logger.debug(f"Couldn't update geometry name into '{value}'.") @property def is_closed(self): diff --git a/src/ansys/aedt/core/modeler/pcb/primitives_3d_layout.py b/src/ansys/aedt/core/modeler/pcb/primitives_3d_layout.py index ca12d6eae8a..d0b5868bea8 100644 --- a/src/ansys/aedt/core/modeler/pcb/primitives_3d_layout.py +++ b/src/ansys/aedt/core/modeler/pcb/primitives_3d_layout.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -245,7 +245,6 @@ def objects_by_net(self, net, object_filter=None, include_voids=False): list Objects found. """ - objs = [] if object_filter: if isinstance(object_filter, str): @@ -331,7 +330,7 @@ def rectangle_void_names(self): @property def circle_names(self): - """Get the list of all rectangles in layout. + """Get the list of all circles in layout. Returns ------- @@ -361,14 +360,15 @@ def via_names(self): @pyaedt_function_handler() def cleanup_objects(self): - """Clean up all 3D Layout geometries (circle, rectangles, polygons, lines and voids) + """Clean up all 3D Layout geometries. + + Clean up all 3D Layout geometries (circle, rectangles, polygons, lines and voids) that have been added or no longer exist in the modeler because they were removed by previous operations. Returns ------- tuple List of added objects, List of removed names. - """ families = [ [["poly", "plg"], self._polygons, Polygons3DLayout], @@ -769,7 +769,7 @@ def padstacks(self): if p[0] == "NAME:psd": props = p except Exception: - pass + self.logger.debug("Couldn't access first property.") self._padstacks[name] = Padstack(name, self.opadstackmanager, self.model_units) for prop in props: @@ -819,9 +819,8 @@ def padstacks(self): self._padstacks[name].layers[lay_name].connectiony = lay[14] self._padstacks[name].layers[lay_name].connectiondir = lay[16] i += 1 - pass except Exception: - pass + self.logger.debug(f"Exception caught when updating padstack '{name}' properties.") return self._padstacks diff --git a/src/ansys/aedt/core/modeler/schematic.py b/src/ansys/aedt/core/modeler/schematic.py index af339756a57..808ffcfda33 100644 --- a/src/ansys/aedt/core/modeler/schematic.py +++ b/src/ansys/aedt/core/modeler/schematic.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/__init__.py b/src/ansys/aedt/core/modules/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/modules/__init__.py +++ b/src/ansys/aedt/core/modules/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/boundary/__init__.py b/src/ansys/aedt/core/modules/boundary/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/modules/boundary/__init__.py +++ b/src/ansys/aedt/core/modules/boundary/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/boundary/circuit_boundary.py b/src/ansys/aedt/core/modules/boundary/circuit_boundary.py index 7d3336a3189..e027c796752 100644 --- a/src/ansys/aedt/core/modules/boundary/circuit_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/circuit_boundary.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/boundary/common.py b/src/ansys/aedt/core/modules/boundary/common.py index adeeb9ff1a6..8027747eb4f 100644 --- a/src/ansys/aedt/core/modules/boundary/common.py +++ b/src/ansys/aedt/core/modules/boundary/common.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/boundary/hfss_boundary.py b/src/ansys/aedt/core/modules/boundary/hfss_boundary.py index decad53ed56..f499203c461 100644 --- a/src/ansys/aedt/core/modules/boundary/hfss_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/hfss_boundary.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -75,6 +75,7 @@ def _child_object(self): @property def props(self): + """Field Properties.""" if not self.__props and self._app.design_properties: if ( self.type == "FarFieldSphere" @@ -148,9 +149,7 @@ def update(self): ------- bool ``True`` when successful, ``False`` when failed. - """ - if self.type == "FarFieldSphere": self._app.oradfield.EditInfiniteSphereSetup(self.name, self._get_args()) elif self.type == "NearFieldBox": diff --git a/src/ansys/aedt/core/modules/boundary/icepak_boundary.py b/src/ansys/aedt/core/modules/boundary/icepak_boundary.py index 817b5e7265e..3838641dc7e 100644 --- a/src/ansys/aedt/core/modules/boundary/icepak_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/icepak_boundary.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/boundary/layout_boundary.py b/src/ansys/aedt/core/modules/boundary/layout_boundary.py index 775c12195eb..e539655934d 100644 --- a/src/ansys/aedt/core/modules/boundary/layout_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/layout_boundary.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py b/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py index 8658dc55c85..1d917aca644 100644 --- a/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/boundary/q3d_boundary.py b/src/ansys/aedt/core/modules/boundary/q3d_boundary.py index 5745ca23a28..ddd2f5e2e34 100644 --- a/src/ansys/aedt/core/modules/boundary/q3d_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/q3d_boundary.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/cable_modeling.py b/src/ansys/aedt/core/modules/cable_modeling.py index 8f28443f3b7..a8bc5f96622 100644 --- a/src/ansys/aedt/core/modules/cable_modeling.py +++ b/src/ansys/aedt/core/modules/cable_modeling.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/circuit_templates.py b/src/ansys/aedt/core/modules/circuit_templates.py index 7560bd30952..0212f2d1c20 100644 --- a/src/ansys/aedt/core/modules/circuit_templates.py +++ b/src/ansys/aedt/core/modules/circuit_templates.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/design_xploration.py b/src/ansys/aedt/core/modules/design_xploration.py index e3387c9a5fe..e934bc1a2f7 100644 --- a/src/ansys/aedt/core/modules/design_xploration.py +++ b/src/ansys/aedt/core/modules/design_xploration.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -1162,10 +1162,13 @@ def add( Variation Start Point if a variation is defined or Single Value. end_point : float or int, optional Variation End Point. This parameter is optional if a Single Value is defined. - step : float or int - Variation Step or Count depending on variation_type. The default is ``100``. + step : float, int, or str + Variation Step or Count depending on variation_type. The default is ``100`` + for the "LinearCount" variation_type. If a string is passed as an argument, it + must be a valid expression in the given context. For example, "0.1mm" may be passed + for a step size when the variation_type is "LinearStep". variation_type : str, optional - Variation Type. Admitted values are `"LinearCount"`, `"LinearStep"`, `"LogScale"`, `"SingleValue"`. + Variation Type. Permitted values are `"LinearCount"`, `"LinearStep"`, `"LogScale"`, `"SingleValue"`. solution : str, optional Type of the solution. The default is ``None``, in which case the default solution is used. diff --git a/src/ansys/aedt/core/modules/layer_stackup.py b/src/ansys/aedt/core/modules/layer_stackup.py index b02b5b9f6ac..117cc8b9d5b 100644 --- a/src/ansys/aedt/core/modules/layer_stackup.py +++ b/src/ansys/aedt/core/modules/layer_stackup.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/material.py b/src/ansys/aedt/core/modules/material.py index 1a1369f29c9..31123721af7 100644 --- a/src/ansys/aedt/core/modules/material.py +++ b/src/ansys/aedt/core/modules/material.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -1232,12 +1232,9 @@ class CommonMaterial(object): Parameters ---------- materials : :class:`ansys.aedt.core.modules.material_lib.Materials` - name : str - props : dict The default is ``None``. - """ def __init__(self, materials, name, props=None): diff --git a/src/ansys/aedt/core/modules/material_lib.py b/src/ansys/aedt/core/modules/material_lib.py index 88b15962000..f03282c6a2c 100644 --- a/src/ansys/aedt/core/modules/material_lib.py +++ b/src/ansys/aedt/core/modules/material_lib.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/material_workbench.py b/src/ansys/aedt/core/modules/material_workbench.py index 0fa47920eac..ddeba623502 100644 --- a/src/ansys/aedt/core/modules/material_workbench.py +++ b/src/ansys/aedt/core/modules/material_workbench.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -31,12 +31,12 @@ from collections import defaultdict import copy import re -from xml.etree.ElementTree import ParseError from ansys.aedt.core.aedt_logger import pyaedt_logger as logger from ansys.aedt.core.generic.data_handlers import normalize_string_format from ansys.aedt.core.modules.material import MatProperties import defusedxml +from defusedxml.ElementTree import ParseError defusedxml.defuse_stdlib() @@ -44,13 +44,10 @@ class MaterialWorkbench: """Manages the import of materials from a Workbench Engineering Data XML file. - Parameters ---------- app : :class:`ansys.aedt.core` Inherited parent object. - - """ def __init__(self, app): diff --git a/src/ansys/aedt/core/modules/mesh.py b/src/ansys/aedt/core/modules/mesh.py index fa432c43661..6625e3eee36 100644 --- a/src/ansys/aedt/core/modules/mesh.py +++ b/src/ansys/aedt/core/modules/mesh.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -154,6 +154,7 @@ def type(self): @property def props(self): + """Properties of the mesh operation.""" if not self._legacy_props: props = {} for k, v in self.properties.items(): diff --git a/src/ansys/aedt/core/modules/mesh_3d_layout.py b/src/ansys/aedt/core/modules/mesh_3d_layout.py index 0967cd81770..0c3103b8c56 100644 --- a/src/ansys/aedt/core/modules/mesh_3d_layout.py +++ b/src/ansys/aedt/core/modules/mesh_3d_layout.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/mesh_icepak.py b/src/ansys/aedt/core/modules/mesh_icepak.py index 217d2937e09..395e8bb8637 100644 --- a/src/ansys/aedt/core/modules/mesh_icepak.py +++ b/src/ansys/aedt/core/modules/mesh_icepak.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -49,9 +49,9 @@ def __init__(self, app, name): @property def padding_types(self): - """ - Get a list of strings containing thepadding types used, - one for each direction, in the following order: + """Get a list of strings containing the padding types used. + + One for each direction in the following order: +X, -X, +Y, -Y, +Z, -Z. Returns @@ -913,38 +913,41 @@ def assignment(self): list """ if isinstance(self._assignment, SubRegion): - # try to update name if self.name in self._app.odesign.GetChildObject("Mesh").GetChildNames(): - parts = [] - subparts = [] - if "Parts" in self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropNames(): - parts = self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropValue("Parts") - if "Submodels" in self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropNames(): - subparts = ( - self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropValue("Submodels") + # try to update name, APIs lacking an easy method before 242 + if self._app.settings.aedt_version < "2024.2": # pragma: no cover + parts = [] + subparts = [] + if "Parts" in self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropNames(): + parts = self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropValue("Parts") + if "Submodels" in self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropNames(): + subparts = ( + self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropValue("Submodels") + ) + if not isinstance(parts, list): + parts = [parts] + if not isinstance(subparts, list): + subparts = [subparts] + parts += subparts + sub_regions = self._app.modeler.non_model_objects + for sr in sub_regions: + p1 = [] + p2 = [] + if "Part Names" in self._app.modeler[sr].history().props: + p1 = self._app.modeler[sr].history().props.get("Part Names", None) + if not isinstance(p1, list): + p1 = [p1] + elif "Submodel Names" in self._app.modeler[sr].history().props: + p2 = self._app.modeler[sr].history().props.get("Submodel Names", None) + if not isinstance(p2, list): + p2 = [p2] + p1 += p2 + if "CreateSubRegion" == self._app.modeler[sr].history().command and all(p in p1 for p in parts): + self._assignment.name = sr + else: + self._assignment.name = ( + self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropValue("Assignment") ) - if not isinstance(parts, list): - parts = [parts] - if not isinstance(subparts, list): - subparts = [subparts] - parts += subparts - sub_regions = self._app.modeler.non_model_objects - for sr in sub_regions: - p1 = [] - p2 = [] - history = self._app.modeler[sr].history() - history_props = history.properties - if "Part Names" in history_props: - p1 = history_props.get("Part Names", None) - if not isinstance(p1, list): - p1 = [p1] - elif "Submodel Names" in history_props: - p2 = history_props.get("Submodel Names", None) - if not isinstance(p2, list): - p2 = [p2] - p1 += p2 - if "CreateSubRegion" == history.command and all(p in p1 for p in parts): - self._assignment.name = sr return self._assignment elif isinstance(self._assignment, list): return self._assignment diff --git a/src/ansys/aedt/core/modules/optimetrics_templates.py b/src/ansys/aedt/core/modules/optimetrics_templates.py index 76da1ac27c4..211afaba94a 100644 --- a/src/ansys/aedt/core/modules/optimetrics_templates.py +++ b/src/ansys/aedt/core/modules/optimetrics_templates.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/setup_templates.py b/src/ansys/aedt/core/modules/setup_templates.py index 9f47b9e38f4..7e2a406e1d2 100644 --- a/src/ansys/aedt/core/modules/setup_templates.py +++ b/src/ansys/aedt/core/modules/setup_templates.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/modules/solve_setup.py b/src/ansys/aedt/core/modules/solve_setup.py index c19d96fdaec..665765ff531 100644 --- a/src/ansys/aedt/core/modules/solve_setup.py +++ b/src/ansys/aedt/core/modules/solve_setup.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -231,6 +231,7 @@ def analyze( @property def props(self): + """Properties of the setup.""" if self._legacy_props: return self._legacy_props if self._is_new_setup: @@ -1891,11 +1892,12 @@ def solver_type(self): try: return self.properties["Solver"] except Exception: - pass + self.p_app.logger.debug("Cannot retrieve solver type with key 'Solver'") try: return self.props["SolveSetupType"] except Exception: - return None + self.p_app.logger.debug("Cannot retrieve solver type with key 'SolveSetupType'") + return None @pyaedt_function_handler() def create(self): diff --git a/src/ansys/aedt/core/modules/solve_sweeps.py b/src/ansys/aedt/core/modules/solve_sweeps.py index 5e7045deb68..3b85a3b29e9 100644 --- a/src/ansys/aedt/core/modules/solve_sweeps.py +++ b/src/ansys/aedt/core/modules/solve_sweeps.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/q3d.py b/src/ansys/aedt/core/q3d.py index 380b5f69080..07179efffd2 100644 --- a/src/ansys/aedt/core/q3d.py +++ b/src/ansys/aedt/core/q3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -1006,6 +1006,7 @@ def export_equivalent_circuit( return False coupling_limits = ["NAME:CouplingLimits", "CouplingLimitType:="] + coupling_limit_value = "None" if coupling_limit_type: if coupling_limit_type not in [0, 1]: self.logger.error('Possible values are 0 = "By Value" or 1 = "By Fraction Of Self Term".') @@ -1076,7 +1077,6 @@ def export_equivalent_circuit( coupling_limits.append("ResLimit:=") coupling_limits.append(res_limit) else: - coupling_limit_value = "None" coupling_limits.append(coupling_limit_value) if model is None: @@ -2064,6 +2064,7 @@ def get_mutual_coupling( self, source1, sink1, source2, sink2, calculation="ACL", setup_sweep_name=None, variations=None ): """Get mutual coupling between two terminals. + User has to provide the pair, source and sink of each terminal. If the provided sinks are not part of the original matrix, a new matrix will be created. diff --git a/src/ansys/aedt/core/rmxprt.py b/src/ansys/aedt/core/rmxprt.py index f4c1d7a83f5..c7066a5cae4 100644 --- a/src/ansys/aedt/core/rmxprt.py +++ b/src/ansys/aedt/core/rmxprt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/rpc/rpyc_services.py b/src/ansys/aedt/core/rpc/rpyc_services.py index 382d1f0894c..ab58f12caa1 100644 --- a/src/ansys/aedt/core/rpc/rpyc_services.py +++ b/src/ansys/aedt/core/rpc/rpyc_services.py @@ -7,6 +7,7 @@ import signal import sys import time +from typing import List from ansys.aedt.core.generic.general_methods import generate_unique_name from ansys.aedt.core.generic.general_methods import env_path @@ -215,6 +216,17 @@ class PyaedtServiceWindows(rpyc.Service): """Server Pyaedt rpyc Service.""" def on_connect(self, connection): + """Run when a connection is created. + + Parameters + ---------- + connection : :class:`rpyc.core.protocol.Connection` + The Connection object representing the connection that was created. + + Returns + ------- + None + """ # code that runs when a connection is created # (to init the service, if needed) self.connection = connection @@ -223,6 +235,12 @@ def on_connect(self, connection): pass def on_disconnect(self, connection): + """Run after the connection was closed. + + Returns + ------- + None + """ # code that runs after the connection has already closed # (to finalize the service, if needed) if self.app: @@ -294,14 +312,12 @@ def exposed_run_script(self, script, aedt_version="2021.2", ansysem_path=None, n command.append(ng_feature) command = [exe_path, ng_feature, "-RunScriptAndExit", script_file] try: - p = subprocess.Popen(command) # nosec - p.wait() + subprocess.run(command, check=True) # nosec except subprocess.CalledProcessError as e: msg = f"Command failed with error: {e}" logger.error(msg) return msg return "Script Executed." - else: return "Ansys EM not found or wrong AEDT Version." @@ -874,7 +890,7 @@ def exposed_restore(self): sys.stdout = sys.__stdout__ @staticmethod - def aedt_grpc(port=None, beta_options=None, use_aedt_relative_path=False, non_graphical=True): + def aedt_grpc(port=None, beta_options: List[str]=None, use_aedt_relative_path=False, non_graphical=True, check_interval=2): """Start a new AEDT session on a specified gRPC port. Returns @@ -888,13 +904,13 @@ def aedt_grpc(port=None, beta_options=None, use_aedt_relative_path=False, non_gr import secrets secure_random = secrets.SystemRandom() port = check_port(secure_random.randint(18500, 20000)) - if port == 0: print("Error. No ports are available.") return False elif port in sessions: print(f"AEDT Session already opened on port {port}.") return True + ansysem_path = os.getenv("PYAEDT_SERVER_AEDT_PATH", "") if is_linux: executable = "ansysedt" @@ -902,45 +918,39 @@ def aedt_grpc(port=None, beta_options=None, use_aedt_relative_path=False, non_gr executable = "ansysedt.exe" if ansysem_path and not use_aedt_relative_path: aedt_exe = os.path.join(ansysem_path, executable) + if not is_safe_path(aedt_exe): + logger.warning("Ansys EM path not safe.") + return False else: aedt_exe = executable if non_graphical: ng_feature = "-features=SF6694_NON_GRAPHICAL_COMMAND_EXECUTION,SF159726_SCRIPTOBJECT" - if beta_options: - for option in range(beta_options.__len__()): - if beta_options[option] not in ng_feature: - ng_feature += "," + beta_options[option] - - command = [ - aedt_exe, - "-grpcsrv", - str(port), - ng_feature, - "-ng", - - ] else: ng_feature = "-features=SF159726_SCRIPTOBJECT" - if beta_options: - for option in range(beta_options.__len__()): - if beta_options[option] not in ng_feature: - ng_feature += "," + beta_options[option] - command = [aedt_exe, "-grpcsrv", str(port), ng_feature] - subprocess.Popen(command) + if beta_options: + for option in beta_options: + if option not in ng_feature: + ng_feature += f",{option}" + command = [aedt_exe, "-grpcsrv", str(port), ng_feature] + if non_graphical: + command.append("-ng") + + process = subprocess.Popen(command) # nosec timeout = 60 - s = socket.socket() - machine_name = "127.0.0.1" while timeout > 0: - try: - s.connect((machine_name, port)) - except socket.error: - timeout -= 2 - time.sleep(2) - else: - s.close() - timeout = 0 - print(f"Service has started on port {port}") - return port + with socket.socket() as s: + try: + s.connect(("127.0.0.1", port)) + logger.info(f"Service accessible on port {port}") + return port + except socket.error: + logger.debug(f"Service not available yet, new try in {check_interval}s.") + timeout -= 2 + time.sleep(check_interval) + + process.terminate() + logger.error(f"Service did not start within the timeout of {timeout} seconds.") + return False @property def aedt_port(self): @@ -983,7 +993,7 @@ def student_version(self): @property def server_name(self): - """Machine name, + """Machine name. Returns ------- @@ -1103,7 +1113,6 @@ def on_connect(self, connection): self.connection = connection self._processes = {} self._edb = [] - pass def on_disconnect(self, connection): """Finalize the service when the connection is closed.""" @@ -1131,20 +1140,21 @@ def start_service(self, port): """ try: port = check_port(port) - if os.getenv("PYAEDT_SERVER_AEDT_PATH",""): - ansysem_path = os.getenv("PYAEDT_SERVER_AEDT_PATH","") + ansysem_path = os.getenv("PYAEDT_SERVER_AEDT_PATH") + if ansysem_path and not os.path.exists(ansysem_path): + raise FileNotFoundError(f"The ANSYSEM path '{ansysem_path}' does not exist.") else: - aa = aedt_versions.list_installed_ansysem - if aa: - ansysem_path = os.environ[aa[0]] + version_list = aedt_versions.list_installed_ansysem + if version_list: + ansysem_path = os.environ[version_list[0]] else: - raise Exception("no ANSYSEM_ROOTXXX environment variable defined.") - name = os.path.normpath( + raise Exception("No ANSYSEM_ROOTXXX environment variable is defined.") + + script_path = os.path.normpath( os.path.join(os.path.abspath(os.path.dirname(__file__)), "local_server.py") ) - cmd_service = [sys.executable, name, ansysem_path, "1", str(port)] - print(cmd_service) - p = subprocess.Popen(cmd_service) + command = [sys.executable, script_path, ansysem_path, "1", str(port)] + p = subprocess.Popen(command) # nosec time.sleep(2) self._processes[port] = p return port @@ -1175,6 +1185,7 @@ def exposed_stop_service(self, port): @staticmethod def exposed_check_port(): + """Check if a random port is available.""" import secrets secure_random = secrets.SystemRandom() port = check_port(secure_random.randint(18500, 20000)) diff --git a/src/ansys/aedt/core/twinbuilder.py b/src/ansys/aedt/core/twinbuilder.py index 79599b250a2..b273d6b6c5d 100644 --- a/src/ansys/aedt/core/twinbuilder.py +++ b/src/ansys/aedt/core/twinbuilder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -656,9 +656,9 @@ def add_excitation_model( export_uniform_points_step=1e-5, excitations=None, ): # pragma: no cover - """ - Use the excitation component to assign output quantities in a Twin Builder design to a windings - in a Maxwell design. + """Use the excitation component to assign output quantities + + This works in a Twin Builder design to a windings in a Maxwell design. This method works only with AEDT 2025 R1 and later. Parameters diff --git a/src/ansys/aedt/core/visualization/__init__.py b/src/ansys/aedt/core/visualization/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/visualization/__init__.py +++ b/src/ansys/aedt/core/visualization/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/advanced/__init__.py b/src/ansys/aedt/core/visualization/advanced/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/visualization/advanced/__init__.py +++ b/src/ansys/aedt/core/visualization/advanced/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/advanced/farfield_visualization.py b/src/ansys/aedt/core/visualization/advanced/farfield_visualization.py index e215eceb3c3..2505def180f 100644 --- a/src/ansys/aedt/core/visualization/advanced/farfield_visualization.py +++ b/src/ansys/aedt/core/visualization/advanced/farfield_visualization.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/advanced/hdm_plot.py b/src/ansys/aedt/core/visualization/advanced/hdm_plot.py index 55b6590c4b2..9699b031e95 100644 --- a/src/ansys/aedt/core/visualization/advanced/hdm_plot.py +++ b/src/ansys/aedt/core/visualization/advanced/hdm_plot.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/advanced/misc.py b/src/ansys/aedt/core/visualization/advanced/misc.py index 99157dc6800..131f8301e5a 100644 --- a/src/ansys/aedt/core/visualization/advanced/misc.py +++ b/src/ansys/aedt/core/visualization/advanced/misc.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/advanced/rcs_visualization.py b/src/ansys/aedt/core/visualization/advanced/rcs_visualization.py index f988d697d27..5b6cae3aef6 100644 --- a/src/ansys/aedt/core/visualization/advanced/rcs_visualization.py +++ b/src/ansys/aedt/core/visualization/advanced/rcs_visualization.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -132,7 +132,9 @@ def __init__(self, input_file): self.__frequency_units = self.__metadata["frequency_units"] - self.__monostatic_file = self.output_dir / self.__metadata["monostatic_file"] + self.__monostatic_file = None + if self.__metadata["monostatic_file"]: + self.__monostatic_file = self.output_dir / self.__metadata["monostatic_file"] self.__data_conversion_function = "dB20" self.__window = "Flat" @@ -141,19 +143,23 @@ def __init__(self, input_file): self.__upsample_range = 512 self.__upsample_azimuth = 64 - if not self.__monostatic_file.is_file(): + if self.__monostatic_file and not self.__monostatic_file.is_file(): raise Exception("Monostatic file invalid.") self.rcs_column_names = ["data"] # Load farfield data - is_rcs_loaded = self.__init_rcs() + if self.__monostatic_file: + is_rcs_loaded = self.__init_rcs() + else: + is_rcs_loaded = True if not is_rcs_loaded: # pragma: no cover raise RuntimeError("RCS information can not be loaded.") - # Update active frequency if passed in the initialization - self.frequency = self.frequencies[0] + if self.__monostatic_file: + # Update active frequency if passed in the initialization + self.frequency = self.frequencies[0] @property def raw_data(self): @@ -611,9 +617,6 @@ class MonostaticRCSPlotter(object): def __init__(self, rcs_data): - # Public - self.modeler_window = None - # Private self.__rcs_data = rcs_data self.__logger = logger @@ -716,7 +719,7 @@ def plot_rcs( """ curves = [] all_secondary_sweep_value = secondary_sweep_value - if primary_sweep.lower() == "freq" or primary_sweep.lower() == "frequency": + if primary_sweep.casefold() == "freq" or primary_sweep.casefold() == "frequency": x_key = "Freq" x = self.rcs_data.frequencies if secondary_sweep == "IWaveTheta": @@ -732,7 +735,7 @@ def plot_rcs( y_key = "IWavePhi" else: data = self.rcs_data.rcs_active_frequency - if primary_sweep.lower() == "iwavephi": + if primary_sweep.casefold() == "iwavephi": x_key = "IWavePhi" y_key = "IWaveTheta" x = self.rcs_data.available_incident_wave_phi @@ -902,7 +905,9 @@ def plot_range_profile( return new @pyaedt_function_handler() - def plot_waterfall(self, title="Waterfall", output_file=None, show=True, is_polar=False, size=(1920, 1440)): + def plot_waterfall( + self, title="Waterfall", output_file=None, show=True, is_polar=False, size=(1920, 1440), figure=None + ): """Create a 2D contour plot of the waterfall. Parameters @@ -918,6 +923,10 @@ def plot_waterfall(self, title="Waterfall", output_file=None, show=True, is_pola Whether to display in polar coordinates. The default is ``True``. size : tuple, optional Image size in pixel (width, height). + figure : :class:`matplotlib.pyplot.Figure`, optional + An existing Matplotlib `Figure` to which the plot is added. + If not provided, a new `Figure` and `Axes` objects are created. + Default is ``None``. Returns ------- @@ -961,16 +970,11 @@ def plot_waterfall(self, title="Waterfall", output_file=None, show=True, is_pola } new.add_trace(plot_data, 2, props) - _ = new.plot_contour( - trace=0, - polar=is_polar, - snapshot_path=output_file, - show=show, - ) + _ = new.plot_contour(trace=0, polar=is_polar, snapshot_path=output_file, show=show, figure=figure) return new @pyaedt_function_handler() - def plot_isar_2d(self, title="ISAR", output_file=None, show=True, size=(1920, 1440)): + def plot_isar_2d(self, title="ISAR", output_file=None, show=True, size=(1920, 1440), figure=None): """Create a 2D contour plot of the ISAR. Parameters @@ -984,6 +988,10 @@ def plot_isar_2d(self, title="ISAR", output_file=None, show=True, size=(1920, 14 If ``False``, the Matplotlib instance of the plot is shown. size : tuple, optional Image size in pixel (width, height). + figure : :class:`matplotlib.pyplot.Figure`, optional + An existing Matplotlib `Figure` to which the plot is added. + If not provided, a new `Figure` and `Axes` objects are created. + Default is ``None``. Returns ------- @@ -1019,12 +1027,7 @@ def plot_isar_2d(self, title="ISAR", output_file=None, show=True, size=(1920, 14 } new.add_trace(plot_data, 2, props) - _ = new.plot_contour( - trace=0, - polar=False, - snapshot_path=output_file, - show=show, - ) + _ = new.plot_contour(trace=0, polar=False, snapshot_path=output_file, show=show, figure=figure) return new @pyaedt_function_handler() @@ -1617,6 +1620,92 @@ def add_waterfall( self.all_scene_actors["results"]["waterfall"][waterfall_name] = rcs_mesh + @pyaedt_function_handler() + def add_isar_2d( + self, + plot_type="plane", + color_bar="jet", + ): + """Add the ISAR 2D. + + Parameters + ---------- + plot_type : str, optional + The type of plot to create for the range profile. It can be ``"plane"``, ``"relief"``, and `"projection"``. + The default is ``"plane"``. + color_bar : str, optional + Color mapping to be applied to the RCS data. It can be a color (``"blue"``, + ``"green"``, ...) or a colormap (``"jet"``, ``"viridis"``, ...). The default is ``"jet"``. + """ + data_isar_2d = self.rcs_data.isar_2d + + down_range = data_isar_2d["Down-range"].unique() + cross_range = data_isar_2d["Cross-range"].unique() + + values_2d = data_isar_2d.pivot(index="Cross-range", columns="Down-range", values="Data").to_numpy() + + x, y = np.meshgrid(down_range, cross_range) + z = np.zeros_like(x) + + if plot_type.casefold() == "relief": + m = 2.0 + b = -1.0 + z = (values_2d - values_2d.min()) / (values_2d.max() - values_2d.min()) * m + b + + if plot_type.casefold() in ["relief", "plane"]: + actor = pv.StructuredGrid() + actor.points = np.c_[x.ravel(), y.ravel(), z.ravel()] + + actor.dimensions = (len(down_range), len(cross_range), 1) + + actor["values"] = values_2d.ravel() + + else: + scene_actors = self.all_scene_actors["model"] + if scene_actors is None: + return None + actor = pv.PolyData() + for model_actor in scene_actors.values(): + mesh = model_actor.custom_object.get_mesh() + xypoints = mesh.points + cpos = values_2d.flatten() + xpos_ypos = np.column_stack((x.flatten(), y.flatten(), cpos)) + all_indices = self.__find_nearest_neighbors(xpos_ypos, xypoints) + + mag_for_color = np.ndarray.flatten(cpos[all_indices]) + if mesh.__class__.__name__ != "PolyData": + mesh_triangulated = mesh.triangulate() + model_actor.custom_object.mesh = pv.PolyData(mesh_triangulated.points, mesh_triangulated.cells) + else: + model_actor.custom_object.mesh.clear_data() + model_actor.custom_object.mesh[self.rcs_data.data_conversion_function] = mag_for_color + actor += model_actor.custom_object.mesh + + all_results_actors = list(self.all_scene_actors["results"].keys()) + + if "isar_2d" not in all_results_actors: + self.all_scene_actors["results"]["isar_2d"] = {} + + index = 0 + while f"isar_2d_{index}" in self.all_scene_actors["results"]["isar_2d"]: + index += 1 + + isar_name = f"isar_2d_{index}" + + isar_object = SceneMeshObject() + isar_object.name = isar_name + + scalar_dict = dict(color="#000000", title="ISAR 2D") + isar_object.scalar_dict = scalar_dict + + isar_object.cmap = color_bar + + isar_object.mesh = actor + + rcs_mesh = MeshObjectPlot(isar_object, isar_object.get_mesh()) + + self.all_scene_actors["results"]["isar_2d"][isar_name] = rcs_mesh + @pyaedt_function_handler() def clear_scene(self, first_level=None, second_level=None, name=None): if not first_level: @@ -1651,7 +1740,7 @@ def __get_pyvista_range_profile_actor( if extents is None: extents = [0, 10, 0, 10, 0, 10] - plot_type_lower = plot_type.lower() + plot_type_lower = plot_type.casefold() actor = None if ( diff --git a/src/ansys/aedt/core/visualization/advanced/sbrplus/__init__.py b/src/ansys/aedt/core/visualization/advanced/sbrplus/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/visualization/advanced/sbrplus/__init__.py +++ b/src/ansys/aedt/core/visualization/advanced/sbrplus/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/advanced/sbrplus/hdm_parser.py b/src/ansys/aedt/core/visualization/advanced/sbrplus/hdm_parser.py index 6e432468ee7..e227e65fb45 100644 --- a/src/ansys/aedt/core/visualization/advanced/sbrplus/hdm_parser.py +++ b/src/ansys/aedt/core/visualization/advanced/sbrplus/hdm_parser.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -43,10 +43,9 @@ class Parser: - """ - Parser class that loads an HDM-format export file from HFSS SBR+, interprets - its header and its binary content. Except for the header, the binary content is - not parsed until an explicit call to parse_message. + """Parser class that loads an HDM-format export file from HFSS SBR+, interprets its header and its binary content. + + Except for the header, the binary content is not parsed until an explicit call to parse_message. """ def __init__(self, filename): @@ -85,8 +84,8 @@ def _parse(self, type_name): return self._parse_list(**self.parser_types[type_name]) def _parse_simple_base_type(self, format="i", size=4, how_many=1, final_type=None): - """ - Parser for int, float, complex, enum or flag. + """Parser for int, float, complex, enum or flag. + Can also parse a list of base types and convert them to another type if possible. """ end = self.idx + how_many * size @@ -115,9 +114,10 @@ def _parse_simple_base_type(self, format="i", size=4, how_many=1, final_type=Non return res def _parse_list(self, type=None, base=None, size=1): - """ - Parser for vector or list. A vector is interpreted in the linear algebra sense - and converted to a NumPy array. A list is converted to a Python list. Only simple base types can be + """Parser for vector or list. + + A vector is interpreted in the linear algebra sense and converted to a NumPy array. + A list is converted to a Python list. Only simple base types can be interpreted as a NumPy array. """ if base is None: # pragma: no cover diff --git a/src/ansys/aedt/core/visualization/advanced/sbrplus/hdm_utils.py b/src/ansys/aedt/core/visualization/advanced/sbrplus/hdm_utils.py index beb52ec1dcf..10524971784 100644 --- a/src/ansys/aedt/core/visualization/advanced/sbrplus/hdm_utils.py +++ b/src/ansys/aedt/core/visualization/advanced/sbrplus/hdm_utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/advanced/touchstone_parser.py b/src/ansys/aedt/core/visualization/advanced/touchstone_parser.py index bc48aff3624..5cf6556dfab 100644 --- a/src/ansys/aedt/core/visualization/advanced/touchstone_parser.py +++ b/src/ansys/aedt/core/visualization/advanced/touchstone_parser.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -26,7 +26,7 @@ import itertools import os import re -import subprocess +import subprocess # nosec import warnings from ansys.aedt.core.aedt_logger import pyaedt_logger as logger @@ -502,12 +502,12 @@ def check_touchstone_files(input_dir="", passivity=True, causality=True): """ out = {} - sNpFiles = find_touchstone_files(input_dir) - if not sNpFiles: + snp_files = find_touchstone_files(input_dir) + if not snp_files: return out aedt_install_folder = list(aedt_versions.installed_versions.values())[0] - for snpf in sNpFiles: - out[snpf] = [] + for file_name, path in snp_files.items(): + out[file_name] = [] if os.name == "nt": genequiv_path = os.path.join(aedt_install_folder, "genequiv.exe") else: @@ -518,22 +518,20 @@ def check_touchstone_files(input_dir="", passivity=True, causality=True): if causality: cmd.append("-checkcausality") - cmd.append(sNpFiles[snpf]) + cmd.append(path) my_env = os.environ.copy() - p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env) # nosec - output = p.communicate() - output_str = str(output[0]) - output_lst = output_str.split("\\r\\n") + result = subprocess.run( + cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env, text=True, check=True + ) # nosec + output_lst = result.stdout.splitlines() - if len(output_lst) == 1: - output_lst = output_str.splitlines() for line in output_lst: if "Input data" in line and passivity: msg_log = line[17:] is_passive = True if "non-passive" in msg_log: is_passive = False - out[snpf].append(["passivity", is_passive, msg_log]) + out[file_name].append(["passivity", is_passive, msg_log]) if "Maximum causality" in line and causality: msg_log = line[17:] is_causal = True @@ -544,10 +542,10 @@ def check_touchstone_files(input_dir="", passivity=True, causality=True): except Exception: is_causal = False raise Exception("Failed evaluating causality value.") - out[snpf].append(["causality", is_causal, msg_log]) + out[file_name].append(["causality", is_causal, msg_log]) if "Causality check is inconclusive" in line and causality: is_causal = False - out[snpf].append(["causality", is_causal, line[17:]]) + out[file_name].append(["causality", is_causal, line[17:]]) return out diff --git a/src/ansys/aedt/core/visualization/plot/__init__.py b/src/ansys/aedt/core/visualization/plot/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/visualization/plot/__init__.py +++ b/src/ansys/aedt/core/visualization/plot/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/plot/matplotlib.py b/src/ansys/aedt/core/visualization/plot/matplotlib.py index 6fd2ef9de77..9b93320c858 100644 --- a/src/ansys/aedt/core/visualization/plot/matplotlib.py +++ b/src/ansys/aedt/core/visualization/plot/matplotlib.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -1311,14 +1311,7 @@ def _plot_limit_lines(self, convert_to_radians=False): @pyaedt_function_handler() def plot_contour( - self, - trace=0, - polar=False, - levels=64, - max_theta=180, - color_bar=None, - snapshot_path=None, - show=True, + self, trace=0, polar=False, levels=64, max_theta=180, color_bar=None, snapshot_path=None, show=True, figure=None ): """Create a Matplotlib figure contour based on a list of data. @@ -1343,6 +1336,9 @@ def plot_contour( The default value is ``None``. show : bool, optional Whether to show the plot or return the matplotlib object. Default is ``True``. + figure : :class:`matplotlib.pyplot.Figure`, optional + An existing Matplotlib `Figure` to which the plot is added. + If not provided, a new `Figure` and `Axes` object are created. Returns ------- @@ -1355,7 +1351,14 @@ def plot_contour( else: tr = tr[0] projection = "polar" if polar else "rectilinear" - self.fig, self.ax = plt.subplots(subplot_kw={"projection": projection}) + + if not figure: + self.fig, self.ax = plt.subplots(subplot_kw={"projection": projection}) + self.ax = plt.gca() + else: + self.fig = figure + self.ax = figure.add_subplot(111, polar=polar) + self.ax.set_xlabel(tr.x_label) if polar: self.ax.set_rticks(np.linspace(0, max_theta, 3)) @@ -1366,7 +1369,7 @@ def plot_contour( ph = tr._spherical_data[2] th = tr._spherical_data[1] data_to_plot = tr._spherical_data[0] - plt.contourf( + contour = self.ax.contourf( ph, th, data_to_plot, @@ -1374,10 +1377,9 @@ def plot_contour( cmap="jet", ) if color_bar: - cbar = plt.colorbar() + cbar = self.fig.colorbar(contour, ax=self.ax) cbar.set_label(color_bar, rotation=270, labelpad=20) - self.ax = plt.gca() self.ax.yaxis.set_label_coords(-0.1, 0.5) self._plot(snapshot_path, show) return self.fig diff --git a/src/ansys/aedt/core/visualization/plot/pdf.py b/src/ansys/aedt/core/visualization/plot/pdf.py index a220b967568..3a1d77c9923 100644 --- a/src/ansys/aedt/core/visualization/plot/pdf.py +++ b/src/ansys/aedt/core/visualization/plot/pdf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/plot/pyvista.py b/src/ansys/aedt/core/visualization/plot/pyvista.py index f4fa4ec0315..5101ac9f675 100644 --- a/src/ansys/aedt/core/visualization/plot/pyvista.py +++ b/src/ansys/aedt/core/visualization/plot/pyvista.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/__init__.py b/src/ansys/aedt/core/visualization/post/__init__.py index 4009620b257..48fcb1b8703 100644 --- a/src/ansys/aedt/core/visualization/post/__init__.py +++ b/src/ansys/aedt/core/visualization/post/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/common.py b/src/ansys/aedt/core/visualization/post/common.py index 808675537f2..b1057a9e28a 100644 --- a/src/ansys/aedt/core/visualization/post/common.py +++ b/src/ansys/aedt/core/visualization/post/common.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/compliance.py b/src/ansys/aedt/core/visualization/post/compliance.py index 21fa228c71a..4863b423e01 100644 --- a/src/ansys/aedt/core/visualization/post/compliance.py +++ b/src/ansys/aedt/core/visualization/post/compliance.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/farfield_exporter.py b/src/ansys/aedt/core/visualization/post/farfield_exporter.py index f81f88a8d66..03d7709fc2e 100644 --- a/src/ansys/aedt/core/visualization/post/farfield_exporter.py +++ b/src/ansys/aedt/core/visualization/post/farfield_exporter.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/field_data.py b/src/ansys/aedt/core/visualization/post/field_data.py index a479fb8ebe3..2882fae70c6 100644 --- a/src/ansys/aedt/core/visualization/post/field_data.py +++ b/src/ansys/aedt/core/visualization/post/field_data.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/field_summary.py b/src/ansys/aedt/core/visualization/post/field_summary.py index d448abac347..39b9a1b3273 100644 --- a/src/ansys/aedt/core/visualization/post/field_summary.py +++ b/src/ansys/aedt/core/visualization/post/field_summary.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/fields_calculator.py b/src/ansys/aedt/core/visualization/post/fields_calculator.py index b45089740d5..27bf33c7427 100644 --- a/src/ansys/aedt/core/visualization/post/fields_calculator.py +++ b/src/ansys/aedt/core/visualization/post/fields_calculator.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/visualization/post/monitor_icepak.py b/src/ansys/aedt/core/visualization/post/monitor_icepak.py index ffae885db47..121d3cd8bea 100644 --- a/src/ansys/aedt/core/visualization/post/monitor_icepak.py +++ b/src/ansys/aedt/core/visualization/post/monitor_icepak.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/post_3dlayout.py b/src/ansys/aedt/core/visualization/post/post_3dlayout.py index 09e814dd6a9..e9f262bd02b 100644 --- a/src/ansys/aedt/core/visualization/post/post_3dlayout.py +++ b/src/ansys/aedt/core/visualization/post/post_3dlayout.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/post_circuit.py b/src/ansys/aedt/core/visualization/post/post_circuit.py index ec367e7b998..d251a305b65 100644 --- a/src/ansys/aedt/core/visualization/post/post_circuit.py +++ b/src/ansys/aedt/core/visualization/post/post_circuit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/post_common_3d.py b/src/ansys/aedt/core/visualization/post/post_common_3d.py index 608e31e2382..6724d5c5af3 100644 --- a/src/ansys/aedt/core/visualization/post/post_common_3d.py +++ b/src/ansys/aedt/core/visualization/post/post_common_3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/post_icepak.py b/src/ansys/aedt/core/visualization/post/post_icepak.py index 34a6ca97256..d093a675751 100644 --- a/src/ansys/aedt/core/visualization/post/post_icepak.py +++ b/src/ansys/aedt/core/visualization/post/post_icepak.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/rcs_exporter.py b/src/ansys/aedt/core/visualization/post/rcs_exporter.py index 7767c1060a1..8146c296ec6 100644 --- a/src/ansys/aedt/core/visualization/post/rcs_exporter.py +++ b/src/ansys/aedt/core/visualization/post/rcs_exporter.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/solution_data.py b/src/ansys/aedt/core/visualization/post/solution_data.py index aa24e3212ad..92d67cb3ef1 100644 --- a/src/ansys/aedt/core/visualization/post/solution_data.py +++ b/src/ansys/aedt/core/visualization/post/solution_data.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/spisim.py b/src/ansys/aedt/core/visualization/post/spisim.py index 295c4527b34..a1a0987a826 100644 --- a/src/ansys/aedt/core/visualization/post/spisim.py +++ b/src/ansys/aedt/core/visualization/post/spisim.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -73,54 +73,42 @@ def working_directory(self, val): self._working_directory = val @pyaedt_function_handler() - def _compute_spisim(self, parameter, out_file="", touchstone_file="", config_file=""): + def __compute_spisim(self, parameter, config_file, out_file=""): exec_name = "SPISimJNI_LX64.exe" if is_linux else "SPISimJNI_WIN64.exe" - spisimExe = os.path.join(self.desktop_install_dir, "spisim", "SPISim", "modules", "ext", exec_name) + spisim_exe = os.path.join(self.desktop_install_dir, "spisim", "SPISim", "modules", "ext", exec_name) + command = [spisim_exe, parameter] - cfgCmmd = "" - if touchstone_file != "": - cfgCmmd = cfgCmmd + '-i "%s"' % touchstone_file if config_file != "": - if is_linux: - cfgCmmd = "-v CFGFILE=%s" % config_file - else: - cfgCmmd = '-v CFGFILE="%s"' % config_file - if out_file: - cfgCmmd += ', -o "%s"' % out_file - command = [spisimExe, parameter, cfgCmmd] - # Debug('%s %s' % (cmdList[0], ' '.join(arguments))) - # try up to three times to be sure + command += ["-v", f"CFGFILE={config_file}"] if out_file: + command += [",", "-o", f"{out_file}"] out_processing = os.path.join(out_file, generate_unique_name("spsim_out") + ".txt") else: out_processing = os.path.join(generate_unique_folder_name(), generate_unique_name("spsim_out") + ".txt") my_env = os.environ.copy() my_env.update(settings.aedt_environment_variables) - if is_linux: # pragma: no cover if "ANSYSEM_ROOT_PATH" not in my_env: # pragma: no cover my_env["ANSYSEM_ROOT_PATH"] = self.desktop_install_dir if "SPISIM_OUTPUT_LOG" not in my_env: # pragma: no cover my_env["SPISIM_OUTPUT_LOG"] = os.path.join(out_file, generate_unique_name("spsim_out") + ".log") - with open_file(out_processing, "w") as outfile: - subprocess.Popen(command, env=my_env, stdout=outfile, stderr=outfile).wait() # nosec - else: - with open_file(out_processing, "w") as outfile: - subprocess.Popen(" ".join(command), env=my_env, stdout=outfile, stderr=outfile).wait() # nosec + + with open_file(out_processing, "w") as outfile: + subprocess.run(command, env=my_env, stdout=outfile, stderr=outfile, check=True) # nosec return out_processing @pyaedt_function_handler() - def _get_output_parameter_from_result(self, out_file, parameter_name): + def __get_output_parameter_from_result(self, out_file, parameter_name): if parameter_name == "ERL": try: with open_file(out_file, "r") as infile: lines = infile.read() - parmDat = lines.split("[ParmDat]:", 1)[1] - for keyValu in parmDat.split(","): - dataAry = keyValu.split("=") - if dataAry[0].strip().lower() == parameter_name.lower(): - return float(dataAry[1].strip().split()[0]) + parm_dat = lines.split("[ParmDat]:", 1)[1] + for key_value in parm_dat.split(","): + data_arr = key_value.split("=") + if data_arr[0].strip().lower() == parameter_name.lower(): + return float(data_arr[1].strip().split()[0]) self.logger.error( f"Failed to compute {parameter_name}. Check input parameters and retry" ) # pragma: no cover @@ -267,27 +255,22 @@ def compute_erl( cfg_dict["REFLRHO"] = permitted_reflection if permitted_reflection is not None else cfg_dict["REFLRHO"] cfg_dict["NCYCLES"] = reflections_length if reflections_length is not None else cfg_dict["NCYCLES"] - new_cfg_file = os.path.join(self.working_directory, "spisim_erl.cfg").replace("\\", "/") - with open_file(new_cfg_file, "w") as fp: + config_file = os.path.join(self.working_directory, "spisim_erl.cfg").replace("\\", "/") + with open_file(config_file, "w") as fp: for k, v in cfg_dict.items(): fp.write(f"# {k}: {k}\n") fp.write(f"{k} = {v}\n") retries = 3 if "PYTEST_CURRENT_TEST" in os.environ: retries = 10 - trynumb = 0 - while trynumb < retries: - out_processing = self._compute_spisim( - "CalcERL", - touchstone_file=self.touchstone_file, - config_file=new_cfg_file, - out_file=self.working_directory, - ) - results = self._get_output_parameter_from_result(out_processing, "ERL") + nb_retry = 0 + while nb_retry < retries: + out_processing = self.__compute_spisim("CalcERL", config_file, out_file=self.working_directory) + results = self.__get_output_parameter_from_result(out_processing, "ERL") if results: return results self.logger.warning("Failing to compute ERL, retrying...") - trynumb += 1 + nb_retry += 1 self.logger.error("Failed to compute ERL.") return False @@ -345,14 +328,14 @@ def compute_com( com_param.set_parameter("Port Order", "[1 3 2 4]" if port_order == "EvenOdd" else "[1 2 3 4]") com_param.set_parameter("RESULT_DIR", out_folder if out_folder else self.working_directory) - return self._compute_com(com_param) + return self.__compute_com(com_param) @pyaedt_function_handler - def _compute_com( + def __compute_com( self, com_parameter, ): - """Compute Channel Operating Margin. + """Compute Channel Operating Margin (COM). Parameters ---------- @@ -361,7 +344,7 @@ def _compute_com( Returns ------- - + float or list """ thru_snp = com_parameter.parameters["THRUSNP"].replace("\\", "/") fext_snp = com_parameter.parameters["FEXTARY"].replace("\\", "/") @@ -376,8 +359,8 @@ def _compute_com( cfg_file = os.path.join(com_parameter.parameters["RESULT_DIR"], "com_parameters.cfg") com_parameter.export_spisim_cfg(cfg_file) - out_processing = self._compute_spisim(parameter="COM", config_file=cfg_file) - return self._get_output_parameter_from_result(out_processing, "COM") + out_processing = self.__compute_spisim("COM", cfg_file) + return self.__get_output_parameter_from_result(out_processing, "COM") @pyaedt_function_handler def export_com_configure_file(self, file_path, standard=1): @@ -496,7 +479,7 @@ def __len__(self): class SpiSimRawException(Exception): - """Custom class for exception handling""" + """Custom class for exception handling.""" ... diff --git a/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/__init__.py b/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/__init__.py index addb0938ec4..39f7bda009b 100644 --- a/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/__init__.py +++ b/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/com_parameters.py b/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/com_parameters.py index dbe5b79d50f..df6909ae5e1 100644 --- a/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/com_parameters.py +++ b/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/com_parameters.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -46,7 +46,12 @@ class COMStandards(Enum): class COMParameters: - """Base class to manage COM parameters.""" + """Base class to manage COM parameters. + + Parameters + ---------- + standard : int + """ _CFG_DIR = Path(__file__).parent _STD_TABLE_MAPPING = { @@ -59,12 +64,6 @@ class COMParameters: } def __init__(self, standard): - """ - - Parameters - ---------- - standard : int - """ self.table_93a1 = {} self.filter_and_eq = {} self.io_control = {} diff --git a/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/com_settings_mapping.py b/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/com_settings_mapping.py index b41e73b8e1d..58434e72e24 100644 --- a/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/com_settings_mapping.py +++ b/src/ansys/aedt/core/visualization/post/spisim_com_configuration_files/com_settings_mapping.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/post/vrt_data.py b/src/ansys/aedt/core/visualization/post/vrt_data.py index d556d4a20ed..d0ccf53d20f 100644 --- a/src/ansys/aedt/core/visualization/post/vrt_data.py +++ b/src/ansys/aedt/core/visualization/post/vrt_data.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/report/__init__.py b/src/ansys/aedt/core/visualization/report/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/src/ansys/aedt/core/visualization/report/__init__.py +++ b/src/ansys/aedt/core/visualization/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/report/common.py b/src/ansys/aedt/core/visualization/report/common.py index 4889d1a187b..e75df8225a6 100644 --- a/src/ansys/aedt/core/visualization/report/common.py +++ b/src/ansys/aedt/core/visualization/report/common.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/report/constants.py b/src/ansys/aedt/core/visualization/report/constants.py index 4af74811b1d..e4f9a7c5ce7 100644 --- a/src/ansys/aedt/core/visualization/report/constants.py +++ b/src/ansys/aedt/core/visualization/report/constants.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/report/emi.py b/src/ansys/aedt/core/visualization/report/emi.py index 6b4eb1eb4f9..78e23655a62 100644 --- a/src/ansys/aedt/core/visualization/report/emi.py +++ b/src/ansys/aedt/core/visualization/report/emi.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/report/eye.py b/src/ansys/aedt/core/visualization/report/eye.py index 68c9af68a30..344c8df3032 100644 --- a/src/ansys/aedt/core/visualization/report/eye.py +++ b/src/ansys/aedt/core/visualization/report/eye.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/report/field.py b/src/ansys/aedt/core/visualization/report/field.py index ee1cc945b10..3440ac55ea0 100644 --- a/src/ansys/aedt/core/visualization/report/field.py +++ b/src/ansys/aedt/core/visualization/report/field.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/visualization/report/standard.py b/src/ansys/aedt/core/visualization/report/standard.py index 6e27c94ef34..4eb0e650ed0 100644 --- a/src/ansys/aedt/core/visualization/report/standard.py +++ b/src/ansys/aedt/core/visualization/report/standard.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -117,6 +117,36 @@ def pulse_rise_time(self): def pulse_rise_time(self, val): self._legacy_props["context"]["pulse_rise_time"] = val + @property + def maximum_time(self): + """Value of maximum time for TDR plot. + + Returns + ------- + float + Maximum time. + """ + return self._legacy_props["context"].get("maximum_time", 0) if self.domain == "Time" else 0 + + @maximum_time.setter + def maximum_time(self, val): + self._legacy_props["context"]["maximum_time"] = val + + @property + def step_time(self): + """Value of step time for TDR plot. + + Returns + ------- + float + step time. + """ + return self._legacy_props["context"].get("step_time", 0) if self.domain == "Time" else 0 + + @step_time.setter + def step_time(self, val): + self._legacy_props["context"]["step_time"] = val + @property def time_windowing(self): """Returns the TDR time windowing. @@ -227,8 +257,8 @@ def _context(self): 1, 1, "", - self.pulse_rise_time / 5, - self.pulse_rise_time * 100, + (self.pulse_rise_time / 5) if not self.step_time else self.step_time, + (self.pulse_rise_time * 100) if not self.maximum_time else self.maximum_time, "EnsDiffPairKey", False, "1", @@ -254,8 +284,8 @@ def _context(self): 1, 1, "", - self.pulse_rise_time / 5, - self.pulse_rise_time * 100, + (self.pulse_rise_time / 5) if not self.step_time else self.step_time, + (self.pulse_rise_time * 100) if not self.maximum_time else self.maximum_time, "EnsDiffPairKey", False, "0", @@ -281,8 +311,8 @@ def _context(self): 1, 1, "", - self.pulse_rise_time / 5, - self.pulse_rise_time * 100, + (self.pulse_rise_time / 5) if not self.step_time else self.step_time, + (self.pulse_rise_time * 100) if not self.maximum_time else self.maximum_time, ], ] if self.sub_design_id: diff --git a/src/ansys/aedt/core/workflows/__init__.py b/src/ansys/aedt/core/workflows/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/__init__.py +++ b/src/ansys/aedt/core/workflows/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/circuit/__init__.py b/src/ansys/aedt/core/workflows/circuit/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/circuit/__init__.py +++ b/src/ansys/aedt/core/workflows/circuit/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/circuit/import_schematic.py b/src/ansys/aedt/core/workflows/circuit/import_schematic.py index c4ce40b1723..9c40a76ae98 100644 --- a/src/ansys/aedt/core/workflows/circuit/import_schematic.py +++ b/src/ansys/aedt/core/workflows/circuit/import_schematic.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/customize_automation_tab.py b/src/ansys/aedt/core/workflows/customize_automation_tab.py index ed3c305b043..c0b70b56d11 100644 --- a/src/ansys/aedt/core/workflows/customize_automation_tab.py +++ b/src/ansys/aedt/core/workflows/customize_automation_tab.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/emit/__init__.py b/src/ansys/aedt/core/workflows/emit/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/emit/__init__.py +++ b/src/ansys/aedt/core/workflows/emit/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/hfss/__init__.py b/src/ansys/aedt/core/workflows/hfss/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/hfss/__init__.py +++ b/src/ansys/aedt/core/workflows/hfss/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/hfss/choke_designer.py b/src/ansys/aedt/core/workflows/hfss/choke_designer.py index 8998cc36e3e..7ddc60a3edd 100644 --- a/src/ansys/aedt/core/workflows/hfss/choke_designer.py +++ b/src/ansys/aedt/core/workflows/hfss/choke_designer.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/hfss/push_excitation_from_file.py b/src/ansys/aedt/core/workflows/hfss/push_excitation_from_file.py index d520e4911c9..e6a417276d3 100644 --- a/src/ansys/aedt/core/workflows/hfss/push_excitation_from_file.py +++ b/src/ansys/aedt/core/workflows/hfss/push_excitation_from_file.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/hfss3dlayout/__init__.py b/src/ansys/aedt/core/workflows/hfss3dlayout/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/hfss3dlayout/__init__.py +++ b/src/ansys/aedt/core/workflows/hfss3dlayout/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/hfss3dlayout/cutout.py b/src/ansys/aedt/core/workflows/hfss3dlayout/cutout.py index 3733783f6b8..43a6f7b75b3 100644 --- a/src/ansys/aedt/core/workflows/hfss3dlayout/cutout.py +++ b/src/ansys/aedt/core/workflows/hfss3dlayout/cutout.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/hfss3dlayout/export_layout.py b/src/ansys/aedt/core/workflows/hfss3dlayout/export_layout.py index 288af100638..7032fdd67c0 100644 --- a/src/ansys/aedt/core/workflows/hfss3dlayout/export_layout.py +++ b/src/ansys/aedt/core/workflows/hfss3dlayout/export_layout.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/hfss3dlayout/export_to_3d.py b/src/ansys/aedt/core/workflows/hfss3dlayout/export_to_3d.py index ae049bcddb1..49adbabda7d 100644 --- a/src/ansys/aedt/core/workflows/hfss3dlayout/export_to_3d.py +++ b/src/ansys/aedt/core/workflows/hfss3dlayout/export_to_3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/hfss3dlayout/generate_arbitrary_wave_ports.py b/src/ansys/aedt/core/workflows/hfss3dlayout/generate_arbitrary_wave_ports.py index 20336329276..2e7469b6b36 100644 --- a/src/ansys/aedt/core/workflows/hfss3dlayout/generate_arbitrary_wave_ports.py +++ b/src/ansys/aedt/core/workflows/hfss3dlayout/generate_arbitrary_wave_ports.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/hfss3dlayout/parametrize_edb.py b/src/ansys/aedt/core/workflows/hfss3dlayout/parametrize_edb.py index ed53ddd96a0..b36756b7606 100644 --- a/src/ansys/aedt/core/workflows/hfss3dlayout/parametrize_edb.py +++ b/src/ansys/aedt/core/workflows/hfss3dlayout/parametrize_edb.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/hfss3dlayout/push_excitation_from_file_3dl.py b/src/ansys/aedt/core/workflows/hfss3dlayout/push_excitation_from_file_3dl.py index a86246c0f61..f8e57f7911c 100644 --- a/src/ansys/aedt/core/workflows/hfss3dlayout/push_excitation_from_file_3dl.py +++ b/src/ansys/aedt/core/workflows/hfss3dlayout/push_excitation_from_file_3dl.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/icepak/__init__.py b/src/ansys/aedt/core/workflows/icepak/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/icepak/__init__.py +++ b/src/ansys/aedt/core/workflows/icepak/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/icepak/power_map_from_csv.py b/src/ansys/aedt/core/workflows/icepak/power_map_from_csv.py index 0d0bb86b893..ec879837374 100644 --- a/src/ansys/aedt/core/workflows/icepak/power_map_from_csv.py +++ b/src/ansys/aedt/core/workflows/icepak/power_map_from_csv.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/maxwell2d/__init__.py b/src/ansys/aedt/core/workflows/maxwell2d/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/maxwell2d/__init__.py +++ b/src/ansys/aedt/core/workflows/maxwell2d/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/maxwell3d/__init__.py b/src/ansys/aedt/core/workflows/maxwell3d/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/maxwell3d/__init__.py +++ b/src/ansys/aedt/core/workflows/maxwell3d/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/mechanical/__init__.py b/src/ansys/aedt/core/workflows/mechanical/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/mechanical/__init__.py +++ b/src/ansys/aedt/core/workflows/mechanical/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/misc.py b/src/ansys/aedt/core/workflows/misc.py index 12abbce5fff..448d6b33335 100644 --- a/src/ansys/aedt/core/workflows/misc.py +++ b/src/ansys/aedt/core/workflows/misc.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -147,9 +147,11 @@ def __init__(self): self.default_font = ("Arial", 12) def apply_light_theme(self, style): + """Apply light theme.""" self._apply_theme(style, self.light) def apply_dark_theme(self, style): + """Apply dark theme.""" self._apply_theme(style, self.dark) def _apply_theme(self, style, colors): diff --git a/src/ansys/aedt/core/workflows/project/__init__.py b/src/ansys/aedt/core/workflows/project/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/project/__init__.py +++ b/src/ansys/aedt/core/workflows/project/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/project/advanced_fields_calculator.py b/src/ansys/aedt/core/workflows/project/advanced_fields_calculator.py index 933cc160f7a..98785b45f95 100644 --- a/src/ansys/aedt/core/workflows/project/advanced_fields_calculator.py +++ b/src/ansys/aedt/core/workflows/project/advanced_fields_calculator.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/project/configure_edb.py b/src/ansys/aedt/core/workflows/project/configure_edb.py index 382a67a160a..db468c45988 100644 --- a/src/ansys/aedt/core/workflows/project/configure_edb.py +++ b/src/ansys/aedt/core/workflows/project/configure_edb.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/project/create_report.py b/src/ansys/aedt/core/workflows/project/create_report.py index db376b51bde..1a4cc9f1915 100644 --- a/src/ansys/aedt/core/workflows/project/create_report.py +++ b/src/ansys/aedt/core/workflows/project/create_report.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/project/import_nastran.py b/src/ansys/aedt/core/workflows/project/import_nastran.py index e156e8fcd5b..e78aa23445f 100644 --- a/src/ansys/aedt/core/workflows/project/import_nastran.py +++ b/src/ansys/aedt/core/workflows/project/import_nastran.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/project/kernel_converter.py b/src/ansys/aedt/core/workflows/project/kernel_converter.py index c14738d2f0c..c1079764504 100644 --- a/src/ansys/aedt/core/workflows/project/kernel_converter.py +++ b/src/ansys/aedt/core/workflows/project/kernel_converter.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/src/ansys/aedt/core/workflows/q2d/__init__.py b/src/ansys/aedt/core/workflows/q2d/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/q2d/__init__.py +++ b/src/ansys/aedt/core/workflows/q2d/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/q3d/__init__.py b/src/ansys/aedt/core/workflows/q3d/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/q3d/__init__.py +++ b/src/ansys/aedt/core/workflows/q3d/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/templates/__init__.py b/src/ansys/aedt/core/workflows/templates/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/templates/__init__.py +++ b/src/ansys/aedt/core/workflows/templates/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/templates/pyaedt_utils.py b/src/ansys/aedt/core/workflows/templates/pyaedt_utils.py index 11c0923cd3f..f2fc5ba6665 100644 --- a/src/ansys/aedt/core/workflows/templates/pyaedt_utils.py +++ b/src/ansys/aedt/core/workflows/templates/pyaedt_utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/templates/template_get_started.py b/src/ansys/aedt/core/workflows/templates/template_get_started.py index 0b9b1002888..cbac809c7a2 100644 --- a/src/ansys/aedt/core/workflows/templates/template_get_started.py +++ b/src/ansys/aedt/core/workflows/templates/template_get_started.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/twinbuilder/__init__.py b/src/ansys/aedt/core/workflows/twinbuilder/__init__.py index f10103137e9..4b4bef088b4 100644 --- a/src/ansys/aedt/core/workflows/twinbuilder/__init__.py +++ b/src/ansys/aedt/core/workflows/twinbuilder/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/ansys/aedt/core/workflows/twinbuilder/convert_to_circuit.py b/src/ansys/aedt/core/workflows/twinbuilder/convert_to_circuit.py index c9ed24cb098..0c7ae914447 100644 --- a/src/ansys/aedt/core/workflows/twinbuilder/convert_to_circuit.py +++ b/src/ansys/aedt/core/workflows/twinbuilder/convert_to_circuit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/__init__.py b/tests/__init__.py index 3a26ec85f77..354fd81f25f 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/conftest.py b/tests/conftest.py index 2daabf60f5b..4640dcda5b5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index 822cc1f80fb..1a157585db4 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/integration/test_monostatic_rcs_data.py b/tests/integration/test_monostatic_rcs_data.py index 8b224837656..46684abcef8 100644 --- a/tests/integration/test_monostatic_rcs_data.py +++ b/tests/integration/test_monostatic_rcs_data.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/integration/test_touchstone_data.py b/tests/integration/test_touchstone_data.py index 336b86bd7e2..837c7aeead0 100644 --- a/tests/integration/test_touchstone_data.py +++ b/tests/integration/test_touchstone_data.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/__init__.py b/tests/system/__init__.py index 296abe8d52c..ed642961485 100644 --- a/tests/system/__init__.py +++ b/tests/system/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/__init__.py b/tests/system/general/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/tests/system/general/__init__.py +++ b/tests/system/general/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/conftest.py b/tests/system/general/conftest.py index f36c07515f2..faadc215643 100644 --- a/tests/system/general/conftest.py +++ b/tests/system/general/conftest.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/example_models/T49/rcs_metadata.json b/tests/system/general/example_models/T49/rcs_metadata.json deleted file mode 100644 index 5fee8041a9c..00000000000 --- a/tests/system/general/example_models/T49/rcs_metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "solution": "Trihedral_RCS", - "monostatic_file": "rcs_data.h5", - "model_units": "mm", - "frequency_units": "GHz", - "model_info": { - "Polyline1": [ - "Polyline1.obj", - [ - 143, - 175, - 143 - ], - 1.0, - "mm" - ], - "Polyline1_1": [ - "Polyline1_1.obj", - [ - 143, - 175, - 143 - ], - 1.0, - "mm" - ], - "Polyline1_2": [ - "Polyline1_2.obj", - [ - 143, - 175, - 143 - ], - 1.0, - "mm" - ] - } -} \ No newline at end of file diff --git a/tests/system/general/example_models/T49/rcs_metadata_fake.json b/tests/system/general/example_models/T49/rcs_metadata_fake.json deleted file mode 100644 index 9dfa9d6b079..00000000000 --- a/tests/system/general/example_models/T49/rcs_metadata_fake.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "solution": "Trihedral_RCS", - "monostatic_file": "invented.h5", - "model_units": "mm", - "frequency_units": "GHz", - "model_info": { - "Polyline1": [ - "Polyline1.obj", - [ - 143, - 175, - 143 - ], - 1.0, - "mm" - ], - "Polyline1_1": [ - "Polyline1_1.obj", - [ - 143, - 175, - 143 - ], - 1.0, - "mm" - ], - "Polyline1_2": [ - "Polyline1_2.obj", - [ - 143, - 175, - 143 - ], - 1.0, - "mm" - ] - } -} \ No newline at end of file diff --git a/tests/system/general/test_01_3dlayout_edb.py b/tests/system/general/test_01_3dlayout_edb.py index 4d9f0b98e61..1afbe1e7eda 100644 --- a/tests/system/general/test_01_3dlayout_edb.py +++ b/tests/system/general/test_01_3dlayout_edb.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_01_Design.py b/tests/system/general/test_01_Design.py index 040740de3fc..4f284f1e1fb 100644 --- a/tests/system/general/test_01_Design.py +++ b/tests/system/general/test_01_Design.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_01_GeometryOperators.py b/tests/system/general/test_01_GeometryOperators.py index 1c18398a7c4..fffe6d3f165 100644 --- a/tests/system/general/test_01_GeometryOperators.py +++ b/tests/system/general/test_01_GeometryOperators.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_01_configuration_files.py b/tests/system/general/test_01_configuration_files.py index 27045e04704..22a62e189c6 100644 --- a/tests/system/general/test_01_configuration_files.py +++ b/tests/system/general/test_01_configuration_files.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_01_data_handlers.py b/tests/system/general/test_01_data_handlers.py index d46d20fb785..dd8dd0f8914 100644 --- a/tests/system/general/test_01_data_handlers.py +++ b/tests/system/general/test_01_data_handlers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_01_downloads.py b/tests/system/general/test_01_downloads.py index 6323318e86e..12ffa4b806c 100644 --- a/tests/system/general/test_01_downloads.py +++ b/tests/system/general/test_01_downloads.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_01_general_methods.py b/tests/system/general/test_01_general_methods.py index a76677f2a8f..d9b8f13c872 100644 --- a/tests/system/general/test_01_general_methods.py +++ b/tests/system/general/test_01_general_methods.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_01_report_file_parser.py b/tests/system/general/test_01_report_file_parser.py index 2dc5f54c7ef..1e9b582acb7 100644 --- a/tests/system/general/test_01_report_file_parser.py +++ b/tests/system/general/test_01_report_file_parser.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_01_toolkit_icons.py b/tests/system/general/test_01_toolkit_icons.py index 738b460fb52..1e1081a9a18 100644 --- a/tests/system/general/test_01_toolkit_icons.py +++ b/tests/system/general/test_01_toolkit_icons.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_02_2D_modeler.py b/tests/system/general/test_02_2D_modeler.py index 7d9f87a58e1..d435c419e59 100644 --- a/tests/system/general/test_02_2D_modeler.py +++ b/tests/system/general/test_02_2D_modeler.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_02_3D_modeler.py b/tests/system/general/test_02_3D_modeler.py index d9592567d97..f5e9b833b6a 100644 --- a/tests/system/general/test_02_3D_modeler.py +++ b/tests/system/general/test_02_3D_modeler.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_03_Materials.py b/tests/system/general/test_03_Materials.py index c3758a23de7..95cec4cb59b 100644 --- a/tests/system/general/test_03_Materials.py +++ b/tests/system/general/test_03_Materials.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_04_SBR.py b/tests/system/general/test_04_SBR.py index 34b61ce98bb..919093c1b26 100644 --- a/tests/system/general/test_04_SBR.py +++ b/tests/system/general/test_04_SBR.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_05_Mesh.py b/tests/system/general/test_05_Mesh.py index 10632fa98fd..1678f4a2ca5 100644 --- a/tests/system/general/test_05_Mesh.py +++ b/tests/system/general/test_05_Mesh.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_06_MessageManager.py b/tests/system/general/test_06_MessageManager.py index ccddc65df60..704a79a271e 100644 --- a/tests/system/general/test_06_MessageManager.py +++ b/tests/system/general/test_06_MessageManager.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_07_Object3D.py b/tests/system/general/test_07_Object3D.py index 128f1d4e612..e066b9e568d 100644 --- a/tests/system/general/test_07_Object3D.py +++ b/tests/system/general/test_07_Object3D.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_08_Primitives3D.py b/tests/system/general/test_08_Primitives3D.py index 544fa53c2ea..4f3a71e6d85 100644 --- a/tests/system/general/test_08_Primitives3D.py +++ b/tests/system/general/test_08_Primitives3D.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_09_Primitives2D.py b/tests/system/general/test_09_Primitives2D.py index d9da2c97bc0..5e4764902ef 100644 --- a/tests/system/general/test_09_Primitives2D.py +++ b/tests/system/general/test_09_Primitives2D.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_09_VariableManager.py b/tests/system/general/test_09_VariableManager.py index 024996eefb8..c7407a39024 100644 --- a/tests/system/general/test_09_VariableManager.py +++ b/tests/system/general/test_09_VariableManager.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_11_Setup.py b/tests/system/general/test_11_Setup.py index c3885a87f71..ae48203a6ea 100644 --- a/tests/system/general/test_11_Setup.py +++ b/tests/system/general/test_11_Setup.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_12_1_PostProcessing.py b/tests/system/general/test_12_1_PostProcessing.py index 7a65c67fbbc..c03c327e662 100644 --- a/tests/system/general/test_12_1_PostProcessing.py +++ b/tests/system/general/test_12_1_PostProcessing.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_12_PostProcessing.py b/tests/system/general/test_12_PostProcessing.py index 3680d734aa7..a27b98cb51f 100644 --- a/tests/system/general/test_12_PostProcessing.py +++ b/tests/system/general/test_12_PostProcessing.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -417,6 +417,8 @@ def test_18_diff_plot(self, diff_test): new_report2 = diff_test.post.reports_by_category.standard("TDRZ(1)") new_report2.differential_pairs = True new_report2.pulse_rise_time = 3e-12 + new_report2.maximum_time = 30e-12 + new_report2.step_time = 6e-13 new_report2.time_windowing = 3 new_report2.domain = "Time" diff --git a/tests/system/general/test_13_LoadAEDTFile.py b/tests/system/general/test_13_LoadAEDTFile.py index 4d58b2b2743..1fc85f3da85 100644 --- a/tests/system/general/test_13_LoadAEDTFile.py +++ b/tests/system/general/test_13_LoadAEDTFile.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_14_AedtLogger.py b/tests/system/general/test_14_AedtLogger.py index 14cb9c28698..d56e5fa29cf 100644 --- a/tests/system/general/test_14_AedtLogger.py +++ b/tests/system/general/test_14_AedtLogger.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_15_ibs_reader.py b/tests/system/general/test_15_ibs_reader.py index 1d4b4e7be71..8105d88f68e 100644 --- a/tests/system/general/test_15_ibs_reader.py +++ b/tests/system/general/test_15_ibs_reader.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_16_3d_stackup.py b/tests/system/general/test_16_3d_stackup.py index 9250fdd7dea..24833e63a12 100644 --- a/tests/system/general/test_16_3d_stackup.py +++ b/tests/system/general/test_16_3d_stackup.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_20_HFSS.py b/tests/system/general/test_20_HFSS.py index 572799e5995..b38d1f00ab1 100644 --- a/tests/system/general/test_20_HFSS.py +++ b/tests/system/general/test_20_HFSS.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_21_Circuit.py b/tests/system/general/test_21_Circuit.py index 5206963e6e5..57266196724 100644 --- a/tests/system/general/test_21_Circuit.py +++ b/tests/system/general/test_21_Circuit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_22_Circuit_DynamicLink.py b/tests/system/general/test_22_Circuit_DynamicLink.py index 3a5fbcfc2e6..9f17d7e2de2 100644 --- a/tests/system/general/test_22_Circuit_DynamicLink.py +++ b/tests/system/general/test_22_Circuit_DynamicLink.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index 55371228e03..7b66f96e10f 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_28_Maxwell3D.py b/tests/system/general/test_28_Maxwell3D.py index 78eb079aab1..b50c35dd4f9 100644 --- a/tests/system/general/test_28_Maxwell3D.py +++ b/tests/system/general/test_28_Maxwell3D.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_29_Mechanical.py b/tests/system/general/test_29_Mechanical.py index 844265eb938..dc2680b060a 100644 --- a/tests/system/general/test_29_Mechanical.py +++ b/tests/system/general/test_29_Mechanical.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_30_Q2D.py b/tests/system/general/test_30_Q2D.py index b3726af921d..6842f7e2a08 100644 --- a/tests/system/general/test_30_Q2D.py +++ b/tests/system/general/test_30_Q2D.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_32_RMxprt.py b/tests/system/general/test_32_RMxprt.py index 6e9816f5d2c..800282d1ccc 100644 --- a/tests/system/general/test_32_RMxprt.py +++ b/tests/system/general/test_32_RMxprt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_34_TwinBuilder.py b/tests/system/general/test_34_TwinBuilder.py index 717adda63a0..71cfbc4fc4e 100644 --- a/tests/system/general/test_34_TwinBuilder.py +++ b/tests/system/general/test_34_TwinBuilder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_35_MaxwellCircuit.py b/tests/system/general/test_35_MaxwellCircuit.py index 39ef4277df4..3df6672e2f3 100644 --- a/tests/system/general/test_35_MaxwellCircuit.py +++ b/tests/system/general/test_35_MaxwellCircuit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_36_Q2D_PostProcessing.py b/tests/system/general/test_36_Q2D_PostProcessing.py index bb674a5464a..d921c9634c0 100644 --- a/tests/system/general/test_36_Q2D_PostProcessing.py +++ b/tests/system/general/test_36_Q2D_PostProcessing.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_37_Genetic_Algorithm.py b/tests/system/general/test_37_Genetic_Algorithm.py index 263d8deff65..2da18ff88d3 100644 --- a/tests/system/general/test_37_Genetic_Algorithm.py +++ b/tests/system/general/test_37_Genetic_Algorithm.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_41_3dlayout_modeler.py b/tests/system/general/test_41_3dlayout_modeler.py index be902599c7d..53277fd743a 100644 --- a/tests/system/general/test_41_3dlayout_modeler.py +++ b/tests/system/general/test_41_3dlayout_modeler.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_43_CableModeling.py b/tests/system/general/test_43_CableModeling.py index b8101c28209..e80faac5693 100644 --- a/tests/system/general/test_43_CableModeling.py +++ b/tests/system/general/test_43_CableModeling.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_44_TouchstoneParser.py b/tests/system/general/test_44_TouchstoneParser.py index 77068edea35..37b457253d0 100644 --- a/tests/system/general/test_44_TouchstoneParser.py +++ b/tests/system/general/test_44_TouchstoneParser.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/__init__.py b/tests/system/general/test_45_FilterSolutions/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/tests/system/general/test_45_FilterSolutions/__init__.py +++ b/tests/system/general/test_45_FilterSolutions/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/resources/__init__.py b/tests/system/general/test_45_FilterSolutions/resources/__init__.py index f744b86ba71..71f363ec64c 100644 --- a/tests/system/general/test_45_FilterSolutions/resources/__init__.py +++ b/tests/system/general/test_45_FilterSolutions/resources/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/resources/resources.py b/tests/system/general/test_45_FilterSolutions/resources/resources.py index 2cdcbbb2952..027f2606b28 100644 --- a/tests/system/general/test_45_FilterSolutions/resources/resources.py +++ b/tests/system/general/test_45_FilterSolutions/resources/resources.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_filter/__init__.py b/tests/system/general/test_45_FilterSolutions/test_filter/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/tests/system/general/test_45_FilterSolutions/test_filter/__init__.py +++ b/tests/system/general/test_45_FilterSolutions/test_filter/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_filter/test_attributes.py b/tests/system/general/test_45_FilterSolutions/test_filter/test_attributes.py index 28ade85e37f..eb0b809e391 100644 --- a/tests/system/general/test_45_FilterSolutions/test_filter/test_attributes.py +++ b/tests/system/general/test_45_FilterSolutions/test_filter/test_attributes.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -151,12 +151,6 @@ def test_minimum_order_group_delay_cutoff(self): design.attributes.minimum_order_group_delay_cutoff = "500 MHz" assert design.attributes.minimum_order_group_delay_cutoff == "500 MHz" - def test_minimum_order_stop_band_freq(self): - design = ansys.aedt.core.FilterSolutions(implementation_type=FilterImplementation.LUMPED) - assert design.attributes.minimum_order_stop_band_frequency == "10 GHz" - design.attributes.minimum_order_stop_band_frequency = "500 MHz" - assert design.attributes.minimum_order_stop_band_frequency == "500 MHz" - def test_minimum_order(self): design = ansys.aedt.core.FilterSolutions(implementation_type=FilterImplementation.LUMPED) assert design.attributes.filter_order == 5 diff --git a/tests/system/general/test_45_FilterSolutions/test_filter/test_dll_interface.py b/tests/system/general/test_45_FilterSolutions/test_filter/test_dll_interface.py index 78059eb3ad7..d61cb5be1d7 100644 --- a/tests/system/general/test_45_FilterSolutions/test_filter/test_dll_interface.py +++ b/tests/system/general/test_45_FilterSolutions/test_filter/test_dll_interface.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_filter/test_graph_setup.py b/tests/system/general/test_45_FilterSolutions/test_filter/test_graph_setup.py index 24cdaf46449..dfb32ae2e4d 100644 --- a/tests/system/general/test_45_FilterSolutions/test_filter/test_graph_setup.py +++ b/tests/system/general/test_45_FilterSolutions/test_filter/test_graph_setup.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_filter/test_ideal_response.py b/tests/system/general/test_45_FilterSolutions/test_filter/test_ideal_response.py index 1bfd2dd1568..94a8ac18510 100644 --- a/tests/system/general/test_45_FilterSolutions/test_filter/test_ideal_response.py +++ b/tests/system/general/test_45_FilterSolutions/test_filter/test_ideal_response.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_filter/test_multiple_bands_table.py b/tests/system/general/test_45_FilterSolutions/test_filter/test_multiple_bands_table.py index 2050efce0a8..32f9a63fa8d 100644 --- a/tests/system/general/test_45_FilterSolutions/test_filter/test_multiple_bands_table.py +++ b/tests/system/general/test_45_FilterSolutions/test_filter/test_multiple_bands_table.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_filter/test_transmission_zeros.py b/tests/system/general/test_45_FilterSolutions/test_filter/test_transmission_zeros.py index 1cf81d7b2b3..c34ccdfcc32 100644 --- a/tests/system/general/test_45_FilterSolutions/test_filter/test_transmission_zeros.py +++ b/tests/system/general/test_45_FilterSolutions/test_filter/test_transmission_zeros.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_lumped_export/__init__.py b/tests/system/general/test_45_FilterSolutions/test_lumped_export/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/tests/system/general/test_45_FilterSolutions/test_lumped_export/__init__.py +++ b/tests/system/general/test_45_FilterSolutions/test_lumped_export/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_lumped_export/test_export_to_aedt.py b/tests/system/general/test_45_FilterSolutions/test_lumped_export/test_export_to_aedt.py index 876c335be0a..348edcefe35 100644 --- a/tests/system/general/test_45_FilterSolutions/test_lumped_export/test_export_to_aedt.py +++ b/tests/system/general/test_45_FilterSolutions/test_lumped_export/test_export_to_aedt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_lumped_export/test_optimization_goals_table.py b/tests/system/general/test_45_FilterSolutions/test_lumped_export/test_optimization_goals_table.py index 902f18a3753..4c3b5ceb102 100644 --- a/tests/system/general/test_45_FilterSolutions/test_lumped_export/test_optimization_goals_table.py +++ b/tests/system/general/test_45_FilterSolutions/test_lumped_export/test_optimization_goals_table.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_lumped_filter/__init__.py b/tests/system/general/test_45_FilterSolutions/test_lumped_filter/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/tests/system/general/test_45_FilterSolutions/test_lumped_filter/__init__.py +++ b/tests/system/general/test_45_FilterSolutions/test_lumped_filter/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_nodes_and_leads.py b/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_nodes_and_leads.py index 066fa910254..8ab0696de4c 100644 --- a/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_nodes_and_leads.py +++ b/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_nodes_and_leads.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_parasitics.py b/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_parasitics.py index f0d455c6c69..b785ce8e9b6 100644 --- a/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_parasitics.py +++ b/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_parasitics.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_termination_impedance_table.py b/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_termination_impedance_table.py index a8a9f4c37d0..d512592f032 100644 --- a/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_termination_impedance_table.py +++ b/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_termination_impedance_table.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_topology.py b/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_topology.py index 24d9dd32a68..f42d138912c 100644 --- a/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_topology.py +++ b/tests/system/general/test_45_FilterSolutions/test_lumped_filter/test_lumped_topology.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_45_FilterSolutions/test_raise_error.py b/tests/system/general/test_45_FilterSolutions/test_raise_error.py index 8fc957e7f21..b491c862c0f 100644 --- a/tests/system/general/test_45_FilterSolutions/test_raise_error.py +++ b/tests/system/general/test_45_FilterSolutions/test_raise_error.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_46_FarField.py b/tests/system/general/test_46_FarField.py index 786599e97be..54ef87494c6 100644 --- a/tests/system/general/test_46_FarField.py +++ b/tests/system/general/test_46_FarField.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_47_CircuitNetlist.py b/tests/system/general/test_47_CircuitNetlist.py index e3c71e6c9b1..a148ad9a9a8 100644 --- a/tests/system/general/test_47_CircuitNetlist.py +++ b/tests/system/general/test_47_CircuitNetlist.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_48_RCS_export.py b/tests/system/general/test_48_RCS_export.py index c34d7e3794e..72eba6c9d43 100644 --- a/tests/system/general/test_48_RCS_export.py +++ b/tests/system/general/test_48_RCS_export.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_49_RCS_data_plotter.py b/tests/system/general/test_49_RCS_data_plotter.py index 11488f30117..bd4a4a8c8b4 100644 --- a/tests/system/general/test_49_RCS_data_plotter.py +++ b/tests/system/general/test_49_RCS_data_plotter.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -22,7 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import os +import json +from pathlib import Path import shutil from ansys.aedt.core.visualization.advanced.rcs_visualization import MonostaticRCSData @@ -46,11 +47,57 @@ def desktop(): @pytest.fixture(scope="class") def setup_test_data(request, local_scratch): """Fixture to set up the test data directory and file before running the test class.""" - dir_original = os.path.join(TESTS_GENERAL_PATH, "example_models", test_subfolder) - data_dir = os.path.join(local_scratch.path, "rcs_files") + dir_original = Path(TESTS_GENERAL_PATH) / "example_models" / test_subfolder + data_dir = Path(local_scratch.path) / "rcs_files" shutil.copytree(dir_original, data_dir) - request.cls.metadata_file = os.path.join(data_dir, "rcs_metadata.json") - request.cls.metadata_file_fake = os.path.join(data_dir, "rcs_metadata_fake.json") + + metadata = { + "solution": "Trihedral_RCS", + "monostatic_file": "rcs_data.h5", + "model_units": "mm", + "frequency_units": "GHz", + "model_info": { + "Polyline1": ["Polyline1.obj", [143, 175, 143], 1.0, "mm"], + "Polyline1_1": ["Polyline1_1.obj", [143, 175, 143], 1.0, "mm"], + "Polyline1_2": ["Polyline1_2.obj", [143, 175, 143], 1.0, "mm"], + }, + } + metadata_file = data_dir / "rcs_metadata.json" + with open(metadata_file, "w") as f: + json.dump(metadata, f) + request.cls.metadata_file = metadata_file + + metadata_fake = { + "solution": "Trihedral_RCS", + "monostatic_file": "invented.h5", + "model_units": "mm", + "frequency_units": "GHz", + "model_info": { + "Polyline1": ["Polyline1.obj", [143, 175, 143], 1.0, "mm"], + "Polyline1_1": ["Polyline1_1.obj", [143, 175, 143], 1.0, "mm"], + "Polyline1_2": ["Polyline1_2.obj", [143, 175, 143], 1.0, "mm"], + }, + } + metadata_file_fake = data_dir / "rcs_metadata_fake.json" + with open(metadata_file_fake, "w") as f: + json.dump(metadata_fake, f) + request.cls.metadata_file_fake = metadata_file_fake + + metadata_no_data = { + "solution": "Trihedral_RCS", + "monostatic_file": None, + "model_units": "mm", + "frequency_units": None, + "model_info": { + "Polyline1": ["Polyline1.obj", [143, 175, 143], 1.0, "mm"], + "Polyline1_1": ["Polyline1_1.obj", [143, 175, 143], 1.0, "mm"], + "Polyline1_2": ["Polyline1_2.obj", [143, 175, 143], 1.0, "mm"], + }, + } + metadata_file_no_data = data_dir / "rcs_metadata_no_data.json" + with open(metadata_file_no_data, "w") as f: + json.dump(metadata_no_data, f) + request.cls.metadata_file_no_data = metadata_file_no_data yield @@ -61,16 +108,16 @@ def test_01_rcs_data(self): MonostaticRCSData(input_file="invented") with pytest.raises(Exception, match="Monostatic file invalid."): - MonostaticRCSData(input_file=self.metadata_file_fake) + MonostaticRCSData(input_file=str(self.metadata_file_fake)) - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) assert isinstance(rcs_data.raw_data, pd.DataFrame) assert isinstance(rcs_data.metadata, dict) assert rcs_data.name == "HH" assert rcs_data.solution == "Trihedral_RCS" - assert os.path.isfile(rcs_data.input_file) + assert Path(rcs_data.input_file).is_file() assert rcs_data.frequency_units == "GHz" assert len(rcs_data.frequencies) == 3 @@ -140,7 +187,7 @@ def test_01_rcs_data(self): assert isinstance(rcs_data.isar_2d, pd.DataFrame) def test_02_rcs_plotter_properties(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) assert rcs_plotter.rcs_data @@ -153,7 +200,7 @@ def test_02_rcs_plotter_properties(self): assert isinstance(rcs_plotter.radius, float) def test_03_rcs_plotter_rcs(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) rcs_plotter1 = rcs_plotter.plot_rcs( @@ -180,14 +227,14 @@ def test_03_rcs_plotter_rcs(self): assert isinstance(rcs_plotter7, ReportPlotter) def test_04_rcs_plotter_range_profile(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) rcs_plotter = rcs_plotter.plot_range_profile(show=False) assert isinstance(rcs_plotter, ReportPlotter) def test_05_rcs_plotter_waterfall(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) rcs_plotter1 = rcs_plotter.plot_waterfall(show=False) @@ -197,14 +244,14 @@ def test_05_rcs_plotter_waterfall(self): assert isinstance(rcs_plotter2, ReportPlotter) def test_06_rcs_plotter_2d_isar(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) rcs_plotter1 = rcs_plotter.plot_isar_2d(show=False) assert isinstance(rcs_plotter1, ReportPlotter) def test_07_rcs_plotter_add_rcs(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) rcs_plotter.add_rcs() @@ -216,7 +263,7 @@ def test_07_rcs_plotter_add_rcs(self): assert rcs_plotter.clear_scene() def test_08_rcs_plotter_add_profile_settings(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) rcs_plotter.add_range_profile_settings() @@ -225,7 +272,7 @@ def test_08_rcs_plotter_add_profile_settings(self): assert rcs_plotter.clear_scene() def test_09_rcs_plotter_add_waterfall_settings(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) rcs_plotter.add_waterfall_settings() @@ -234,7 +281,7 @@ def test_09_rcs_plotter_add_waterfall_settings(self): assert rcs_plotter.clear_scene() def test_10_rcs_plotter_add_isar_2d_settings(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) rcs_plotter.add_isar_2d_settings() @@ -243,7 +290,7 @@ def test_10_rcs_plotter_add_isar_2d_settings(self): assert rcs_plotter.clear_scene() def test_11_rcs_plotter_add_range_profile(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) rcs_plotter.add_range_profile() @@ -252,10 +299,35 @@ def test_11_rcs_plotter_add_range_profile(self): assert rcs_plotter.clear_scene() def test_12_rcs_plotter_add_waterfall(self): - rcs_data = MonostaticRCSData(input_file=self.metadata_file) + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) rcs_plotter.add_waterfall() plot = rcs_plotter.plot_scene(show=False) assert isinstance(plot, Plotter) assert rcs_plotter.clear_scene() + + def test_13_rcs_plotter_add_isar_2d(self): + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file)) + rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) + rcs_plotter.show_geometry = False + + rcs_plotter.add_isar_2d() + plot = rcs_plotter.plot_scene(show=False) + assert isinstance(plot, Plotter) + assert rcs_plotter.clear_scene() + + rcs_plotter.add_isar_2d("Relief") + plot = rcs_plotter.plot_scene(show=False) + assert isinstance(plot, Plotter) + assert rcs_plotter.clear_scene() + + def test_14_rcs_plotter_no_data(self): + rcs_data = MonostaticRCSData(input_file=str(self.metadata_file_no_data)) + rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_data) + rcs_plotter.show_geometry = False + + rcs_plotter.add_range_profile_settings() + plot = rcs_plotter.plot_scene(show=False) + assert isinstance(plot, Plotter) + assert rcs_plotter.clear_scene() diff --git a/tests/system/general/test_98_Icepak.py b/tests/system/general/test_98_Icepak.py index 54848cda534..42627a02ca9 100644 --- a/tests/system/general/test_98_Icepak.py +++ b/tests/system/general/test_98_Icepak.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -318,6 +318,11 @@ def test_03_AssignPCBRegion(self): assert self.aedtapp.mesh.meshregions_dict assert pcb_mesh_region.delete() + def test_07_ExportStepForWB(self): + file_path = self.local_scratch.path + file_name = "WBStepModel" + assert self.aedtapp.export_3d_model(file_name, file_path, ".x_t", [], ["Region", "Component_Region"]) + def test_04_ImportGroup(self): assert self.aedtapp.copyGroupFrom("Group1", "uUSB", src_project_name, self.project_path) @@ -376,11 +381,6 @@ def test_05_EMLoss(self): def test_06_clear_linked_data(self): assert self.aedtapp.clear_linked_data() - def test_07_ExportStepForWB(self): - file_path = self.local_scratch.path - file_name = "WBStepModel" - assert self.aedtapp.export_3d_model(file_name, file_path, ".x_t", [], ["Region", "Component_Region"]) - def test_08_Setup(self): setup_name = "DomSetup" my_setup = self.aedtapp.create_setup(setup_name) @@ -2013,3 +2013,13 @@ def test_82_folder_settings(self, add_app): fs.scale_settings.unit = "kel" assert fs.scale_settings.unit == "kel" app.close_project() + + def test_83_MultipleMeshRegions(self): + # test issue 5485 + self.aedtapp.insert_design("test83") + c1 = self.aedtapp.modeler.create_cylinder(orientation=0, origin=[0, 0, 0], radius=5, height=10) + c2 = self.aedtapp.modeler.create_cylinder(orientation=1, origin=[100, 100, 100], radius=2, height=15) + mesh_class = self.aedtapp.mesh + m1 = mesh_class.assign_mesh_region([c1.name]) + m2 = mesh_class.assign_mesh_region([c2.name]) + assert m1.assignment.name != m2.assignment.name diff --git a/tests/system/general/test_launch_desktop.py b/tests/system/general/test_launch_desktop.py index 12894b436b1..0a2fa78fd58 100644 --- a/tests/system/general/test_launch_desktop.py +++ b/tests/system/general/test_launch_desktop.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/general/test_utils.py b/tests/system/general/test_utils.py index 46d74604fa9..24a4a451ad1 100644 --- a/tests/system/general/test_utils.py +++ b/tests/system/general/test_utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/solvers/__init__.py b/tests/system/solvers/__init__.py index 9c4476773da..b78d8fed76c 100644 --- a/tests/system/solvers/__init__.py +++ b/tests/system/solvers/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/solvers/conftest.py b/tests/system/solvers/conftest.py index 17e04079bc5..0441921f808 100644 --- a/tests/system/solvers/conftest.py +++ b/tests/system/solvers/conftest.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/solvers/test_00_analyze.py b/tests/system/solvers/test_00_analyze.py index 58ac97c911b..bfdd63ac9ee 100644 --- a/tests/system/solvers/test_00_analyze.py +++ b/tests/system/solvers/test_00_analyze.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/solvers/test_01_pdf.py b/tests/system/solvers/test_01_pdf.py index c6afef2f25f..96a06e7cd48 100644 --- a/tests/system/solvers/test_01_pdf.py +++ b/tests/system/solvers/test_01_pdf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/solvers/test_26_emit.py b/tests/system/solvers/test_26_emit.py index a63ebd112bd..54e0baca9d2 100644 --- a/tests/system/solvers/test_26_emit.py +++ b/tests/system/solvers/test_26_emit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/solvers/test_31_Q3D.py b/tests/system/solvers/test_31_Q3D.py index e3e797308e5..ff09719b5f2 100644 --- a/tests/system/solvers/test_31_Q3D.py +++ b/tests/system/solvers/test_31_Q3D.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/system/solvers/test_45_workflows.py b/tests/system/solvers/test_45_workflows.py index 58f75584fdd..a04d3757256 100644 --- a/tests/system/solvers/test_45_workflows.py +++ b/tests/system/solvers/test_45_workflows.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index 3907083f623..65bb3bf87f3 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index f172d934ac1..3f4fd0841a1 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -25,15 +25,16 @@ from unittest.mock import MagicMock from unittest.mock import patch +from ansys.aedt.core.generic.settings import settings +from ansys.aedt.core.maxwell import Maxwell3d import pytest +settings.enable_error_handler = False + @pytest.fixture def maxwell_3d_setup(): - """Fixture used to setup a Maxwell3d instance.""" - with patch("ansys.aedt.core.maxwell.FieldAnalysis3D") as mock_fiel_analysis_3d, patch( - "ansys.aedt.core.maxwell.Maxwell" - ) as mock_maxwell: - mock_fiel_analysis_3d.return_value = MagicMock() - mock_maxwell.return_value = MagicMock() - yield {"FieldAnalysis3D": mock_fiel_analysis_3d, "Maxwell": mock_maxwell} + """Fixture used to mock the creation of a Maxwell instance.""" + with patch("ansys.aedt.core.maxwell.Maxwell3d.__init__", lambda x: None): + mock_instance = MagicMock(spec=Maxwell3d) + yield mock_instance diff --git a/tests/unit/test_aedt_versions.py b/tests/unit/test_aedt_versions.py index 7ec295331bf..ce91e869376 100644 --- a/tests/unit/test_aedt_versions.py +++ b/tests/unit/test_aedt_versions.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/test_clr_module.py b/tests/unit/test_clr_module.py index 740bd22e877..0e613fe78e2 100644 --- a/tests/unit/test_clr_module.py +++ b/tests/unit/test_clr_module.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/test_desktop.py b/tests/unit/test_desktop.py index 5d8a0660aef..fbf62c923b5 100644 --- a/tests/unit/test_desktop.py +++ b/tests/unit/test_desktop.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/test_extension_misc.py b/tests/unit/test_extension_misc.py index 9e8a4c89b6f..8867d7d7fd4 100644 --- a/tests/unit/test_extension_misc.py +++ b/tests/unit/test_extension_misc.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/test_generic_filesystem.py b/tests/unit/test_generic_filesystem.py index b2dc74364c1..8b5b1c91cbf 100644 --- a/tests/unit/test_generic_filesystem.py +++ b/tests/unit/test_generic_filesystem.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/test_hdm_parser.py b/tests/unit/test_hdm_parser.py index 13811987310..9d6dc6469da 100644 --- a/tests/unit/test_hdm_parser.py +++ b/tests/unit/test_hdm_parser.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/test_maxwell_3d.py b/tests/unit/test_maxwell_3d.py index d731e088aae..dbd014dba77 100644 --- a/tests/unit/test_maxwell_3d.py +++ b/tests/unit/test_maxwell_3d.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/test_monostatic_rcs_data.py b/tests/unit/test_monostatic_rcs_data.py index ac396343b1b..c519a4f0b0b 100644 --- a/tests/unit/test_monostatic_rcs_data.py +++ b/tests/unit/test_monostatic_rcs_data.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/test_monostatic_rcs_exporter.py b/tests/unit/test_monostatic_rcs_exporter.py index 085a4205393..01dfd670633 100644 --- a/tests/unit/test_monostatic_rcs_exporter.py +++ b/tests/unit/test_monostatic_rcs_exporter.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/test_primitives_nexxim.py b/tests/unit/test_primitives_nexxim.py new file mode 100644 index 00000000000..830c53ed349 --- /dev/null +++ b/tests/unit/test_primitives_nexxim.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from pathlib import Path +from unittest.mock import MagicMock +from unittest.mock import patch +import warnings + +from ansys.aedt.core.modeler.circuits.primitives_nexxim import NexximComponents +import pytest + + +def test_add_siwave_dynamic_link_failure_with_file_not_found(): + file = Path("dummy") + modeler = MagicMock() + nexxim = NexximComponents(modeler) + + with pytest.raises(FileNotFoundError): + nexxim.add_siwave_dynamic_link(file) + + +@patch.object(warnings, "warn") +def test_add_subcircuit_link_warning_call(mock_warn): + file = Path("dummy") + modeler = MagicMock() + nexxim = NexximComponents(modeler) + + nexxim._add_subcircuit_link("dummy_comp", ["dummy_pin"], file, "dummy_source_design", image_subcircuit_path=file) + + mock_warn.assert_any_call("Image extension is not valid. Use default image instead.") diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 49bc5638e03..7e29982b83f 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/tests/unit/test_warnings.py b/tests/unit/test_warnings.py index 078af6ce367..ee2b487bf19 100644 --- a/tests/unit/test_warnings.py +++ b/tests/unit/test_warnings.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -62,7 +62,7 @@ def test_deprecation_warning_with_valid_python_version(mock_warn, monkeypatch): def test_alias_deprecation_warning(): - """Test that pyaedt alias warning is triggered.""" + """Test that pyaedt alias warning is triggered.""" import importlib import pyaedt