Skip to content
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

FEAT: RCS class #5405

Open
wants to merge 111 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
338f4eb
Unite option
Samuelopez-ansys Aug 16, 2024
3a365d9
Monostatic RCS class
Samuelopez-ansys Aug 16, 2024
2954d3a
Input file
Samuelopez-ansys Aug 19, 2024
7668be6
RCS Data class
Samuelopez-ansys Aug 19, 2024
53335e2
Compatibility with HDF5 format
Samuelopez-ansys Aug 19, 2024
2829e94
Merge main
Samuelopez-ansys Aug 19, 2024
74a7c64
Add RCS class
Samuelopez-ansys Aug 19, 2024
940446d
Plot RCS
Samuelopez-ansys Aug 19, 2024
1cef02d
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 2, 2024
2617600
Merge main into branch
Samuelopez-ansys Oct 2, 2024
9c581ce
Fix RCS class
Samuelopez-ansys Oct 2, 2024
a50446c
Fix return
Samuelopez-ansys Oct 3, 2024
00f510b
Update SBR settings
Samuelopez-ansys Oct 4, 2024
e7ef981
Save RCS data
Samuelopez-ansys Oct 4, 2024
1da016f
Add data file
Samuelopez-ansys Oct 7, 2024
909fb84
Export RCS
Samuelopez-ansys Oct 7, 2024
0e943ee
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 8, 2024
523e32e
Save RCS data
Samuelopez-ansys Oct 8, 2024
7bb8c61
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 8, 2024
70e9e55
Range profile
Samuelopez-ansys Oct 9, 2024
cee39e8
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 9, 2024
d4f4633
Create SceneMeshObject
Samuelopez-ansys Oct 11, 2024
4908a5a
Create SceneMeshObject
Samuelopez-ansys Oct 11, 2024
f487185
Add custom methods in SceneMeshObject
Samuelopez-ansys Oct 11, 2024
a32824a
Add custom methods in SceneMeshObject
Samuelopez-ansys Oct 11, 2024
59c1fba
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 14, 2024
af6e9e4
Move properties
Samuelopez-ansys Oct 14, 2024
ce8c053
Add 3D RCS
Samuelopez-ansys Oct 14, 2024
ce90d54
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 14, 2024
cd7ebb9
Fix plot RCS
Samuelopez-ansys Oct 15, 2024
8410e43
Fix plot RCS 3D
Samuelopez-ansys Oct 15, 2024
ab836b0
Fix plot RCS 3D
Samuelopez-ansys Oct 15, 2024
828ec34
Fix dataframe managment
Samuelopez-ansys Oct 18, 2024
8b008c5
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 18, 2024
17718fb
Fix plot RCS 3D
Samuelopez-ansys Oct 21, 2024
acd4beb
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 21, 2024
36c59d8
Fix plot Range profile 3D
Samuelopez-ansys Oct 21, 2024
d13f0bc
Fix plot waterfall
Samuelopez-ansys Oct 21, 2024
e495812
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 21, 2024
482195f
Fix plot waterfall
Samuelopez-ansys Oct 21, 2024
a04d88e
Add ISAR 2D
Samuelopez-ansys Oct 22, 2024
1362dfe
ISAR 2D
Samuelopez-ansys Oct 22, 2024
65c073c
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 22, 2024
5316c19
ISAR 2D
Samuelopez-ansys Oct 22, 2024
83ff7d2
ISAR 2D
Samuelopez-ansys Oct 22, 2024
5173344
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 22, 2024
32d9511
ISAR 2D
Samuelopez-ansys Oct 22, 2024
7cb9cd7
Remove scaling of raw data before computing images
scanta2 Oct 22, 2024
3ca3f3e
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 23, 2024
6bda7a6
ISAR 2D no conversion
Samuelopez-ansys Oct 23, 2024
b1b2b30
Fix range profile
Samuelopez-ansys Oct 23, 2024
e3264e5
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 23, 2024
54b0078
Remove custom plotter
Samuelopez-ansys Oct 24, 2024
ed5b1f5
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 24, 2024
fc190a3
Geometry ModelPlotter
Samuelopez-ansys Oct 24, 2024
aef4479
Add solution name
Samuelopez-ansys Oct 25, 2024
efe373b
Fix set scale
Samuelopez-ansys Oct 29, 2024
6eab276
Fix polar
Samuelopez-ansys Oct 29, 2024
30cf454
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Oct 30, 2024
239b819
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Nov 4, 2024
9bc422b
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Nov 4, 2024
28acceb
RCS Test
Samuelopez-ansys Nov 4, 2024
f0b03e0
Add RCS export test
Samuelopez-ansys Nov 4, 2024
81e543e
Add RCS export test
Samuelopez-ansys Nov 4, 2024
293f568
Add RCS export test
Samuelopez-ansys Nov 4, 2024
ffb5d1f
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Nov 8, 2024
f42bbe9
RCS Data tests
Samuelopez-ansys Nov 11, 2024
0d16a91
Add unit test
Samuelopez-ansys Nov 11, 2024
1b8690e
Add documentation
Samuelopez-ansys Nov 11, 2024
dbc2cb2
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Nov 11, 2024
572e7fe
Fix vale
Samuelopez-ansys Nov 12, 2024
8327357
If Python version lower than 3.10, ansys_visualization_interface does…
Samuelopez-ansys Nov 12, 2024
9e8feeb
Improve codacy
Samuelopez-ansys Nov 12, 2024
dc825ff
Add pyansys visualization to tests dependencies
Samuelopez-ansys Nov 12, 2024
e494460
Remove API reference until is not merge in main
Samuelopez-ansys Nov 12, 2024
bb7b85b
Fix f-string and Path
Samuelopez-ansys Nov 12, 2024
ebeae5a
Update doc/source/API/visualization/advanced.rst
Samuelopez-ansys Nov 12, 2024
fffd253
Update doc/source/API/visualization/advanced.rst
Samuelopez-ansys Nov 12, 2024
fd0ed95
Update src/ansys/aedt/core/application/analysis.py
Samuelopez-ansys Nov 12, 2024
9622b68
Update src/ansys/aedt/core/hfss.py
Samuelopez-ansys Nov 12, 2024
26e1dd4
update suggestions
Samuelopez-ansys Nov 12, 2024
19ade2b
Update src/ansys/aedt/core/visualization/advanced/rcs_visualization.py
Samuelopez-ansys Nov 12, 2024
a641f70
Merge remote-tracking branch 'origin/feat/rcs_class' into feat/rcs_class
Samuelopez-ansys Nov 12, 2024
f6f74cf
Change to Path
Samuelopez-ansys Nov 12, 2024
141c7f9
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Nov 12, 2024
7762e63
REFACTOR: Imports in rcs visualization
SMoraisAnsys Nov 14, 2024
60b5c30
REFACTOR: Use Path open
SMoraisAnsys Nov 14, 2024
c590a57
REFACTOR: Use private value instead of property
SMoraisAnsys Nov 14, 2024
b8e1cdf
FIX: Call to logger
SMoraisAnsys Nov 14, 2024
b0166eb
FIX: Check on file extension
SMoraisAnsys Nov 14, 2024
02e4354
REFACTOR: Use RuntimeError instead of Exception
SMoraisAnsys Nov 14, 2024
fb2124f
REFACTOR: Use FileNotFoundError instead of Exception
SMoraisAnsys Nov 14, 2024
e50bcaa
REFACTOR: Remove unused private attributes
SMoraisAnsys Nov 14, 2024
4bdee31
TESTS: Add unit test
SMoraisAnsys Nov 14, 2024
ce47163
TESTS: Add integration tests
SMoraisAnsys Nov 14, 2024
9808548
CHORE: Auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 14, 2024
96880a8
CHORE: Add integration testing
SMoraisAnsys Nov 14, 2024
2c36104
FIX: Logger call in MonostaticRCSPlotter
SMoraisAnsys Nov 14, 2024
45dfdaa
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Nov 15, 2024
589708c
Modify typo
Samuelopez-ansys Nov 15, 2024
1cbd221
Add doc
Samuelopez-ansys Nov 15, 2024
0738edc
Fix codacy
Samuelopez-ansys Nov 15, 2024
e1565a9
Add obj files
Samuelopez-ansys Nov 15, 2024
1dc61ec
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Nov 15, 2024
d551472
Fix Linux
Samuelopez-ansys Nov 18, 2024
f7c1855
Modify export_as_multiple_objects
Samuelopez-ansys Nov 18, 2024
528918f
Remove replace
Samuelopez-ansys Nov 18, 2024
e833a58
Merge branch 'main' into feat/rcs_class
Samuelopez-ansys Nov 19, 2024
1309577
Change pickles to HDF5
Samuelopez-ansys Nov 19, 2024
7ddbcf0
Reduce example file size
Samuelopez-ansys Nov 19, 2024
3e27fbc
Reduce unused variable
Samuelopez-ansys Nov 19, 2024
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
38 changes: 33 additions & 5 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Run unit tests
uses: ansys/actions/tests-pytest@v8
with:
pytest-markers: -m unit
pytest-postargs: 'tests/unit'
pytest-extra-args: ${{ env.PYTEST_ARGUMENTS }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
optional-dependencies-name: unit-tests
Expand All @@ -108,13 +108,41 @@ jobs:
path: junit/test-results.xml
if: ${{ always() }}

integration-tests:
name: Running integration tests
needs: [unit-tests]
runs-on: ubuntu-latest
steps:
- name: Run integration tests
uses: ansys/actions/tests-pytest@v8
with:
pytest-postargs: 'tests/integration'
pytest-extra-args: ${{ env.PYTEST_ARGUMENTS }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
optional-dependencies-name: integration-tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-integration-tests
file: ./coverage.xml
flags: linux_integration

- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-integration
path: junit/test-results.xml
if: ${{ always() }}

# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================

system-tests-solvers-windows:
name: Testing solvers and coverage (Windows)
needs: [unit-tests]
needs: [integration-tests]
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
Expand Down Expand Up @@ -173,7 +201,7 @@ jobs:

system-tests-solvers-linux:
name: Testing solvers and coverage (Linux)
needs: [unit-tests]
needs: [integration-tests]
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, Linux, pyaedt ]
env:
Expand Down Expand Up @@ -229,7 +257,7 @@ jobs:

system-tests-general-windows:
name: Testing and coverage (Windows)
needs: [unit-tests]
needs: [integration-tests]
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
Expand Down Expand Up @@ -294,7 +322,7 @@ jobs:
system-tests-general-linux:
name: Testing and coverage (Linux)
if: github.event.pull_request.draft == false
needs: [unit-tests]
needs: [integration-tests]
runs-on: [ self-hosted, Linux, pyaedt ]
env:
ANSYSEM_ROOT242: '/opt/AnsysEM/v242/Linux64'
Expand Down
52 changes: 52 additions & 0 deletions doc/source/API/visualization/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,58 @@ If you have existing farfield data, or you want to export it manually, you can s
:alt: Farfield data with AEDT


Monostatic RCS
~~~~~~~~~~~~~~

PyAEDT offers sophisticated tools for advanced monostatic radar cross section (RCS) post-processing.
There are three complementary classes: ``MonostaticRCSExporter``, ``MonostaticRCSData``, and ``MonostaticRCSPlotter``.

- MonostaticRCSExporter: Enables efficient export and manipulation of RCS data. It allows users to convert simulation results into a standard metadata format for further analysis, or reporting.

- MonostaticRCSData: Focuses on the direct access and processing of RCS solution data. It supports a comprehensive set of postprocessing operations, from visualizing radiation patterns to computing key performance metrics.

- MonostaticRCSPlotter: Focuses on the post-processing of RCS solution data.


.. currentmodule:: ansys.aedt.core.visualization.advanced.rcs_visualization

.. autosummary::
:toctree: _autosummary
:nosignatures:

MonostaticRCSData
MonostaticRCSPlotter


This code shows how you can get the RCS data and perform some post-processing:

.. code:: python

from ansys.aedt.core import Hfss
from ansys.aedt.core.visualization.advanced.rcs_visualization import MonostaticRCSPlotter
app = Hfss()
rcs_object = app.get_rcs_data()
rcs_plotter = MonostaticRCSPlotter(rcs_data=rcs_object.rcs_data)
rcs_plotter.plot_rcs()

If you exported the RCS data previously, you can directly get the RCS data:

.. code:: python

from ansys.aedt.core.visualization.advanced.rcs_visualization import MonostaticRCSPlotter
from ansys.aedt.core.visualization.advanced.rcs_visualization import MonostaticRCSData
input_file = r"path_to_data\pyaedt_rcs_metadata.json"
rcs_data = MonostaticRCSData(input_file)
rcs_plotter = MonostaticRCSPlotter(rcs_data)
rcs_plotter.plot_cut()

The following diagram shows both classes work. You can use them independently or from the ``get_rcs_data`` method.

.. image:: ../../_static/rcs_visualization_pyaedt.png
:width: 800
:alt: RCS data with PyAEDT


Heterogeneous data message
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
19 changes: 19 additions & 0 deletions doc/source/API/visualization/post.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,25 @@ If you need to export HFSS far field data, then you can use the following featur
antenna_data = app.post.get_antenna_data()
app.release_desktop(False, False)

If you need to export HFSS monostatic RCS data, then you can use the following feature to obtain the RCS metadata:

.. currentmodule:: ansys.aedt.core.visualization.post.rcs_exporter

.. autosummary::
:toctree: _autosummary
:nosignatures:

MonostaticRCSExporter

.. code:: python

from ansys.aedt.core import Hfss

app = Hfss()

rcs_data = app.post.get_rcs_data()
app.release_desktop(False, False)


Icepak
~~~~~~
Expand Down
Binary file added doc/source/_static/rcs_visualization_pyaedt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/styles/config/vocabularies/ANSYS/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Maxwell 3D
Maxwell Circuit
mcm
[Mm]echanical
[Mm]onostatic
multiphysics
multiplot
namespaces
Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ unit-tests = [
"pytest-cov>=4.0.0,<6.1",
"mock>=5.1.0,<5.2",
]
integration-tests = [
"matplotlib>=3.5.0,<3.10",
"mock>=5.1.0,<5.2",
"numpy>=1.20.0,<2",
"pandas>=1.1.0,<2.3",
"pytest>=7.4.0,<8.4",
"pytest-cov>=4.0.0,<6.1",
]
tests = [
"ipython>=7.30.0,<8.30",
"joblib>=1.0.0,<1.5",
Expand All @@ -64,6 +72,8 @@ tests = [
"pytest-cov>=4.0.0,<6.1",
"pytest-xdist>=3.5.0,<3.7",
"pyvista[io]>=0.38.0,<0.45",
"ansys-tools-visualization-interface; python_version >= '3.10'",
"tables; python_version >= '3.10'",
# Never directly imported but required when loading ML related file see #4713
"scikit-learn>=1.0.0,<1.6",
"scikit-rf>=0.30.0,<1.5",
Expand Down Expand Up @@ -98,6 +108,8 @@ all = [
"pandas>=1.1.0,<2.3",
"pyvista[io]>=0.38.0,<0.45",
"fast-simplification>=0.1.7",
"ansys-tools-visualization-interface; python_version >= '3.10'",
"tables; python_version >= '3.10'",
# Never directly imported but required when loading ML related file see #4713
"scikit-learn>=1.0.0,<1.6",
"scikit-rf>=0.30.0,<1.5",
Expand All @@ -111,6 +123,8 @@ installer = [
"osmnx>=1.1.0,<1.10",
"pandas>=1.1.0,<2.3",
"pyvista[io]>=0.38.0,<0.45",
"fast-simplification>=0.1.7",
"ansys-tools-visualization-interface; python_version >= '3.10'",
# Never directly imported but required when loading ML related file see #4713
"scikit-learn>=1.0.0,<1.6",
"scikit-rf>=0.30.0,<1.5",
Expand Down Expand Up @@ -160,6 +174,7 @@ omit = ["src/ansys/aedt/core/rpc/*.py"]
[tool.pytest.ini_options]
markers = [
"unit",
"integration",
"system",
"solvers",
"general",
Expand Down
3 changes: 3 additions & 0 deletions src/ansys/aedt/core/application/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1408,6 +1408,9 @@
"UseSBREnhancedRadiatedPowerCalculation": False,
"AdaptFEBIWithRadiation": False,
}
if settings.aedt_version >= "2024.2":
default_sbr_setup["IsMonostaticRCS"] = True
default_sbr_setup["FastFrequencyLooping"] = False

Check warning on line 1413 in src/ansys/aedt/core/application/analysis.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis.py#L1411-L1413

Added lines #L1411 - L1413 were not covered by tests
user_domain = None
if props:
if "RadiationSetup" in props:
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -3447,7 +3447,7 @@
>>> oProject.InsertDesign
"""
self._close_edb()
self._init_design(
return self._init_design(

Check warning on line 3450 in src/ansys/aedt/core/application/design.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/design.py#L3450

Added line #L3450 was not covered by tests
project_name=self.project_name if self.project_name else generate_unique_name("Project"),
design_name=name,
solution_type=solution_type if solution_type else self.solution_type,
Expand Down
102 changes: 100 additions & 2 deletions src/ansys/aedt/core/hfss.py
Original file line number Diff line number Diff line change
Expand Up @@ -5832,10 +5832,10 @@
Whether to overwrite FFD files. The default is ``True``.
link_to_hfss : bool, optional
Whether to return an instance of the
:class:`ansys.aedt.core.generic.farfield_explorerf.FfdSolutionDataExporter` class,
:class:`ansys.aedt.core.visualization.advanced.farfield_exporter.FfdSolutionDataExporter` class,
which requires a connection to an instance of the :class:`Hfss` class.
The default is `` True``. If ``False``, returns an instance of
:class:`ansys.aedt.core.generic.farfield_explorer.FfdSolutionData` class, which is
:class:`ansys.aedt.core.visualization.advanced.farfield_visualization.FfdSolutionData` class, which is
independent of the running HFSS instance.
export_touchstone : bool, optional
Whether to export touchstone file. The default is ``False``.
Expand Down Expand Up @@ -5919,6 +5919,104 @@
self.logger.error("Farfield solution data could not be exported.")
return False

@pyaedt_function_handler()
def get_rcs_data(
self,
frequencies=None,
setup=None,
expression="ComplexMonostaticRCSTheta",
variations=None,
overwrite=True,
link_to_hfss=True,
variation_name=None,
):
"""Export the radar cross-section data.
This method returns an instance of the ``RcsSolutionDataExporter`` object.

Parameters
----------
frequencies : float, list, optional
Frequency value or list of frequencies to compute the data. The default is ``None,`` in which case
all available frequencies are computed.
setup : str, optional
Name of the setup to use. The default is ``None,`` in which case ``nominal_adaptive`` is used.
expression : str, optional
Monostatic expression name. The default value is ``"ComplexMonostaticRCSTheta"``.
variations : dict, optional
Variation dictionary. The default is ``None``, in which case the nominal variation is exported.
overwrite : bool, optional
Whether to overwrite metadata files. The default is ``True``.
link_to_hfss : bool, optional
Whether to return an instance of the
:class:`ansys.aedt.core.visualization.post.rcs_exporter.MonostaticRCSExporter` class,
which requires a connection to an instance of the :class:`Hfss` class.
The default is `` True``. If ``False``, returns an instance of
:class:`ansys.aedt.core.visualization.advanced.rcs_visualization.MonostaticRCSData` class, which is
independent of the running HFSS instance.
variation_name : str, optional
Variation name. The default is ``None``, in which case the nominal variation is added.

Returns
-------
:class:`ansys.aedt.core.post.rcs_exporter.MonostaticRCSExporter`
SolutionData object.

Examples
--------
The method :func:`get_antenna_data` is used to export the farfield of each element of the design.

Open a design and create the objects.

>>> from ansys.aedt.core import Hfss
>>> hfss = Hfss()
>>> rcs_data = hfss.get_rcs_data()
"""
from ansys.aedt.core.visualization.advanced.rcs_visualization import MonostaticRCSData
from ansys.aedt.core.visualization.post.rcs_exporter import MonostaticRCSExporter

Check warning on line 5975 in src/ansys/aedt/core/hfss.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/hfss.py#L5974-L5975

Added lines #L5974 - L5975 were not covered by tests

if not variations:
variations = self.available_variations.nominal_w_values_dict_w_dependent
if not setup:
setup = self.nominal_adaptive

Check warning on line 5980 in src/ansys/aedt/core/hfss.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/hfss.py#L5977-L5980

Added lines #L5977 - L5980 were not covered by tests

if setup in self.existing_analysis_sweeps and not frequencies:
rcs_data = self.post.get_solution_data(

Check warning on line 5983 in src/ansys/aedt/core/hfss.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/hfss.py#L5982-L5983

Added lines #L5982 - L5983 were not covered by tests
expressions=expression,
variations=variations,
setup_sweep_name=setup,
report_category="Monostatic RCS",
)
if rcs_data and rcs_data.primary_sweep_values is not None:
frequencies = rcs_data.primary_sweep_values
frequency_units = self.odesktop.GetDefaultUnit("Frequency")
frequencies = [str(freq) + frequency_units for freq in frequencies]

Check warning on line 5992 in src/ansys/aedt/core/hfss.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/hfss.py#L5989-L5992

Added lines #L5989 - L5992 were not covered by tests

if not frequencies: # pragma: no cover
self.logger.info("Frequencies could not be obtained.")
return False

rcs = MonostaticRCSExporter(

Check warning on line 5998 in src/ansys/aedt/core/hfss.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/hfss.py#L5998

Added line #L5998 was not covered by tests
self,
setup_name=setup,
frequencies=frequencies,
expression=expression,
variations=variations,
overwrite=overwrite,
)

if variation_name:
rcs.solution = variation_name

Check warning on line 6008 in src/ansys/aedt/core/hfss.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/hfss.py#L6007-L6008

Added lines #L6007 - L6008 were not covered by tests

metadata = rcs.export_rcs()

Check warning on line 6010 in src/ansys/aedt/core/hfss.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/hfss.py#L6010

Added line #L6010 was not covered by tests

if link_to_hfss:
return rcs
elif metadata:
return MonostaticRCSData(input_file=metadata)

Check warning on line 6015 in src/ansys/aedt/core/hfss.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/hfss.py#L6012-L6015

Added lines #L6012 - L6015 were not covered by tests
else: # pragma: no cover
self.logger.error("Farfield solution data could not be exported.")
return False

@pyaedt_function_handler()
def set_material_threshold(self, threshold=100000):
"""Set the material conductivity threshold.
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/modules/solve_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3403,7 +3403,7 @@ def enable_adaptive_setup_multifrequency(self, frequencies, max_delta_s=0.02):


class SetupSBR(Setup, object):
"""Initializes, creates, and updates an HFSS SBR+ or HFSS Auto setup.
"""Initializes, creates, and updates an HFSS SBR+ or HFSS Auto setup.

Parameters
----------
Expand Down
Loading
Loading