From 7aed23ee9f3518ed9890bb8d460ea8d46ee66b92 Mon Sep 17 00:00:00 2001 From: ropercha Date: Fri, 29 Nov 2024 16:40:35 +0100 Subject: [PATCH] Improve Codacy diff coverage --- actions/triangular_actions.py | 3 ++- mesh_model/mesh_analysis.py | 35 +++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/actions/triangular_actions.py b/actions/triangular_actions.py index eb07a7a..a05831c 100644 --- a/actions/triangular_actions.py +++ b/actions/triangular_actions.py @@ -121,6 +121,7 @@ def collapse_edge(mesh: Mesh, n1: Node, n2: Node) -> True: else: ds = d2s.get_beta(1) ds.set_node(n1) + """ elif d12 is None and d2112 is not None: d2112.set_node(n1) ds = (d2112.get_beta(1)).get_beta(1) @@ -129,7 +130,7 @@ def collapse_edge(mesh: Mesh, n1: Node, n2: Node) -> True: ds2.set_node(n1) ds = (ds2.get_beta(1)).get_beta(1) ds2 = ds.get_beta(2) - + """ #update beta2 relations if d112 is not None: d112.set_beta(2, d12) diff --git a/mesh_model/mesh_analysis.py b/mesh_model/mesh_analysis.py index 851c1d5..d7bc4f8 100644 --- a/mesh_model/mesh_analysis.py +++ b/mesh_model/mesh_analysis.py @@ -147,8 +147,6 @@ def degree(n: Node) -> int: else: adjacency += 0.5 if adjacency != int(adjacency): - print(adjacency) - print(n.id) raise ValueError("Adjacency error") return adjacency @@ -168,21 +166,6 @@ def get_boundary_darts(m: Mesh) -> list[Dart]: return boundary_darts -def get_boundary_nodes(m: Mesh) -> list[Node]: - """ - Find all boundary nodes - :param m: a mesh - :return: a list of all boundary nodes - """ - boundary_nodes = [] - for n_id in range(0, len(m.nodes)): - if m.nodes[n_id, 2] >= 0: - n = Node(m, n_id) - if on_boundary(n): - boundary_nodes.append(n) - return boundary_nodes - - def find_opposite_node(d: Dart) -> (int, int): """ Find the coordinates of the vertex opposite in the adjacent triangle @@ -499,4 +482,20 @@ def test_degree(n: Node) -> bool: if degree(n) > 10: return False else: - return True \ No newline at end of file + return True + +""" +def get_boundary_nodes(m: Mesh) -> list[Node]: + # + Find all boundary nodes + :param m: a mesh + :return: a list of all boundary nodes + # + boundary_nodes = [] + for n_id in range(0, len(m.nodes)): + if m.nodes[n_id, 2] >= 0: + n = Node(m, n_id) + if on_boundary(n): + boundary_nodes.append(n) + return boundary_nodes +""" \ No newline at end of file