Skip to content

FEAT: Perceive EM class #6259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 70 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
d1e173f
First perceive em try
Samuelopez-ansys Jun 6, 2025
7e5b96e
Add material manager
Samuelopez-ansys Jun 10, 2025
da5b6a3
Add IT Material
Samuelopez-ansys Jun 10, 2025
cefbbcf
Merge branch 'main' into feat/perceive_em
Samuelopez-ansys Jun 10, 2025
9c4e254
Add Material test
Samuelopez-ansys Jun 10, 2025
1b21bfa
Load mesh
Samuelopez-ansys Jun 11, 2025
1023644
Add bird
Samuelopez-ansys Jun 12, 2025
4dde163
Add get item
Samuelopez-ansys Jun 13, 2025
e34a161
Revert _app
Samuelopez-ansys Jun 13, 2025
8dca5ca
Revert _app
Samuelopez-ansys Jun 13, 2025
ed4047b
Revert _app
Samuelopez-ansys Jun 13, 2025
7fccff9
Revert _app
Samuelopez-ansys Jun 13, 2025
28d784f
Revert _app
Samuelopez-ansys Jun 13, 2025
f8ba921
Revert _app
Samuelopez-ansys Jun 13, 2025
407b362
Revert _app
Samuelopez-ansys Jun 13, 2025
fddd75b
Revert _app
Samuelopez-ansys Jun 13, 2025
e209a30
Revert _app
Samuelopez-ansys Jun 13, 2025
e11f7d8
Revert _app
Samuelopez-ansys Jun 13, 2025
ab06e4a
Revert _app
Samuelopez-ansys Jun 13, 2025
37ad17c
Revert _app
Samuelopez-ansys Jun 13, 2025
ef816c4
Revert _app
Samuelopez-ansys Jun 13, 2025
67d3402
Revert _app
Samuelopez-ansys Jun 13, 2025
03f3ecc
Revert _app
Samuelopez-ansys Jun 13, 2025
e6829df
Revert _app
Samuelopez-ansys Jun 13, 2025
234ca65
Revert _app
Samuelopez-ansys Jun 13, 2025
65c83d2
Revert _app
Samuelopez-ansys Jun 13, 2025
d8957a1
Revert _app
Samuelopez-ansys Jun 13, 2025
43246aa
Revert _app
Samuelopez-ansys Jun 13, 2025
0a60b1a
Revert _app
Samuelopez-ansys Jun 13, 2025
544e412
Revert _app
Samuelopez-ansys Jun 13, 2025
7c7f52f
chore: adding changelog file 6259.added.md [dependabot-skip]
pyansys-ci-bot Jun 13, 2025
1ef55a7
Fix bird
Samuelopez-ansys Jun 13, 2025
7750192
Merge branch 'main' into feat/perceive_em
Samuelopez-ansys Jun 13, 2025
2370490
Update bird
Samuelopez-ansys Jun 13, 2025
0acab96
Add FRTM post processing
Samuelopez-ansys Jun 13, 2025
9fa705e
Add docstring
Samuelopez-ansys Jun 13, 2025
c6a2ad8
API call transparent
Samuelopez-ansys Jun 14, 2025
6d84ab8
API call transparent
Samuelopez-ansys Jun 14, 2025
ad1f67f
API call transparent
Samuelopez-ansys Jun 14, 2025
57b4597
Antenna device
Samuelopez-ansys Jun 15, 2025
c826736
Antenna device
Samuelopez-ansys Jun 15, 2025
1592e3d
Is receiver
Samuelopez-ansys Jun 15, 2025
64ca3d7
Merge branch 'main' into feat/perceive_em
Samuelopez-ansys Jun 15, 2025
7b33e60
Is receiver
Samuelopez-ansys Jun 15, 2025
2313d27
Waveform
Samuelopez-ansys Jun 16, 2025
99e7f8b
Add antenna
Samuelopez-ansys Jun 16, 2025
bfadf81
Add antenna
Samuelopez-ansys Jun 16, 2025
e729b94
Merge branch 'main' into feat/perceive_em
Samuelopez-ansys Jun 16, 2025
bf72e50
Add antenna
Samuelopez-ansys Jun 17, 2025
87eb78a
Add simulation
Samuelopez-ansys Jun 19, 2025
8aa29f5
Add simulation
Samuelopez-ansys Jun 19, 2025
68947b5
Add exception message
Samuelopez-ansys Jun 19, 2025
6e1c836
Merge branch 'main' into feat/perceive_em
Samuelopez-ansys Jun 19, 2025
26cba63
Fix dataclass
Samuelopez-ansys Jun 19, 2025
8c7e105
Merge branch 'main' into feat/perceive_em
Samuelopez-ansys Jun 23, 2025
ed0711a
Get settings
Samuelopez-ansys Jun 23, 2025
d3da102
Merge branch 'main' into feat/perceive_em
Samuelopez-ansys Jun 23, 2025
29e46a2
API interface
Samuelopez-ansys Jun 23, 2025
cf5c503
Fix materials codacy
Samuelopez-ansys Jun 23, 2025
806d039
Fix aedt_version codacy
Samuelopez-ansys Jun 23, 2025
2271067
Scene root
Samuelopez-ansys Jun 23, 2025
0e48054
Antenna platform
Samuelopez-ansys Jun 23, 2025
16cf252
Antenna
Samuelopez-ansys Jun 23, 2025
394b355
Mode
Samuelopez-ansys Jun 23, 2025
c4d257f
Mode
Samuelopez-ansys Jun 23, 2025
7358975
Simulation
Samuelopez-ansys Jun 23, 2025
59dbdcd
Simulation
Samuelopez-ansys Jun 23, 2025
791c70a
Waveform codacy
Samuelopez-ansys Jun 23, 2025
c454b39
Fix codacy
Samuelopez-ansys Jun 23, 2025
e50535e
Merge branch 'main' into feat/perceive_em
Samuelopez-ansys Jun 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/6259.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Perceive em class
4 changes: 4 additions & 0 deletions doc/source/Resources/pyaedt_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,7 @@ general:
block_figure_plot: false
# Skip license check during Desktop initialization
skip_license_check: true

