Skip to content

Commit

Permalink
Disabling yapf for mesh doctor test data
Browse files Browse the repository at this point in the history
  • Loading branch information
cssherman committed Jan 18, 2024
1 parent d5ff04b commit 1f5871e
Showing 1 changed file with 54 additions and 86 deletions.
140 changes: 54 additions & 86 deletions geosx_mesh_doctor/tests/test_supported_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,89 +38,44 @@ def make_dodecahedron() -> Tuple[vtkPoints, vtkIdList]:
This code was adapted from an official vtk example.
:return: The tuple of points and faces (as vtk instances).
"""
points = ((1.21412, 0, 1.58931), (0.375185, 1.1547, 1.58931), (-0.982247, 0.713644, 1.58931),
(-0.982247, -0.713644, 1.58931), (0.375185, -1.1547, 1.58931), (1.96449, 0, 0.375185),
(0.607062, 1.86835, 0.375185), (-1.58931, 1.1547, 0.375185), (-1.58931, -1.1547, 0.375185),
(0.607062, -1.86835, 0.375185), (1.58931, 1.1547, -0.375185), (-0.607062, 1.86835, -0.375185),
(-1.96449, 0, -0.375185), (-0.607062, -1.86835, -0.375185), (1.58931, -1.1547,
-0.375185), (0.982247, 0.713644, -1.58931),
(-0.375185, 1.1547, -1.58931), (-1.21412, 0, -1.58931), (-0.375185, -1.1547,
-1.58931), (0.982247, -0.713644, -1.58931))

faces = (
12, # number of faces
5,
0,
1,
2,
3,
4, # number of ids on face, ids
5,
0,
5,
10,
6,
1,
5,
1,
6,
11,
7,
2,
5,
2,
7,
12,
8,
3,
5,
3,
8,
13,
9,
4,
5,
4,
9,
14,
5,
0,
5,
15,
10,
5,
14,
19,
5,
16,
11,
6,
10,
15,
5,
17,
12,
7,
11,
16,
5,
18,
13,
8,
12,
17,
5,
19,
14,
9,
13,
18,
5,
19,
18,
17,
16,
15)
# yapf: disable
points = (
(1.21412, 0, 1.58931),
(0.375185, 1.1547, 1.58931),
(-0.982247, 0.713644, 1.58931),
(-0.982247, -0.713644, 1.58931),
(0.375185, -1.1547, 1.58931),
(1.96449, 0, 0.375185),
(0.607062, 1.86835, 0.375185),
(-1.58931, 1.1547, 0.375185),
(-1.58931, -1.1547, 0.375185),
(0.607062, -1.86835, 0.375185),
(1.58931, 1.1547, -0.375185),
(-0.607062, 1.86835, -0.375185),
(-1.96449, 0, -0.375185),
(-0.607062, -1.86835, -0.375185),
(1.58931, -1.1547, -0.375185),
(0.982247, 0.713644, -1.58931),
(-0.375185, 1.1547, -1.58931),
(-1.21412, 0, -1.58931),
(-0.375185, -1.1547, -1.58931),
(0.982247, -0.713644, -1.58931)
)

faces = (12, # number of faces
5, 0, 1, 2, 3, 4, # number of ids on face, ids
5, 0, 5, 10, 6, 1,
5, 1, 6, 11, 7, 2,
5, 2, 7, 12, 8, 3,
5, 3, 8, 13, 9, 4,
5, 4, 9, 14, 5, 0,
5, 15, 10, 5, 14, 19,
5, 16, 11, 6, 10, 15,
5, 17, 12, 7, 11, 16,
5, 18, 13, 8, 12, 17,
5, 19, 14, 9, 13, 18,
5, 19, 18, 17, 16, 15)
# yapf: enable

p = vtkPoints()
p.Allocate(len(points))
Expand Down Expand Up @@ -150,9 +105,22 @@ def test_dodecahedron() -> None:
def test_parse_face_stream() -> None:
_, faces = make_dodecahedron()
result = parse_face_stream(faces)
expected = ((0, 1, 2, 3, 4), (0, 5, 10, 6, 1), (1, 6, 11, 7, 2), (2, 7, 12, 8, 3), (3, 8, 13, 9, 4),
(4, 9, 14, 5, 0), (15, 10, 5, 14, 19), (16, 11, 6, 10, 15), (17, 12, 7, 11, 16), (18, 13, 8, 12, 17),
(19, 14, 9, 13, 18), (19, 18, 17, 16, 15))
# yapf: disable
expected = (
(0, 1, 2, 3, 4),
(0, 5, 10, 6, 1),
(1, 6, 11, 7, 2),
(2, 7, 12, 8, 3),
(3, 8, 13, 9, 4),
(4, 9, 14, 5, 0),
(15, 10, 5, 14, 19),
(16, 11, 6, 10, 15),
(17, 12, 7, 11, 16),
(18, 13, 8, 12, 17),
(19, 14, 9, 13, 18),
(19, 18, 17, 16, 15)
)
# yapf: enable
assert result == expected
face_stream = FaceStream.build_from_vtk_id_list(faces)
assert face_stream.num_faces == 12
Expand Down

0 comments on commit 1f5871e

Please sign in to comment.