diff --git a/doc/changelog.d/1580.added.md b/doc/changelog.d/1580.added.md new file mode 100644 index 0000000000..563276f642 --- /dev/null +++ b/doc/changelog.d/1580.added.md @@ -0,0 +1 @@ +enable prepare and repair tools in Core Service \ No newline at end of file diff --git a/src/ansys/geometry/core/modeler.py b/src/ansys/geometry/core/modeler.py index e7f98b1648..f35df827b5 100644 --- a/src/ansys/geometry/core/modeler.py +++ b/src/ansys/geometry/core/modeler.py @@ -120,15 +120,15 @@ def __init__( # TODO: delete "if" when Linux service is able to use repair tools # https://github.com/ansys/pyansys-geometry/issues/1319 if self.client.backend_type == BackendType.LINUX_SERVICE: - self._repair_tools = None - self._prepare_tools = None self._measurement_tools = None - LOG.warning("Linux backend does not support repair or prepare tools.") + LOG.warning("Linux backend does not support measurement tools.") else: - self._repair_tools = RepairTools(self._grpc_client) - self._prepare_tools = PrepareTools(self._grpc_client) self._measurement_tools = MeasurementTools(self._grpc_client) + # Enabling tools for all: repair and prepare tools + self._repair_tools = RepairTools(self._grpc_client) + self._prepare_tools = PrepareTools(self._grpc_client) + # Maintaining references to all designs within the modeler workspace self._designs: dict[str, "Design"] = {} diff --git a/tests/integration/test_prepare_tools.py b/tests/integration/test_prepare_tools.py index ed2a0041f8..4fdcfa8d79 100644 --- a/tests/integration/test_prepare_tools.py +++ b/tests/integration/test_prepare_tools.py @@ -23,14 +23,11 @@ from ansys.geometry.core.modeler import Modeler -from .conftest import FILES_DIR, skip_if_linux +from .conftest import FILES_DIR def test_volume_extract_from_faces(modeler: Modeler): """Test a volume is created from the provided faces.""" - skip_if_linux( - modeler, test_volume_extract_from_faces.__name__, "prepare_tools" - ) # Skip test on Linux design = modeler.open_file(FILES_DIR / "hollowCylinder.scdocx") body = design.bodies[0] @@ -43,9 +40,6 @@ def test_volume_extract_from_faces(modeler: Modeler): def test_volume_extract_from_edge_loops(modeler: Modeler): """Test a volume is created from the provided edges.""" - skip_if_linux( - modeler, test_volume_extract_from_edge_loops.__name__, "prepare_tools" - ) # Skip test on Linux design = modeler.open_file(FILES_DIR / "hollowCylinder.scdocx") body = design.bodies[0] @@ -59,7 +53,6 @@ def test_volume_extract_from_edge_loops(modeler: Modeler): def test_share_topology(modeler: Modeler): """Test share topology operation is between two bodies.""" - skip_if_linux(modeler, test_share_topology.__name__, "prepare_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "MixingTank.scdocx") assert modeler.prepare_tools.share_topology(design.bodies) diff --git a/tests/integration/test_repair_tools.py b/tests/integration/test_repair_tools.py index c371ad869d..214ba5a450 100644 --- a/tests/integration/test_repair_tools.py +++ b/tests/integration/test_repair_tools.py @@ -25,12 +25,11 @@ from ansys.geometry.core.modeler import Modeler -from .conftest import FILES_DIR, skip_if_linux +from .conftest import FILES_DIR def test_find_split_edges(modeler: Modeler): """Test if split edge problem areas are detectable.""" - skip_if_linux(modeler, test_find_split_edges.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "SplitEdgeDesignTest.scdocx") problem_areas = modeler.repair_tools.find_split_edges(design.bodies, 25, 150) assert len(problem_areas) == 3 @@ -38,7 +37,6 @@ def test_find_split_edges(modeler: Modeler): def test_find_split_edge_id(modeler: Modeler): """Test whether problem area has the id.""" - skip_if_linux(modeler, test_find_split_edge_id.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "SplitEdgeDesignTest.scdocx") problem_areas = modeler.repair_tools.find_split_edges(design.bodies, 25, 150) assert problem_areas[0].id != "0" @@ -46,9 +44,6 @@ def test_find_split_edge_id(modeler: Modeler): def test_find_split_edge_edges(modeler: Modeler): """Test to find split edge problem areas with the connected edges.""" - skip_if_linux( - modeler, test_find_split_edge_edges.__name__, "repair_tools" - ) # Skip test on Linux design = modeler.open_file(FILES_DIR / "SplitEdgeDesignTest.scdocx") problem_areas = modeler.repair_tools.find_split_edges(design.bodies, 25, 150) assert len(problem_areas[0].edges) > 0 @@ -56,7 +51,6 @@ def test_find_split_edge_edges(modeler: Modeler): def test_fix_split_edge(modeler: Modeler): """Test to find and fix split edge problem areas.""" - skip_if_linux(modeler, test_fix_split_edge.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "SplitEdgeDesignTest.scdocx") problem_areas = modeler.repair_tools.find_split_edges(design.bodies, 25, 150) assert problem_areas[0].fix().success is True @@ -64,7 +58,6 @@ def test_fix_split_edge(modeler: Modeler): def test_find_extra_edges(modeler: Modeler): """Test to read geometry and find it's extra edge problem areas.""" - skip_if_linux(modeler, test_find_extra_edges.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "ExtraEdgesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_extra_edges(design.bodies) @@ -73,7 +66,6 @@ def test_find_extra_edges(modeler: Modeler): def test_find_extra_edge_id(modeler: Modeler): """Test whether problem area has the id.""" - skip_if_linux(modeler, test_find_extra_edge_id.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "ExtraEdgesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_extra_edges(design.bodies) assert problem_areas[0].id != "0" @@ -83,9 +75,6 @@ def test_find_extra_edge_edges(modeler: Modeler): """Test to read geometry and find it's extra edge problem area with connected edges. """ - skip_if_linux( - modeler, test_find_extra_edge_edges.__name__, "repair_tools" - ) # Skip test on Linux design = modeler.open_file(FILES_DIR / "ExtraEdgesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_extra_edges(design.bodies) assert len(problem_areas[0].edges) > 0 @@ -94,7 +83,6 @@ def test_find_extra_edge_edges(modeler: Modeler): @pytest.mark.skip(reason="This test is failing on the Geometry Service - issue 1335") def test_fix_extra_edge(modeler: Modeler): """Test to find and fix extra edge problem areas.""" - skip_if_linux(modeler, test_fix_extra_edge.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "ExtraEdgesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_extra_edges(design.bodies) assert problem_areas[0].fix().success is True @@ -102,7 +90,6 @@ def test_fix_extra_edge(modeler: Modeler): def test_find_inexact_edges(modeler: Modeler): """Test to read geometry and find it's inexact edge problem areas.""" - skip_if_linux(modeler, test_find_inexact_edges.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "InExactEdgesBefore.scdocx") problem_areas = modeler.repair_tools.find_inexact_edges(design.bodies) assert len(problem_areas) == 12 @@ -110,7 +97,6 @@ def test_find_inexact_edges(modeler: Modeler): def test_find_inexact_edge_id(modeler: Modeler): """Test whether problem area has the id.""" - skip_if_linux(modeler, test_find_inexact_edge_id.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "InExactEdgesBefore.scdocx") problem_areas = modeler.repair_tools.find_inexact_edges(design.bodies) assert problem_areas[0].id != "0" @@ -120,9 +106,6 @@ def test_find_inexact_edge_edges(modeler: Modeler): """Test to read geometry and find it's inexact edge problem areas with connected edges. """ - skip_if_linux( - modeler, test_find_inexact_edge_edges.__name__, "repair_tools" - ) # Skip test on Linux design = modeler.open_file(FILES_DIR / "InExactEdgesBefore.scdocx") problem_areas = modeler.repair_tools.find_inexact_edges(design.bodies) assert len(problem_areas[0].edges) > 0 @@ -132,7 +115,6 @@ def test_fix_inexact_edge(modeler: Modeler): """Test to read geometry and find and fix it's inexact edge problem areas. """ - skip_if_linux(modeler, test_fix_inexact_edge.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "InExactEdgesBefore.scdocx") problem_areas = modeler.repair_tools.find_inexact_edges(design.bodies) assert problem_areas[0].fix().success is True @@ -140,7 +122,6 @@ def test_fix_inexact_edge(modeler: Modeler): def test_find_missing_faces(modeler: Modeler): """Test to read geometry and find it's missing face problem areas.""" - skip_if_linux(modeler, test_find_missing_faces.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "MissingFacesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_missing_faces(design.bodies) assert len(problem_areas) == 1 @@ -148,7 +129,6 @@ def test_find_missing_faces(modeler: Modeler): def test_find_missing_face_id(modeler: Modeler): """Test whether problem area has the id.""" - skip_if_linux(modeler, test_find_missing_face_id.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "MissingFacesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_missing_faces(design.bodies) assert problem_areas[0].id != "0" @@ -158,9 +138,6 @@ def test_find_missing_face_faces(modeler: Modeler): """Test to read geometry and find it's missing face problem area with connected edges. """ - skip_if_linux( - modeler, test_find_missing_face_faces.__name__, "repair_tools" - ) # Skip test on Linux design = modeler.open_file(FILES_DIR / "MissingFacesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_missing_faces(design.bodies) assert len(problem_areas[0].edges) > 0 @@ -170,7 +147,6 @@ def test_fix_missing_face(modeler: Modeler): """Test to read geometry and find and fix it's missing face problem areas. """ - skip_if_linux(modeler, test_fix_missing_face.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "MissingFacesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_missing_faces(design.bodies) assert problem_areas[0].fix().success is True @@ -178,7 +154,6 @@ def test_fix_missing_face(modeler: Modeler): def test_find_duplicate_faces(modeler: Modeler): """Test to read geometry and find it's duplicate face problem areas.""" - skip_if_linux(modeler, test_find_duplicate_faces.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "DuplicateFacesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_duplicate_faces(design.bodies) assert len(problem_areas) == 1 @@ -186,7 +161,6 @@ def test_find_duplicate_faces(modeler: Modeler): def test_duplicate_face_id(modeler: Modeler): """Test whether duplicate face problem area has the id.""" - skip_if_linux(modeler, test_duplicate_face_id.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "DuplicateFacesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_duplicate_faces(design.bodies) assert problem_areas[0].id != "0" @@ -196,7 +170,6 @@ def test_duplicate_face_faces(modeler: Modeler): """Test to read geometry and find it's duplicate face problem area and its connected faces. """ - skip_if_linux(modeler, test_duplicate_face_faces.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "DuplicateFacesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_duplicate_faces(design.bodies) assert len(problem_areas[0].faces) > 0 @@ -206,7 +179,6 @@ def test_fix_duplicate_face(modeler: Modeler): """Test to read geometry and find and fix it's duplicate face problem areas. """ - skip_if_linux(modeler, test_fix_duplicate_face.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "DuplicateFacesDesignBefore.scdocx") problem_areas = modeler.repair_tools.find_duplicate_faces(design.bodies) assert problem_areas[0].fix().success is True @@ -214,7 +186,6 @@ def test_fix_duplicate_face(modeler: Modeler): def test_find_small_faces(modeler: Modeler): """Test to read geometry and find it's small face problem areas.""" - skip_if_linux(modeler, test_find_small_faces.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "SmallFacesBefore.scdocx") problem_areas = modeler.repair_tools.find_small_faces(design.bodies) assert len(problem_areas) == 4 @@ -222,7 +193,6 @@ def test_find_small_faces(modeler: Modeler): def test_find_small_face_id(modeler: Modeler): """Test whether problem area has the id.""" - skip_if_linux(modeler, test_find_small_face_id.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "SmallFacesBefore.scdocx") problem_areas = modeler.repair_tools.find_small_faces(design.bodies) assert problem_areas[0].id != "0" @@ -232,9 +202,6 @@ def test_find_small_face_faces(modeler: Modeler): """Test to read geometry, find it's small face problem area and return connected faces. """ - skip_if_linux( - modeler, test_find_small_face_faces.__name__, "repair_tools" - ) # Skip test on Linux design = modeler.open_file(FILES_DIR / "SmallFacesBefore.scdocx") problem_areas = modeler.repair_tools.find_small_faces(design.bodies) assert len(problem_areas[0].faces) > 0 @@ -242,7 +209,6 @@ def test_find_small_face_faces(modeler: Modeler): def test_fix_small_face(modeler: Modeler): """Test to read geometry and find and fix it's small face problem areas.""" - skip_if_linux(modeler, test_fix_small_face.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "SmallFacesBefore.scdocx") problem_areas = modeler.repair_tools.find_small_faces(design.bodies) assert problem_areas[0].fix().success is True @@ -250,7 +216,6 @@ def test_fix_small_face(modeler: Modeler): def test_find_stitch_faces(modeler: Modeler): """Test to read geometry and find it's stitch face problem areas.""" - skip_if_linux(modeler, test_find_stitch_faces.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "stitch_before.scdocx") problem_areas = modeler.repair_tools.find_stitch_faces(design.bodies) assert len(problem_areas) == 1 @@ -258,7 +223,6 @@ def test_find_stitch_faces(modeler: Modeler): def test_find_stitch_face_id(modeler: Modeler): """Test whether problem area has the id.""" - skip_if_linux(modeler, test_find_stitch_face_id.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "stitch_before.scdocx") problem_areas = modeler.repair_tools.find_stitch_faces(design.bodies) assert problem_areas[0].id != "0" @@ -268,9 +232,6 @@ def test_find_stitch_face_bodies(modeler: Modeler): """Test to read geometry and find it's stitch face problem area and return the connected faces. """ - skip_if_linux( - modeler, test_find_stitch_face_bodies.__name__, "repair_tools" - ) # Skip test on Linux design = modeler.open_file(FILES_DIR / "stitch_before.scdocx") problem_areas = modeler.repair_tools.find_stitch_faces(design.bodies) assert len(problem_areas[0].bodies) > 0 @@ -280,7 +241,6 @@ def test_fix_stitch_face(modeler: Modeler): """Test to read geometry, find the split edge problem areas and to fix them. """ - skip_if_linux(modeler, test_fix_stitch_face.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "stitch_before.scdocx") problem_areas = modeler.repair_tools.find_stitch_faces(design.bodies) message = problem_areas[0].fix() @@ -291,7 +251,6 @@ def test_fix_stitch_face(modeler: Modeler): def test_find_short_edges(modeler: Modeler): """Test to read geometry and find it's short edge problem areas.""" - skip_if_linux(modeler, test_find_short_edges.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "ShortEdgesBefore.scdocx") problem_areas = modeler.repair_tools.find_short_edges(design.bodies, 10) assert len(problem_areas) == 12 @@ -299,7 +258,6 @@ def test_find_short_edges(modeler: Modeler): def test_fix_short_edges(modeler: Modeler): """Test to read geometry and find and fix it's short edge problem areas.""" - skip_if_linux(modeler, test_fix_short_edges.__name__, "repair_tools") # Skip test on Linux design = modeler.open_file(FILES_DIR / "ShortEdgesBefore.scdocx") problem_areas = modeler.repair_tools.find_short_edges(design.bodies, 10) assert problem_areas[0].fix().success is True