Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hypertiling
hypertiling
Commits
cb077a23
Commit
cb077a23
authored
May 20, 2022
by
Manuel Schrauth
Browse files
expand test to include brute force algorithm
parent
a974f1b8
Pipeline
#15289
failed with stages
in 8 minutes and 43 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/test_compare_neighbours.py
View file @
cb077a23
...
...
@@ -3,15 +3,15 @@ from hypertiling import HyperbolicTiling
from
hypertiling.neighbours
import
find
kernel
=
"flo"
lattices
=
[(
3
,
7
,
7
,),
(
7
,
3
,
7
),
(
5
,
4
,
6
),
(
4
,
5
,
6
),
(
9
,
3
,
4
),
(
4
,
10
,
3
),
(
3
,
8
,
4
),
(
6
,
4
,
4
)]
print
(
"Testing different neighbour search algorithms against each other"
)
class
TestCompareNeighbours
(
unittest
.
TestCase
):
def
test_comp_nbrs
(
self
):
kernel
=
"flo"
lattices
=
[(
3
,
7
,
7
,),
(
7
,
3
,
7
),
(
5
,
4
,
6
),
(
4
,
5
,
6
),
(
9
,
3
,
4
),
(
4
,
10
,
3
),
(
3
,
8
,
4
),
(
6
,
4
,
4
)]
for
p
,
q
,
nlayer
in
lattices
:
print
(
"Constructing"
,
p
,
q
,
nlayer
,
"lattice"
)
T
=
HyperbolicTiling
(
p
,
q
,
nlayer
,
kernel
=
kernel
,
center
=
"cell"
)
...
...
@@ -22,6 +22,19 @@ class TestCompareNeighbours(unittest.TestCase):
self
.
assertTrue
(
nbrs1
==
nbrs2
)
kernel
=
"flo"
lattices
=
[(
3
,
7
,
4
),
(
7
,
3
,
4
),
(
5
,
4
,
4
),
(
4
,
5
,
4
),
(
9
,
3
,
4
),
(
4
,
10
,
3
),
(
3
,
8
,
4
),
(
6
,
4
,
4
)]
for
p
,
q
,
nlayer
in
lattices
:
print
(
"Constructing"
,
p
,
q
,
nlayer
,
"lattice"
)
T
=
HyperbolicTiling
(
p
,
q
,
nlayer
,
kernel
=
kernel
,
center
=
"cell"
)
T
.
generate
()
nbrs1
=
find
(
T
,
which
=
"optimized"
)
nbrs2
=
find
(
T
,
which
=
"brute_force"
)
self
.
assertTrue
(
nbrs1
==
nbrs2
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment