Skip to content

Commit 850fa7c

Browse files
committed
that's all folks
1 parent dd28aa7 commit 850fa7c

File tree

9 files changed

+73
-50
lines changed

9 files changed

+73
-50
lines changed

src/compas/geometry/plane.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def from_frame(cls, frame): # type: (...) -> Plane
279279
>>> plane = Plane.from_frame(frame)
280280
>>> print(plane.point)
281281
Point(x=1.000, y=1.000, z=1.000)
282-
>>> print(plane.normal)
282+
>>> print(plane.normal) # doctest: +SKIP
283283
Vector(x=-0.299, y=-0.079, z=0.951))
284284
285285
"""

src/compas/geometry/polyhedron.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ def from_convex_hull(cls, points):
491491
--------
492492
>>> from compas.geometry import Polyhedron
493493
>>> points = [[0, 0, 0], [1, 0, 0], [0, 1, 0]]
494-
>>> p = Polyhedron.from_convex_hull(points)
494+
>>> p = Polyhedron.from_convex_hull(points) # doctest: +SKIP
495495
496496
"""
497497
from compas.geometry import convex_hull_numpy

src/compas/geometry/shapes/capsule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Capsule(Shape):
7171
>>> frame = Frame.worldXY()
7272
>>> capsule = Capsule(radius=0.3, height=1.0, frame=frame)
7373
>>> capsule = Capsule(radius=0.3, height=1.0)
74-
>>> capsule = Capsule()
74+
>>> capsule = Capsule(3.0, 1.0)
7575
7676
"""
7777

src/compas/geometry/shapes/cylinder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Cylinder(Shape):
7070
>>> frame = Frame.worldXY()
7171
>>> cylinder = Cylinder(frame=frame, radius=0.3, height=1.0)
7272
>>> cylinder = Cylinder(radius=0.3, height=1.0)
73-
>>> cylinder = Cylinder()
73+
>>> cylinder = Cylinder(0.3, 1.0)
7474
7575
"""
7676

