Skip to content

Commit

Permalink
new quad function + tests_22
Browse files Browse the repository at this point in the history
  • Loading branch information
felicio93 committed Jun 28, 2024
1 parent 19a547e commit cb7138f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/functional_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ jobs:
path: /tmp/test_dem.tif
retention-days: 7

- name: Run Python API tests
shell: bash -el {0}
run: python -m unittest discover tests/api -p "utils.py"

- name: Run geom build test
if: runner.os != 'Windows'
shell: bash -l {0}
Expand Down Expand Up @@ -113,6 +117,6 @@ jobs:
path: remeshed.2dm
retention-days: 7

- name: Run Python API tests
shell: bash -el {0}
run: python -m unittest discover tests/api -p "*.py"
# - name: Run Python API tests
# shell: bash -el {0}
# run: python -m unittest discover tests/api -p "*.py"
4 changes: 2 additions & 2 deletions ocsmesh/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3188,8 +3188,8 @@ def quads_from_tri(msht) -> jigsaw_msh_t:
tris_drop=[]
for idxs in result.values():
tris_drop.append(idxs)
tris_drop = np.array(tris_drop, dtype="int").ravel()
tris = np.delete(msht.tria3['index'], tris_drop,axis=0)
tris_drop = np.array(tris_drop, dtype="int")
tris = np.delete(msht.tria3['index'], tris_drop.ravel(),axis=0)

# combines all triangles that share 2 non-right angle vertices
# the quads array is composed of 2 right angle nodes (idx_of_closest)
Expand Down
2 changes: 1 addition & 1 deletion tests/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_order_mesh(self):
quadrilaterals=self.in_quad
)
self.assertTrue(
np.all(utils.order_mesh(out_msht).quad4['index'][0] == np.array([0, 4, 8, 7]))
np.all(utils.order_mesh(out_msht).quad4['index'][0].astype(int) == np.array([0, 4, 8, 7]))
)

def test_quads_from_tri(self):
Expand Down

0 comments on commit cb7138f

Please sign in to comment.