From 69fee14359372fdee730fd7d3665e0b1daf7fb58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernst=20R=C3=B6ell?= Date: Fri, 30 Aug 2024 11:53:20 +0200 Subject: [PATCH] Formatting --- code/datasets/transforms.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/code/datasets/transforms.py b/code/datasets/transforms.py index f069a31..bce2ce1 100644 --- a/code/datasets/transforms.py +++ b/code/datasets/transforms.py @@ -214,16 +214,17 @@ class TransformType(Enum): class TriangulationToFaceTransform: - ''' - Transforms tetrahedra to faces. - Expects a triangulation of shape [4,N] and + """ + Transforms tetrahedra to faces. + Expects a triangulation of shape [4,N] and returns the faces of shape [3,M]. - NOTE: It will contain duplicate triangles with different ordering. - Hence the result is not a "minimal" triangulation. When subsequently - converting the triangles to edges, this will not pose a problem as - the FaceToEdge transform by default creates undirected edges. - ''' + NOTE: It will contain duplicate triangles with different ordering. + Hence the result is not a "minimal" triangulation. When subsequently + converting the triangles to edges, this will not pose a problem as + the FaceToEdge transform by default creates undirected edges. + """ + def __init__(self, remove_triangulation: bool = True) -> None: self.remove_triangulation = remove_triangulation @@ -233,8 +234,8 @@ def __call__(self, data): assert data.triangulation is not None face = torch.cat([data.triangulation[i] for i in idx], dim=1) - # Remove duplicate triangles in - data.face = torch.unique(face,dim=1) + # Remove duplicate triangles in + data.face = torch.unique(face, dim=1) if self.remove_triangulation: data.triangulation = None