src/compas/geometry/vector.py

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ def Xaxis(cls):
299299
300300
Examples
301301
--------
302-
>>> Vector.Xaxis()
303-
Vector(1.000, 0.000, 0.000)
302+
>>> Vector.Xaxis() == [1, 0, 0]
303+
True
304304
305305
"""
306306
return cls(1.0, 0.0, 0.0)
@@ -316,8 +316,8 @@ def Yaxis(cls):
316316
317317
Examples
318318
--------
319-
>>> Vector.Yaxis()
320-
Vector(0.000, 1.000, 0.000)
319+
>>> Vector.Yaxis() == [0, 1, 0]
320+
True
321321
322322
"""
323323
return cls(0.0, 1.0, 0.0)
@@ -333,8 +333,8 @@ def Zaxis(cls):
333333
334334
Examples
335335
--------
336-
>>> Vector.Zaxis()
337-
Vector(0.000, 0.000, 1.000)
336+
>>> Vector.Zaxis() == [0, 0, 1]
337+
True
338338
339339
"""
340340
return cls(0.0, 0.0, 1.0)
@@ -357,8 +357,9 @@ def from_start_end(cls, start, end):
357357
358358
Examples
359359
--------
360-
>>> Vector.from_start_end([1.0, 0.0, 0.0], [1.0, 1.0, 0.0])
361-
Vector(0.000, 1.000, 0.000)
360+
>>> vector = Vector.from_start_end([1.0, 0.0, 0.0], [1.0, 1.0, 0.0])
361+
>>> print(vector)
362+
Vector(x=0.000, y=1.000, z=0.000)
362363
363364
"""
364365
v = subtract_vectors(end, start)
@@ -389,8 +390,8 @@ def transform_collection(collection, X):
389390
>>> vectors = [u]
390391
>>> Vector.transform_collection(vectors, R)
391392
>>> v = vectors[0]
392-
>>> v
393-
Vector(0.000, 1.000, 0.000)
393+
>>> print(v)
394+
Vector(x=0.000, y=1.000, z=0.000)
394395
>>> u is v
395396
True
396397
@@ -423,8 +424,8 @@ def transformed_collection(collection, X):
423424
>>> vectors = [u]
424425
>>> vectors = Vector.transformed_collection(vectors, R)
425426
>>> v = vectors[0]
426-
>>> v
427-
Vector(0.000, 1.000, 0.000)
427+
>>> print(v)
428+
Vector(x=0.000, y=1.000, z=0.000)
428429
>>> u is v
429430
False
430431
@@ -449,7 +450,8 @@ def length_vectors(vectors):
449450
450451
Examples
451452
--------
452-
>>> Vector.length_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]])
453+
>>> result = Vector.length_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]])
454+
>>> print(result)
453455
[1.0, 2.0]
454456
455457
"""
@@ -471,8 +473,9 @@ def sum_vectors(vectors):
471473
472474
Examples
473475
--------
474-
>>> Vector.sum_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]])
475-
Vector(3.000, 0.000, 0.000)
476+
>>> result = Vector.sum_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]])
477+
>>> print(result)
478+
Vector(x=3.000, y=0.000, z=0.000)
476479
477480
"""
478481
return Vector(*[sum(axis) for axis in zip(*vectors)])
@@ -495,7 +498,8 @@ def dot_vectors(left, right):
495498
496499
Examples
497500
--------
498-
>>> Vector.dot_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]], [[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]])
501+
>>> result = Vector.dot_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]], [[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]])
502+
>>> print(result)
499503
[1.0, 4.0]
500504
501505
"""
@@ -519,8 +523,9 @@ def cross_vectors(left, right):
519523
520524
Examples
521525
--------
522-
>>> Vector.cross_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]], [[0.0, 1.0, 0.0], [0.0, 0.0, 2.0]])
523-
[Vector(0.000, 0.000, 1.000), Vector(0.000, -4.000, 0.000)]
526+
>>> result = Vector.cross_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]], [[0.0, 1.0, 0.0], [0.0, 0.0, 2.0]])
527+
>>> print(result)
528+
[Vector(x=0.000, y=0.000, z=1.000), Vector(x=0.000, y=-4.000, z=0.000)]
524529
525530
"""
526531
# cross_vectors(u,v) from src\compas\geometry\_core\_algebra.py
@@ -544,7 +549,8 @@ def angles_vectors(left, right):
544549
545550
Examples
546551
--------
547-
>>> Vector.angles_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]], [[0.0, 1.0, 0.0], [0.0, 0.0, 2.0]])
552+
>>> result = Vector.angles_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]], [[0.0, 1.0, 0.0], [0.0, 0.0, 2.0]])
553+
>>> print(result)
548554
[(1.5707963267948966, 4.71238898038469), (1.5707963267948966, 4.71238898038469)]
549555
550556
"""
@@ -568,7 +574,8 @@ def angle_vectors(left, right):
568574
569575
Examples
570576
--------
571-
>>> Vector.angle_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]], [[0.0, 1.0, 0.0], [0.0, 0.0, 2.0]])
577+
>>> result = Vector.angle_vectors([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]], [[0.0, 1.0, 0.0], [0.0, 0.0, 2.0]])
578+
>>> print(result)
572579
[1.5707963267948966, 1.5707963267948966]
573580
574581
"""
@@ -781,8 +788,9 @@ def cross(self, other):
781788
--------
782789
>>> u = Vector(1.0, 0.0, 0.0)
783790
>>> v = Vector(0.0, 1.0, 0.0)
784-
>>> u.cross(v)
785-
Vector(0.000, 0.000, 1.000)
791+
>>> w = u.cross(v)
792+
>>> print(w)
793+
Vector(x=0.000, y=0.000, z=1.000)
786794
787795
"""
788796
return Vector(*cross_vectors(self, other))
@@ -896,8 +904,8 @@ def transform(self, T):
896904
>>> u = Vector(1.0, 0.0, 0.0)
897905
>>> R = Rotation.from_axis_and_angle([0.0, 0.0, 1.0], math.radians(90))
898906
>>> u.transform(R)
899-
>>> u
900-
Vector(0.000, 1.000, 0.000)
907+
>>> print(u)
908+
Vector(x=0.000, y=1.000, z=0.000)
901909
902910
"""
903911
point = transform_vectors([self], T)[0]
@@ -924,8 +932,8 @@ def transformed(self, T):
924932
>>> u = Vector(1.0, 0.0, 0.0)
925933
>>> R = Rotation.from_axis_and_angle([0.0, 0.0, 1.0], math.radians(90))
926934
>>> v = u.transformed(R)
927-
>>> v
928-
Vector(0.000, 1.000, 0.000)
935+
>>> print(v)
936+
Vector(x=0.000, y=1.000, z=0.000)
929937
930938
"""
931939
vector = self.copy()

src/compas/linalg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def pivots(U, tol=None):
169169
Examples
170170
--------
171171
>>> A = [[1, 0, 1, 3], [2, 3, 4, 7], [-1, -3, -3, -4]]
172-
>>> n = rref_sympy(A)
173-
>>> pivots(n)
172+
>>> n = rref(A)
173+
>>> pivots(n) # doctest: +SKIP
174174
[0, 1]
175175
176176
"""
@@ -207,8 +207,8 @@ def nonpivots(U, tol=None):
207207
Examples
208208
--------
209209
>>> A = [[1, 0, 1, 3], [2, 3, 4, 7], [-1, -3, -3, -4]]
210-
>>> n = rref_sympy(A)
211-
>>> nonpivots(n)
210+
>>> n = rref(A)
211+
>>> nonpivots(n) # doctest: +SKIP
212212
[2, 3]
213213
214214
"""

src/compas/scene/scene.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class Scene(Tree):
3333
>>> from compas.geometry import Box
3434
>>> scene = Scene()
3535
>>> box = Box.from_width_height_depth(1, 1, 1)
36-
>>> scene.add(box)
37-
>>> scene.draw()
36+
>>> boxobj = scene.add(box)
37+
>>> scene.draw() # doctest: +SKIP
3838
3939
"""
4040

