Skip to content

Commit

Permalink
Improve Codacy diff coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ArzhelaR committed Nov 29, 2024
1 parent df3af03 commit 7aed23e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
3 changes: 2 additions & 1 deletion actions/triangular_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
35 changes: 17 additions & 18 deletions mesh_model/mesh_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -499,4 +482,20 @@ def test_degree(n: Node) -> bool:
if degree(n) > 10:
return False
else:
return True
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
"""

0 comments on commit 7aed23e

Please sign in to comment.