perceive_em:
# Perceive EM API
perceive_em_api_path: null
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ examples = [
"plotly>=6.0,<6.2",
"scikit-rf>=0.30.0,<1.8",
]

perceive_em = [
"matplotlib>=3.5.0,<3.11",
"numpy==1.26.4",
"imageio-ffmpeg"
]
[tool.setuptools.dynamic]
version = {attr = "ansys.aedt.core.__version__"}

Expand Down
26 changes: 26 additions & 0 deletions src/ansys/aedt/core/generic/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
"remote_rpc_session_temp_folder",
"block_figure_plot",
"skip_license_check",
"perceive_em_api_path",
"perceive_em_license_client_path",
]
ALLOWED_AEDT_ENV_VAR_SETTINGS = [
"ANSYSEM_FEATURE_F335896_MECHANICAL_STRUCTURAL_SOLN_TYPE_ENABLE",
Expand All @@ -116,6 +118,7 @@
"ANS_MESHER_PROC_DUMP_PREPOST_BEND_SM3",
"ANS_NODEPCHECK",
]
ALLOWED_PERCEIVEEM_SETTINGS = ["perceive_em_api_path", "licensingclient_path"]


def generate_log_filename():
Expand Down Expand Up @@ -214,6 +217,9 @@
self.__time_tick = time.time()
self.__pyaedt_server_path = ""
self.__block_figure_plot = False
# Perceive EM settings
self.__perceive_em_api_path = None
self.__perceive_em_license_client_path = None

# Load local settings if YAML configuration file exists.
pyaedt_settings_path = os.environ.get("PYAEDT_LOCAL_SETTINGS_PATH", "")
Expand Down Expand Up @@ -785,6 +791,26 @@
def skip_license_check(self, value):
self.__skip_license_check = value

# ##################################### Perceive EM properties ####################################

@property
def perceive_em_api_path(self):
"""Perceive EM API path."""
return self.__perceive_em_api_path

@perceive_em_api_path.setter
def perceive_em_api_path(self, value: str):
self.__perceive_em_api_path = value

Check warning on line 803 in src/ansys/aedt/core/generic/settings.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/generic/settings.py#L803

Added line #L803 was not covered by tests

@property
def perceive_em_license_client_path(self):
"""Perceive EM license client path."""
return self.__perceive_em_license_client_path

@perceive_em_license_client_path.setter
def perceive_em_license_client_path(self, value: str):
self.__perceive_em_license_client_path = value

Check warning on line 812 in src/ansys/aedt/core/generic/settings.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/generic/settings.py#L812

Added line #L812 was not covered by tests

def load_yaml_configuration(self, path: str, raise_on_wrong_key: bool = False):
"""Update default settings from a YAML configuration file."""
import yaml
Expand Down
78 changes: 78 additions & 0 deletions src/ansys/aedt/core/internal/aedt_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
self._current_student_version = None
self._latest_version = None

# Perceive EM
self._list_installed_perceive_em = None
self._installed_perceive_em_versions = None
self._stable_perceive_em_versions = None
self._current_perceive_em_version = None
self._latest_perceive_em_version = None

@property
def list_installed_ansysem(self):
"""Return a list of installed AEDT versions on ``ANSYSEM_ROOT``.
Expand All @@ -69,6 +76,23 @@
self._list_installed_ansysem = version_list
return self._list_installed_ansysem

@property
def list_installed_perceive_em(self):
"""Return a list of installed Perceive EM versions on ``ANSYSEM_PERCEIVE_EM_ROOT``.