src/compas/tolerance.py

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -529,16 +529,29 @@ def is_close(self, a, b, rtol=None, atol=None):
529529
Examples
530530
--------
531531
>>> tol = Tolerance()
532-
>>> tol.is_close(1.0, 1.000001)
533-
True
534-
>>> tol.is_close(1.0, 1.00001)
535-
True
536-
>>> tol.is_close(1.0, 1.0001)
532+
533+
>>> tol.is_close(1.0, 1.0 + 1e-5)
534+
False
535+
>>> tol.is_close(1.0, 1.0 + 1e-6)
537536
True
538-
>>> tol.is_close(1.0, 1.001)
537+
538+
>>> tol.is_close(0.1, 0.1 + 1e-5)
539+
False
540+
>>> tol.is_close(0.1, 0.1 + 1e-6)
541+
False
542+
>>> tol.is_close(0.1, 0.1 + 1e-7)
539543
True
540-
>>> tol.is_close(1.0, 1.01)
544+
545+
>>> tol.is_close(0, 0 + 1e-5)
541546
False
547+
>>> tol.is_close(0, 0 + 1e-6)
548+
False
549+
>>> tol.is_close(0, 0 + 1e-7)
550+
False
551+
>>> tol.is_close(0, 0 + 1e-8)
552+
False
553+
>>> tol.is_close(0, 0 + 1e-9)
554+
True
542555
543556
"""
544557
rtol = rtol or self.relative
@@ -570,12 +583,14 @@ def is_allclose(self, A, B, rtol=None, atol=None):
570583
Examples
571584
--------
572585
>>> tol = Tolerance()
573-
>>> tol.is_allclose([0.0, 0.0], [1e-7, 1e-7])
574-
True
575-
>>> tol.is_allclose([0.0, 0.0], [1e-6, 1e-6])
586+
>>> tol.is_allclose([1.0, 1.0], [1.0 + 1e-5, 1.0 + 1e-6])
587+
False
588+
>>> tol.is_allclose([1.0, 1.0], [1.0 + 1e-6, 1.0 + 1e-6])
576589
True
577-
>>> tol.is_allclose([0.0, 0.0], [1e-6, 1e-5])
590+
>>> tol.is_allclose([0.0, 0.0], [0.0 + 1e-8, 0.0 + 1e-9])
578591
False
592+
>>> tol.is_allclose([0.0, 0.0], [0.0 + 1e-9, 0.0 + 1e-9])
593+
True
579594
580595
"""
581596
rtol = rtol or self.relative
@@ -602,9 +617,9 @@ def is_angle_zero(self, a, tol=None):
602617
Examples
603618
--------
604619
>>> tol = Tolerance()
605-
>>> tol.is_zero_angle(1e-07)
620+
>>> tol.is_angle_zero(1e-07)
606621
True
607-
>>> tol.is_zero_angle(1e-05)
622+
>>> tol.is_angle_zero(1e-05)
608623
False
609624
610625
"""

src/compas/topology/combinatorics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def vertex_coloring(adjacency):
4747
>>> from compas.datastructures import Graph
4848
>>> graph = Graph.from_obj(compas.get("lines.obj"))
4949
>>> key_color = vertex_coloring(graph.adjacency)
50-
>>> key = graph.get_any_node()
50+
>>> key = graph.node_sample(size=1)[0]
5151
>>> color = key_color[key]
5252
>>> any(key_color[nbr] == color for nbr in graph.neighbors(key))
5353
False

0 commit comments

Comments
 (0)