Skip to content

Commit

Permalink
Merge branch 'main' into component_definitio
Browse files Browse the repository at this point in the history
  • Loading branch information
gkorompi authored Jan 12, 2025
2 parents 941583b + a5cbc5e commit 2a275f0
Show file tree
Hide file tree
Showing 304 changed files with 1,208 additions and 922 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 7 additions & 7 deletions doc/source/Getting_started/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand Down Expand Up @@ -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::
Expand All @@ -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
Expand All @@ -141,7 +141,7 @@ From the `Releases <https://github.com/ansys/pyaedt/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`.

Expand All @@ -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:///<path_to_wheelhouse>/PyAEDT-v<release_version>-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::
Expand Down
22 changes: 18 additions & 4 deletions doc/source/Resources/pyaedt_installer_from_aedt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/aedt_logger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/aedt_file_management.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
15 changes: 14 additions & 1 deletion src/ansys/aedt/core/application/aedt_objects.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/ansys/aedt/core/application/analysis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/ansys/aedt/core/application/analysis_3d.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/analysis_3d_layout.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/analysis_hf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/analysis_icepak.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/application/analysis_maxwell_circuit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/analysis_nexxim.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/analysis_r_m_xprt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
6 changes: 2 additions & 4 deletions src/ansys/aedt/core/application/analysis_twin_builder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/ansys/aedt/core/application/design.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down Expand Up @@ -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`]
Expand Down Expand Up @@ -1026,7 +1025,6 @@ def temp_directory(self) -> str:
def toolkit_directory(self) -> str:
"""Path to the toolkit directory.
Returns
-------
str
Expand Down
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/application/design_solutions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/job_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/variables.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
7 changes: 5 additions & 2 deletions src/ansys/aedt/core/circuit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 2a275f0

Please sign in to comment.