|
29 | 29 | from ansys.aedt.core import Hfss3dLayout |
30 | 30 | from ansys.aedt.core.generic.settings import is_linux |
31 | 31 | from tests.conftest import DESKTOP_VERSION |
32 | | -from tests.conftest import USE_GRPC |
33 | 32 |
|
34 | 33 |
|
35 | 34 | @pytest.mark.skipif(is_linux, reason="FilterSolutions API is not supported on Linux.") |
36 | | -@pytest.mark.skipif( |
37 | | - DESKTOP_VERSION < "2026.1" or USE_GRPC, reason="Skipped on versions earlier than 2026.1 or gRPC mode" |
38 | | -) |
| 35 | +@pytest.mark.skipif(DESKTOP_VERSION < "2026.1", reason="Skipped on versions earlier than 2026.1") |
39 | 36 | class TestClass: |
40 | 37 | def test_lumped_exported_desktop(self, lumped_design): |
41 | 38 | schem_name = lumped_design.export_to_aedt.schematic_name |
42 | 39 | schem_name_length = len(schem_name) |
43 | | - app = lumped_design.export_to_aedt.export_design() |
44 | 40 | circuit = lumped_design.export_to_aedt.export_design() |
45 | 41 | assert isinstance(circuit, Circuit) |
46 | 42 | assert circuit.project_name.split()[0][:schem_name_length] == schem_name |
47 | 43 | assert circuit.design_name == schem_name |
48 | 44 | assert next(iter(circuit.setup_sweeps_names)) == "FS_Advanced Setup" |
49 | 45 | variables = circuit.variable_manager.variables |
50 | | - assert variables["C1"].value == pytest.approx(1.967e-12) |
51 | | - assert variables["L2"].value == pytest.approx(1.288e-8) |
52 | | - assert variables["C3"].value == pytest.approx(6.366e-12) |
53 | | - app.desktop_class.close_desktop() |
| 46 | + assert variables["C1"].si_value == pytest.approx(1.967e-12) |
| 47 | + assert variables["L2"].si_value == pytest.approx(1.288e-8) |
| 48 | + assert variables["C3"].si_value == pytest.approx(6.366e-12) |
| 49 | + circuit.desktop_class.close_desktop() |
54 | 50 |
|
55 | 51 | def test_distributed_circuit_exported_desktop(self, distributed_design): |
56 | 52 | schem_name = distributed_design.export_to_aedt.schematic_name |
57 | 53 | schem_name_length = len(schem_name) |
58 | 54 | distributed_design.export_to_aedt.insert_circuit_design = True |
59 | | - app = distributed_design.export_to_aedt.export_design() |
60 | 55 | circuit = distributed_design.export_to_aedt.export_design() |
61 | 56 | assert isinstance(circuit, Circuit) |
62 | 57 | assert circuit.project_name.split()[0][:schem_name_length] == schem_name |
63 | 58 | assert circuit.design_name == schem_name |
64 | 59 | assert next(iter(circuit.setup_sweeps_names)) == "FS_Advanced Setup" |
65 | 60 | variables = circuit.variable_manager.variables |
66 | | - assert variables["W1"].value == pytest.approx(5.08e-3) |
67 | | - assert variables["W2"].value == pytest.approx(3.175e-4) |
68 | | - assert variables["W3"].value == pytest.approx(5.08e-3) |
69 | | - assert variables["S1"].value == pytest.approx(3.362e-3) |
70 | | - assert variables["S2"].value == pytest.approx(2.172e-2) |
71 | | - assert variables["S3"].value == pytest.approx(1.008e-2) |
72 | | - app.desktop_class.close_desktop() |
| 61 | + assert variables["W1"].si_value == pytest.approx(5.08e-3) |
| 62 | + assert variables["W2"].si_value == pytest.approx(3.175e-4) |
| 63 | + assert variables["W3"].si_value == pytest.approx(5.08e-3) |
| 64 | + assert variables["S1"].si_value == pytest.approx(3.362e-3) |
| 65 | + assert variables["S2"].si_value == pytest.approx(2.172e-2) |
| 66 | + assert variables["S3"].si_value == pytest.approx(1.008e-2) |
| 67 | + circuit.desktop_class.close_desktop() |
73 | 68 |
|
74 | 69 | def test_distributed_hfss3dl_exported_desktop(self, distributed_design): |
75 | 70 | schem_name = distributed_design.export_to_aedt.schematic_name |
76 | 71 | schem_name_length = len(schem_name) |
77 | 72 | distributed_design.export_to_aedt.insert_hfss_3dl_design = True |
78 | | - app = distributed_design.export_to_aedt.export_design() |
79 | 73 | hfss3dl = distributed_design.export_to_aedt.export_design() |
80 | 74 | assert isinstance(hfss3dl, Hfss3dLayout) |
81 | 75 | assert hfss3dl.project_name.split()[0][:schem_name_length] == schem_name |
82 | 76 | assert hfss3dl.design_name == schem_name |
83 | 77 | assert next(iter(hfss3dl.setup_sweeps_names)) == "FS_Advanced Setup" |
84 | 78 | variables = hfss3dl.variable_manager.variables |
85 | | - assert variables["Win"].value == pytest.approx(1.234e-3) |
86 | | - assert variables["W1"].value == pytest.approx(5.08e-3) |
87 | | - assert variables["W2"].value == pytest.approx(3.175e-4) |
88 | | - assert variables["W3"].value == pytest.approx(5.08e-3) |
89 | | - assert variables["S1"].value == pytest.approx(3.36225452227e-3) |
90 | | - assert variables["S2"].value == pytest.approx(2.17231965814e-2) |
91 | | - assert variables["S3"].value == pytest.approx(1.00773795179e-2) |
92 | | - app.desktop_class.close_desktop() |
| 79 | + assert variables["Win"].si_value == pytest.approx(1.234e-3) |
| 80 | + assert variables["W1"].si_value == pytest.approx(5.08e-3) |
| 81 | + assert variables["W2"].si_value == pytest.approx(3.175e-4) |
| 82 | + assert variables["W3"].si_value == pytest.approx(5.08e-3) |
| 83 | + assert variables["S1"].si_value == pytest.approx(3.36225452227e-3) |
| 84 | + assert variables["S2"].si_value == pytest.approx(2.17231965814e-2) |
| 85 | + assert variables["S3"].si_value == pytest.approx(1.00773795179e-2) |
| 86 | + hfss3dl.desktop_class.close_desktop() |
93 | 87 |
|
94 | 88 | def test_distributed_hfss_exported_desktop(self, distributed_design): |
95 | 89 | schem_name = distributed_design.export_to_aedt.schematic_name |
96 | 90 | schem_name_length = len(schem_name) |
97 | 91 | distributed_design.export_to_aedt.insert_hfss_design = True |
98 | | - app = distributed_design.export_to_aedt.export_design() |
99 | 92 | hfss = distributed_design.export_to_aedt.export_design() |
100 | 93 | assert isinstance(hfss, Hfss) |
101 | 94 | assert hfss.project_name.split()[0][:schem_name_length] == schem_name |
102 | 95 | assert hfss.design_name == schem_name |
103 | 96 | assert next(iter(hfss.setup_sweeps_names)) == "FS_Advanced_Setup" |
104 | 97 | variables = hfss.variable_manager.variables |
105 | | - assert variables["Win"].value == pytest.approx(1.234e-3) |
106 | | - assert variables["W1"].value == pytest.approx(5.08e-3) |
107 | | - assert variables["W2"].value == pytest.approx(3.175e-4) |
108 | | - assert variables["W3"].value == pytest.approx(5.08e-3) |
109 | | - assert variables["S1"].value == pytest.approx(3.36225452227e-3) |
110 | | - assert variables["S2"].value == pytest.approx(2.17231965814e-2) |
111 | | - assert variables["S3"].value == pytest.approx(1.00773795179e-2) |
112 | | - app.desktop_class.close_desktop() |
| 98 | + assert variables["Win"].si_value == pytest.approx(1.234e-3) |
| 99 | + assert variables["W1"].si_value == pytest.approx(5.08e-3) |
| 100 | + assert variables["W2"].si_value == pytest.approx(3.175e-4) |
| 101 | + assert variables["W3"].si_value == pytest.approx(5.08e-3) |
| 102 | + assert variables["S1"].si_value == pytest.approx(3.36225452227e-3) |
| 103 | + assert variables["S2"].si_value == pytest.approx(2.17231965814e-2) |
| 104 | + assert variables["S3"].si_value == pytest.approx(1.00773795179e-2) |
| 105 | + hfss.desktop_class.close_desktop() |
0 commit comments