Skip to content

Commit

Permalink
Add 100% test coverage
Browse files Browse the repository at this point in the history
Closes #57
  • Loading branch information
ayan-b committed Aug 1, 2020
1 parent 2a0d166 commit 9960f57
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 82 deletions.
160 changes: 80 additions & 80 deletions data/flat_triangular_mesh_no_target.txt
Original file line number Diff line number Diff line change
@@ -1,121 +1,121 @@
3.999999999999999112e-01
2.000000000000000389e-01
0.000000000000000000e+00
1.999999999999999556e-01
3.999999999999999667e-01
6.000000000000000888e-01
8.000000000000000444e-01
1.000000000000000000e+00
5.999999999999998668e-01
7.999999999999998224e-01
9.999999999999997780e-01
1.199999999999999734e+00
1.399999999999999911e+00
1.599999999999999867e+00
4.472135954999578722e-01
2.828427124746190069e-01
1.399999999999999689e+00
1.599999999999999645e+00
1.799999999999999378e+00
1.999999999999999334e+00
1.999999999999999001e-01
2.828427124746188404e-01
4.472135954999578167e-01
6.324555320336758824e-01
8.246211251235321393e-01
1.019803902718556810e+00
6.324555320336756603e-01
8.246211251235316952e-01
1.019803902718556365e+00
1.216552506059643601e+00
1.414213562373094923e+00
1.612451549659709604e+00
5.656854249492380138e-01
4.472135954999578722e-01
1.414213562373094479e+00
1.612451549659709160e+00
1.811077027627482572e+00
2.009975124224177456e+00
3.999999999999998002e-01
4.472135954999576501e-01
5.656854249492377917e-01
7.211102550927975807e-01
7.211102550927973587e-01
8.944271909999156334e-01
1.077032961426900748e+00
1.077032961426900526e+00
1.264911064067351321e+00
1.456021977856103433e+00
1.649242250247063835e+00
7.211102550927979138e-01
6.324555320336758824e-01
1.456021977856102989e+00
1.649242250247063168e+00
1.843908891458576171e+00
2.039607805437112731e+00
5.999999999999999778e-01
6.324555320336757713e-01
7.211102550927976917e-01
8.485281374238567986e-01
7.211102550927979138e-01
8.485281374238569096e-01
9.999999999999996669e-01
1.166190378969059971e+00
1.166190378969059749e+00
1.341640786499873395e+00
1.523154621172781331e+00
1.708800749063505542e+00
8.944271909999157444e-01
8.246211251235319173e-01
1.523154621172781553e+00
1.708800749063505764e+00
1.897366596101026870e+00
2.088061301782109247e+00
7.999999999999997113e-01
8.246211251235316952e-01
8.944271909999154113e-01
9.999999999999995559e-01
8.246211251235318063e-01
8.944271909999155223e-01
9.999999999999997780e-01
1.131370849898475361e+00
1.280624847486569129e+00
1.442220510185595383e+00
1.612451549659709382e+00
1.442220510185595161e+00
1.612451549659709160e+00
1.788854381999831267e+00
1.077032961426900970e+00
1.019803902718556810e+00
9.999999999999997780e-01
1.969771560359220519e+00
2.154065922853801052e+00
1.000000000000000000e+00
1.019803902718556810e+00
1.077032961426900526e+00
1.166190378969059749e+00
1.280624847486569351e+00
1.414213562373094479e+00
1.562049935181330174e+00
1.720465053408525069e+00
1.886796226411320276e+00
1.264911064067351987e+00
1.216552506059643823e+00
1.199999999999999956e+00
1.280624847486569795e+00
1.414213562373094701e+00
1.562049935181330396e+00
1.720465053408524847e+00
1.886796226411320054e+00
2.059126028197399538e+00
2.236067977499788917e+00
1.200000000000000178e+00
1.216552506059644045e+00
1.264911064067351543e+00
1.341640786499873617e+00
1.264911064067351321e+00
1.341640786499873839e+00
1.442220510185595383e+00
1.562049935181330618e+00
1.697056274847713819e+00
1.843908891458576838e+00
1.999999999999999778e+00
1.456021977856103433e+00
1.414213562373094701e+00
1.399999999999999689e+00
1.562049935181331062e+00
1.697056274847713597e+00
1.843908891458577060e+00
1.999999999999999556e+00
2.163330765278392853e+00
2.332380757938119498e+00
1.399999999999999911e+00
1.414213562373094923e+00
1.456021977856102989e+00
1.523154621172780887e+00
1.456021977856103433e+00
1.523154621172781553e+00
1.612451549659709160e+00
1.720465053408525069e+00
1.843908891458577060e+00
1.979898987322332049e+00
2.126029162546928752e+00
1.649242250247064057e+00
1.612451549659709604e+00
1.599999999999999645e+00
1.720465053408524847e+00
1.843908891458577282e+00
1.979898987322332271e+00
2.126029162546929197e+00
2.280350850198275214e+00
2.441311123146739703e+00
1.600000000000000089e+00
1.612451549659709826e+00
1.649242250247063613e+00
1.649242250247064057e+00
1.708800749063505986e+00
1.788854381999831267e+00
1.886796226411320054e+00
1.999999999999999112e+00
1.999999999999999778e+00
2.126029162546929641e+00
2.262741699796951167e+00
1.843908891458576615e+00
1.811077027627482572e+00
1.799999999999999378e+00
2.262741699796951611e+00
2.408318915758458356e+00
2.561249694973138702e+00
1.799999999999999600e+00
1.811077027627482794e+00
1.843908891458576393e+00
1.897366596101026870e+00
1.969771560359219853e+00
1.843908891458577060e+00
1.897366596101026648e+00
1.969771560359220741e+00
2.059126028197399094e+00
2.163330765278392853e+00
2.280350850198274770e+00
2.408318915758458800e+00
2.039607805437113619e+00
2.009975124224177456e+00
1.999999999999999556e+00
2.280350850198275214e+00
2.408318915758458356e+00
2.545584412271570063e+00
2.690724809414740903e+00
1.999999999999999778e+00
2.009975124224177456e+00
2.039607805437112731e+00
2.088061301782109691e+00
2.039607805437113619e+00
2.088061301782109247e+00
2.154065922853801052e+00
2.236067977499788917e+00
2.332380757938119498e+00
2.441311123146740591e+00
2.441311123146739703e+00
2.561249694973138702e+00
2.690724809414741792e+00
2.828427124746188959e+00
2 changes: 1 addition & 1 deletion gdist.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def compute_gdist(numpy.ndarray[numpy.float64_t, ndim=2] vertices,
cdef vector[unsigned] faces

if source_indices is None:
source_indices = numpy.arange(0, dtype=numpy.int32) # default to 0
source_indices = numpy.arange(1, dtype=numpy.int32) # default to 0
if target_indices is None:
propagate_on_max_distance = True
target_indices = numpy.arange(vertices.shape[0], dtype=numpy.int32)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_flat_triangular_mesh_no_target(self):
data = np.loadtxt("data/flat_triangular_mesh.txt", skiprows=1)
vertices = data[0:121].astype(np.float64)
triangles = data[121:].astype(np.int32)
source = np.array([2], dtype=np.int32)
source = None
target = None
distance = gdist.compute_gdist(
vertices,
Expand Down

0 comments on commit 9960f57

Please sign in to comment.