Skip to content

Commit d27f7e2

Browse files
committed
Undo changes made in other branches
1 parent 8c8d41f commit d27f7e2

File tree

8 files changed

+14
-64
lines changed

8 files changed

+14
-64
lines changed

src/ansys/geometry/core/designer/design.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,7 @@ def export_to_parasolid_text(self, location: Path | str | None = None) -> Path:
506506
The path to the saved file.
507507
"""
508508
# Determine the extension based on the backend type
509-
ext = (
510-
"x_t"
511-
if self._grpc_client.backend_type
512-
in (BackendType.LINUX_SERVICE, BackendType.CORE_WINDOWS, BackendType.CORE_LINUX)
513-
else "xmt_txt"
514-
)
509+
ext = "x_t" if self._grpc_client.backend_type == BackendType.LINUX_SERVICE else "xmt_txt"
515510

516511
# Define the file location
517512
file_location = self.__build_export_file_location(location, ext)
@@ -537,13 +532,8 @@ def export_to_parasolid_bin(self, location: Path | str | None = None) -> Path:
537532
The path to the saved file.
538533
"""
539534
# Determine the extension based on the backend type
540-
ext = (
541-
"x_b"
542-
if self._grpc_client.backend_type
543-
in (BackendType.LINUX_SERVICE, BackendType.CORE_WINDOWS, BackendType.CORE_LINUX)
544-
else "xmt_bin"
545-
)
546-
535+
ext = "x_b" if self._grpc_client.backend_type == BackendType.LINUX_SERVICE else "xmt_bin"
536+
547537
# Define the file location
548538
file_location = self.__build_export_file_location(location, ext)
549539

src/ansys/geometry/core/modeler.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,7 @@ def __init__(
123123
# Initialize the RepairTools - Not available on Linux
124124
# TODO: delete "if" when Linux service is able to use repair tools
125125
# https://github.com/ansys/pyansys-geometry/issues/1319
126-
if self.client.backend_type in (
127-
BackendType.LINUX_SERVICE,
128-
BackendType.CORE_WINDOWS,
129-
BackendType.CORE_LINUX,
130-
):
126+
if self.client.backend_type == BackendType.LINUX_SERVICE:
131127
self._measurement_tools = None
132128
LOG.warning("Linux backend does not support measurement tools.")
133129
else:

tests/integration/conftest.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@
5151

5252
def skip_if_linux(modeler: Modeler, test_name: str, element_not_available: str):
5353
"""Skip test if running on Linux."""
54-
if modeler.client.backend_type in (
55-
BackendType.LINUX_SERVICE,
56-
BackendType.CORE_WINDOWS,
57-
BackendType.CORE_LINUX,
58-
):
54+
if modeler.client.backend_type == BackendType.LINUX_SERVICE:
5955
pytest.skip(
6056
reason=f"Skipping '{test_name}'. '{element_not_available}' not on Linux service."
6157
) # skip!

tests/integration/test_design.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -913,19 +913,15 @@ def test_download_file(modeler: Modeler, tmp_path_factory: pytest.TempPathFactor
913913
assert file.exists()
914914

915915
# Check that we can also save it (even if it is not accessible on the server)
916-
if modeler.client.backend_type in (BackendType.LINUX_SERVICE, BackendType.CORE_LINUX):
916+
if modeler.client.backend_type == BackendType.LINUX_SERVICE:
917917
file_save = "/tmp/cylinder-temp.scdocx"
918918
else:
919919
file_save = tmp_path_factory.mktemp("scdoc_files_save") / "cylinder.scdocx"
920920

921921
design.save(file_location=file_save)
922922

923923
# Check for other exports - Windows backend...
924-
if modeler.client.backend_type not in (
925-
BackendType.LINUX_SERVICE,
926-
BackendType.CORE_LINUX,
927-
BackendType.CORE_WINDOWS,
928-
):
924+
if modeler.client.backend_type != BackendType.LINUX_SERVICE:
929925
binary_parasolid_file = tmp_path_factory.mktemp("scdoc_files_download") / "cylinder.x_b"
930926
text_parasolid_file = tmp_path_factory.mktemp("scdoc_files_download") / "cylinder.x_t"
931927

tests/integration/test_design_export.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,7 @@ def test_export_to_parasolid_text(modeler: Modeler, tmp_path_factory: pytest.Tem
229229
# Define the location and expected file location
230230
location = tmp_path_factory.mktemp("test_export_to_parasolid_text")
231231

232-
if modeler.client.backend_type in (
233-
BackendType.LINUX_SERVICE,
234-
BackendType.CORE_LINUX,
235-
BackendType.CORE_WINDOWS,
236-
):
232+
if modeler.client.backend_type == BackendType.LINUX_SERVICE:
237233
file_location = location / f"{design.name}.x_t"
238234
else:
239235
file_location = location / f"{design.name}.xmt_txt"
@@ -256,11 +252,7 @@ def test_export_to_parasolid_binary(modeler: Modeler, tmp_path_factory: pytest.T
256252
# Define the location and expected file location
257253
location = tmp_path_factory.mktemp("test_export_to_parasolid_binary")
258254

259-
if modeler.client.backend_type in (
260-
BackendType.LINUX_SERVICE,
261-
BackendType.CORE_LINUX,
262-
BackendType.CORE_WINDOWS,
263-
):
255+
if modeler.client.backend_type == BackendType.LINUX_SERVICE:
264256
file_location = location / f"{design.name}.x_b"
265257
else:
266258
file_location = location / f"{design.name}.xmt_bin"

tests/integration/test_design_import.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,7 @@ def test_open_file(modeler: Modeler, tmp_path_factory: pytest.TempPathFactory):
253253
_checker_method(design, design2, True)
254254

255255
# Test HOOPS formats (Windows only)
256-
if modeler.client.backend_type not in (
257-
BackendType.LINUX_SERVICE,
258-
BackendType.CORE_LINUX,
259-
BackendType.CORE_WINDOWS,
260-
):
256+
if modeler.client.backend_type != BackendType.LINUX_SERVICE:
261257
# IGES
262258
#
263259
# TODO: Something has gone wrong with IGES

tests/integration/test_tessellation.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ def test_body_tessellate(modeler: Modeler):
6969
blocks_2 = body_2.tessellate()
7070
assert "MultiBlock" in str(blocks_2)
7171
assert blocks_2.n_blocks == 3
72-
if modeler.client.backend_type not in (
73-
BackendType.LINUX_SERVICE,
74-
BackendType.CORE_LINUX,
75-
BackendType.CORE_WINDOWS,
76-
):
72+
if modeler.client.backend_type != BackendType.LINUX_SERVICE:
7773
assert blocks_2.bounds == pytest.approx(
7874
[0.019999999999999997, 0.04, 0.020151922469877917, 0.03984807753012208, 0.0, 0.03],
7975
rel=1e-6,
@@ -90,11 +86,7 @@ def test_body_tessellate(modeler: Modeler):
9086

9187
# Tessellate the body merging the individual faces
9288
mesh_2 = body_2.tessellate(merge=True)
93-
if modeler.client.backend_type not in (
94-
BackendType.LINUX_SERVICE,
95-
BackendType.CORE_LINUX,
96-
BackendType.CORE_WINDOWS,
97-
):
89+
if modeler.client.backend_type != BackendType.LINUX_SERVICE:
9890
assert "PolyData" in str(mesh_2)
9991
assert mesh_2.n_cells == 72
10092
assert mesh_2.n_points == 76
@@ -143,11 +135,7 @@ def test_component_tessellate(modeler: Modeler):
143135
mesh = comp.tessellate()
144136
comp.plot()
145137
assert "PolyData" in str(mesh)
146-
if modeler.client.backend_type not in (
147-
BackendType.LINUX_SERVICE,
148-
BackendType.CORE_LINUX,
149-
BackendType.CORE_WINDOWS,
150-
):
138+
if modeler.client.backend_type != BackendType.LINUX_SERVICE:
151139
assert mesh.n_cells == 3280
152140
assert mesh.n_faces == 3280
153141
assert mesh.n_arrays == 0

tests/integration/test_trimmed_geometry.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ def create_hedgehog(modeler: Modeler):
8787
create_sketch_line(design, p1, p2)
8888
current_gap += 1
8989
# Add isoparametric curves, not on linux
90-
if modeler.client.backend_type not in (
91-
BackendType.LINUX_SERVICE,
92-
BackendType.CORE_LINUX,
93-
BackendType.CORE_WINDOWS,
94-
):
90+
if modeler.client.backend_type != BackendType.LINUX_SERVICE:
9591
param = 0.20
9692
while param <= 1:
9793
for face in body.faces:

0 commit comments

Comments
 (0)