Skip to content

Commit

Permalink
07 - functions and tests added - passed pylint, functional, failed (pip)
Browse files Browse the repository at this point in the history
  • Loading branch information
felicio93 committed Aug 15, 2024
1 parent d6a01ce commit dc3366b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ocsmesh/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3359,6 +3359,7 @@ def cleanup_skewed_el(mesh: jigsaw_msh_t,

return mesh_clean


def cleanup_concave_quads(mesh: jigsaw_msh_t) -> jigsaw_msh_t:
'''
Removes concave quads that might have been wrongly created
Expand Down Expand Up @@ -3564,6 +3565,7 @@ def quadrangulate_rivermapper_arcs(arcs_shp,

return quad_mesh


def batched(iterable, n):
'''
This function is part of itertools for python 3.12+
Expand Down
5 changes: 1 addition & 4 deletions tests/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def test_cleanup_skewed_el(self):
[5, 6, 8, 7],
[5, 0, 3, 6]]))
)
print("passed_test_cleanup_skewed_el")

def test_clip_elements_by_index(self):
out_msht = utils.msht_from_numpy(
Expand All @@ -100,7 +99,6 @@ def test_clip_elements_by_index(self):
np.all(clean_idx.quad4['index'] == np.array([[0, 2, 1, 5],
[0, 5, 3, 4]]))
)
print("passed test_clip_elements_by_index")

def test_clean_concv(self):
out_msht = utils.msht_from_numpy(
Expand All @@ -109,8 +107,7 @@ def test_clean_concv(self):
quadrilaterals=self.in_quad
)
clean_concv = utils.cleanup_concave_quads(out_msht)
print("THis is clean_concv: ", clean_concv.quad4['index'])
# self.assertIsInstance(clean_concv, jigsaw_msh_t)
self.assertIsInstance(clean_concv, jigsaw_msh_t)
self.assertTrue(
np.all(clean_concv.quad4['index'] == np.array([[6, 7, 9, 8],
[6, 0, 4, 7],
Expand Down

0 comments on commit dc3366b

Please sign in to comment.