The list is ordered: first normal versions, then client versions, finally student versions."""
if self._list_installed_perceive_em is None:
perceive_em_env_var_prefix = "ANSYSEM_PERCEIVE_EM_ROOT"
version_list = sorted([x for x in os.environ if x.startswith(perceive_em_env_var_prefix)], reverse=True)

Check warning on line 86 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L84-L86

Added lines #L84 - L86 were not covered by tests

if not version_list:
warnings.warn(

Check warning on line 89 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L88-L89

Added lines #L88 - L89 were not covered by tests
"No installed versions of Perceive EM are found in the system environment variables"
" ``ANSYSEM_PERCEIVE_EM_ROOTxxx``."
)
self._list_installed_perceive_em = version_list
return self._list_installed_perceive_em

Check warning on line 94 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L93-L94

Added lines #L93 - L94 were not covered by tests

@property
def installed_versions(self):
"""Get the installed AEDT versions.
Expand Down Expand Up @@ -113,6 +137,28 @@
self._installed_versions = return_dict
return self._installed_versions

@property
def installed_perceive_em_versions(self):
"""Get the installed Perceive EM versions.

This method returns a dictionary, with the version as the key and installation path
as the value."""
if self._installed_perceive_em_versions is None:
return_dict = {}

Check warning on line 147 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L146-L147

Added lines #L146 - L147 were not covered by tests
# version_list is ordered: first normal versions, then client versions, finally student versions
version_list = self.list_installed_perceive_em
for version_env_var in version_list:
try:
version = int(version_env_var[-3:-1])
release = int(version_env_var[-1])
v_key = f"20{version}.{release}"
return_dict[v_key] = os.environ[version_env_var]

Check warning on line 155 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L149-L155

Added lines #L149 - L155 were not covered by tests
except Exception: # pragma: no cover
if settings.logger:
settings.logger.debug(f"Failed to parse version and release from {version_env_var}")
self._installed_perceive_em_versions = return_dict
return self._installed_perceive_em_versions

Check warning on line 160 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L159-L160

Added lines #L159 - L160 were not covered by tests

@property
def stable_versions(self):
"""Get all stable versions installed on the system"""
Expand All @@ -125,6 +171,18 @@
self._stable_versions = []
return self._stable_versions

@property
def stable_perceive_em_versions(self):
"""Get all stable versions installed on the system"""
if self._stable_perceive_em_versions is None:
try:
self._stable_perceive_em_versions = [

Check warning on line 179 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L177-L179

Added lines #L177 - L179 were not covered by tests
v for v in self.installed_perceive_em_versions if v <= str(CURRENT_STABLE_AEDT_VERSION)
]
except (NameError, IndexError, ValueError):
self._stable_perceive_em_versions = []
return self._stable_perceive_em_versions

Check warning on line 184 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L182-L184

Added lines #L182 - L184 were not covered by tests

@property
def current_version(self):
"""Get the most recent stable AEDT version."""
Expand All @@ -135,6 +193,16 @@
self._current_version = ""
return self._current_version

@property
def current_perceive_em_version(self):
"""Get the most recent stable Perceive EM version."""
if self._current_perceive_em_version is None:
if self.stable_perceive_em_versions:
self._current_perceive_em_version = self.stable_versions[0]

Check warning on line 201 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L199-L201

Added lines #L199 - L201 were not covered by tests
else:
self._current_perceive_em_version = ""
return self._current_perceive_em_version

Check warning on line 204 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L203-L204

Added lines #L203 - L204 were not covered by tests

@property
def current_student_version(self):
"""Get the current stable AEDT student version."""
Expand All @@ -156,6 +224,16 @@
self._latest_version = ""
return self._latest_version

@property
def latest_perceive_em_version(self):
"""Get the latest AEDT version, even if it is pre-release."""
if self._latest_perceive_em_version is None:
try:
self._latest_perceive_em_version = list(self.installed_perceive_em_versions.keys())[0]
except (NameError, IndexError):
self._latest_perceive_em_version = ""
return self._latest_perceive_em_version

Check warning on line 235 in src/ansys/aedt/core/internal/aedt_versions.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/internal/aedt_versions.py#L230-L235

Added lines #L230 - L235 were not covered by tests

@staticmethod
def get_version_env_variable(version_id):
"""Get the environment variable for the AEDT version.
Expand Down
29 changes: 29 additions & 0 deletions src/ansys/aedt/core/perceive_em/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ruff: noqa: E402

# -*- 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

Check warning on line 27 in src/ansys/aedt/core/perceive_em/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/perceive_em/__init__.py#L27

Added line #L27 was not covered by tests

MISC_PATH = Path(__file__).parent / "misc"

Check warning on line 29 in src/ansys/aedt/core/perceive_em/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/perceive_em/__init__.py#L29

Added line #L29 was not covered by tests
25 changes: 25 additions & 0 deletions src/ansys/aedt/core/perceive_em/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ruff: noqa: E402

# -*- 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.
Loading