Skip to content

Commit b68a690

Browse files
committed
docstring cleanup
1 parent ed15315 commit b68a690

File tree

21 files changed

+339
-342
lines changed

21 files changed

+339
-342
lines changed

src/compas_model/datastructures/bvh.py

Lines changed: 42 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ class BVHNode(TreeNode):
2525
2626
Parameters
2727
----------
28-
objects : list[tuple[int, :class:`compas.geometry.Point`, list[:class:`compas.geometry.Point`]]]
28+
objects : list[tuple[int, Point, list[Point]]]
2929
The objects contained by the node.
3030
3131
Attributes
3232
----------
33-
box : :class:`compas.geometry.Box`
33+
box : Box
3434
The bounding volume box.
3535
The type of box depends on the type of node.
3636
@@ -70,11 +70,11 @@ def intersect_line(self, line: Line) -> Generator["BVHNode", None, None]:
7070
7171
Parameters
7272
----------
73-
line : :class:`compas.geometry.Line`
73+
line : Line
7474
7575
Yields
7676
------
77-
:class:`BVHNode`
77+
BVHNode
7878
7979
"""
8080
raise NotImplementedError
@@ -84,11 +84,11 @@ def intersect_box(self, box: Box) -> Generator["BVHNode", None, None]:
8484
8585
Parameters
8686
----------
87-
box : :class:`compas.geometry.Box`
87+
box : Box
8888
8989
Yields
9090
------
91-
:class:`BVHNode`
91+
BVHNode
9292
9393
"""
9494
raise NotImplementedError
@@ -98,11 +98,11 @@ def intersect_sphere(self, sphere: Sphere) -> Generator["BVHNode", None, None]:
9898
9999
Parameters
100100
----------
101-
sphere : :class:`compas.geometry.Sphere`
101+
sphere : Sphere
102102
103103
Yields
104104
------
105-
:class:`BVHNode`
105+
BVHNode
106106
107107
"""
108108
raise NotImplementedError
@@ -116,7 +116,7 @@ def compute_box(self) -> Box:
116116
117117
Returns
118118
-------
119-
:class:`compas.geometry.Box`
119+
Box
120120
121121
"""
122122
points = [point for o in self.objects for point in o[2]]
@@ -127,11 +127,11 @@ def intersect_line(self, line: Line) -> Generator["AABBNode", None, None]:
127127
128128
Parameters
129129
----------
130-
line : :class:`compas.geometry.Line`
130+
line : Line
131131
132132
Yields
133133
------
134-
:class:`AABBNode`
134+
AABBNode
135135
136136
"""
137137
queue = [self]
@@ -146,11 +146,11 @@ def intersect_box(self, box: Box) -> Generator["AABBNode", None, None]:
146146
147147
Parameters
148148
----------
149-
box : :class:`compas.geometry.Box`
149+
box : Box
150150
151151
Yields
152152
------
153-
:class:`OBBNode`
153+
OBBNode
154154
155155
"""
156156
queue = [self]
@@ -169,7 +169,7 @@ def compute_box(self) -> Box:
169169
170170
Returns
171171
-------
172-
:class:`compas.geometry.Box`
172+
Box
173173
174174
"""
175175
# if each primitive can compute its own OBB
@@ -183,11 +183,11 @@ def intersect_line(self, line: Line) -> Generator["OBBNode", None, None]:
183183
184184
Parameters
185185
----------
186-
line : :class:`compas.geometry.Line`
186+
line : Line
187187
188188
Yields
189189
------
190-
:class:`OBBNode`
190+
OBBNode
191191
192192
"""
193193
queue = [self]
@@ -202,11 +202,11 @@ def intersect_box(self, box: Box) -> Generator["OBBNode", None, None]:
202202
203203
Parameters
204204
----------
205-
box : :class:`compas.geometry.Box`
205+
box : Box
206206
207207
Yields
208208
------
209-
:class:`OBBNode`
209+
OBBNode
210210
211211
"""
212212
queue = [self]
@@ -221,11 +221,11 @@ def intersect_sphere(self, sphere: Sphere) -> Generator["OBBNode", None, None]:
221221
222222
Parameters
223223
----------
224-
sphere : :class:`compas.geometry.Sphere`
224+
sphere : Sphere
225225
226226
Yields
227227
------
228-
:class:`OBBNode`
228+
OBBNode
229229
230230
"""
231231
queue = [self]
@@ -241,24 +241,13 @@ class BVH(Tree):
241241
242242
Parameters
243243
----------
244-
nodetype : Type[:class:`AABBNode`] | Type[:class:`OBBNode`], optional
244+
nodetype : Type[AABBNode] | Type[OBBNode], optional
245245
The type of boundng volume node to use in the tree.
246246
max_depth : int, optional
247247
The maximum depth of the tree.
248248
leafsize : int, optional
249249
The number of objects contained by a leaf.
250250
251-
Notes
252-
-----
253-
This class has the following constructors:
254-
255-
* :meth:`BVH.from_triangles`
256-
* :meth:`BVH.from_mesh`
257-
258-
References
259-
----------
260-
...
261-
262251
Examples
263252
--------
264253
>>>
@@ -350,9 +339,9 @@ def from_triangles(
350339
351340
Parameters
352341
----------
353-
triangles : list[list[:class:`compas.geometry.Point`]]
342+
triangles : list[list[Point]]
354343
A list of triangles, with each triangle represented by three points.
355-
nodetype : Type[:class:`AABBNode`] | Type[:class:`OBBNode`], optional
344+
nodetype : Type[AABBNode] | Type[OBBNode], optional
356345
The type of node to use during construction.
357346
max_depth : int, optional
358347
The maximum depth of the tree.
@@ -361,7 +350,7 @@ def from_triangles(
361350
362351
Returns
363352
-------
364-
:class:`BVH`
353+
BVH
365354
366355
"""
367356
objects = [(index, Point(*centroid_points(abc)), abc) for index, abc in enumerate(triangles)]
@@ -382,9 +371,9 @@ def from_mesh(
382371
383372
Parameters
384373
----------
385-
mesh : :class:`compas.datastructures.Mesh`
374+
mesh : Mesh
386375
A mesh data structure.
387-
nodetype : Type[:class:`AABBNode`] | Type[:class:`OBBNode`], optional
376+
nodetype : Type[AABBNode] | Type[OBBNode], optional
388377
The type of node to use during construction.
389378
max_depth : int, optional
390379
The maximum depth of the tree.
@@ -393,7 +382,7 @@ def from_mesh(
393382
394383
Returns
395384
-------
396-
:class:`BVH`
385+
BVH
397386
398387
"""
399388
faces = list(mesh.faces())
@@ -417,9 +406,9 @@ def from_polyhedrons(
417406
418407
Parameters
419408
----------
420-
polyhedrons : list[:class:`compas.geometry.Polyhedron`]
409+
polyhedrons : list[Polyhedron]
421410
A list of polyhedron objects.
422-
nodetype : Type[:class:`AABBNode`] | Type[:class:`OBBNode`], optional
411+
nodetype : Type[AABBNode] | Type[OBBNode], optional
423412
The type of node to use during construction.
424413
max_depth : int, optional
425414
The maximum depth of the tree.
@@ -428,7 +417,7 @@ def from_polyhedrons(
428417
429418
Returns
430419
-------
431-
:class:`BVH`
420+
BVH
432421
433422
"""
434423
raise NotImplementedError
@@ -445,9 +434,9 @@ def from_meshes(
445434
446435
Parameters
447436
----------
448-
meshes : list[:class:`compas.datastructure.Mesh`]
437+
meshes : list[Mesh]
449438
A list of mesh objects.
450-
nodetype : Type[:class:`AABBNode`] | Type[:class:`OBBNode`], optional
439+
nodetype : Type[AABBNode] | Type[OBBNode], optional
451440
The type of node to use during construction.
452441
max_depth : int, optional
453442
The maximum depth of the tree.
@@ -456,7 +445,7 @@ def from_meshes(
456445
457446
Returns
458447
-------
459-
:class:`BVH`
448+
BVH
460449
461450
"""
462451
raise NotImplementedError
@@ -473,9 +462,9 @@ def from_breps(
473462
474463
Parameters
475464
----------
476-
breps : list[:class:`compas.geometry.Brep`]
465+
breps : list[Brep]
477466
A list of brep objects.
478-
nodetype : Type[:class:`AABBNode`] | Type[:class:`OBBNode`], optional
467+
nodetype : Type[AABBNode] | Type[OBBNode], optional
479468
The type of node to use during construction.
480469
max_depth : int, optional
481470
The maximum depth of the tree.
@@ -484,7 +473,7 @@ def from_breps(
484473
485474
Returns
486475
-------
487-
:class:`BVH`
476+
BVH
488477
489478
"""
490479
raise NotImplementedError
@@ -498,11 +487,11 @@ def intersect_line(self, line: Line) -> Generator[BVHNode, None, None]:
498487
499488
Parameters
500489
----------
501-
line : :class:`compas.geometry.Line`
490+
line : Line
502491
503492
Yields
504493
------
505-
:class:`BVHNode`
494+
BVHNode
506495
507496
"""
508497
if self.root:
@@ -514,11 +503,11 @@ def intersect_box(self, box: Box) -> Generator[BVHNode, None, None]:
514503
515504
Parameters
516505
----------
517-
box : :class:`compas.geometry.Box`
506+
box : Box
518507
519508
Yields
520509
------
521-
:class:`BVHNode`
510+
BVHNode
522511
523512
"""
524513
if self.root:
@@ -530,11 +519,11 @@ def intersect_sphere(self, sphere: Sphere) -> Generator[BVHNode, None, None]:
530519
531520
Parameters
532521
----------
533-
sphere : :class:`compas.geometry.Sphere`
522+
sphere : Sphere
534523
535524
Yields
536525
------
537-
:class:`BVHNode`
526+
BVHNode
538527
539528
"""
540529
if self.root:

src/compas_model/datastructures/kdtree.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class KDTree:
3535
3636
Parameters
3737
----------
38-
objects : sequence[[float, float, float] | :class:`compas.geometry.Point`], optional
38+
objects : sequence[[float, float, float] | Point], optional
3939
A list of objects to populate the tree with.
4040
If objects are provided, the tree is built automatically.
4141
Otherwise, use :meth:`build`.
@@ -85,14 +85,14 @@ def nearest_neighbor(self, point: Point, exclude: Optional[list["Element"]] = No
8585
8686
Parameters
8787
----------
88-
point : :class:`compas.geometry.Point`
88+
point : Point
8989
The base point.
90-
exclude : list[:class:`compas_model.elements.Element`], optional
90+
exclude : list[Element], optional
9191
A sequence of point identified by their label to exclude from the search.
9292
9393
Returns
9494
-------
95-
tuple[:class:`compas_model.elements.Element`, float]
95+
tuple[Element, float]
9696
XYZ coordinates of the nearest neighbor.
9797
Label of the nearest neighbor.
9898
Distance to the base point.
@@ -128,7 +128,7 @@ def nearest_neighbors(self, point: Point, number: int, distance_sort: bool = Fal
128128
129129
Parameters
130130
----------
131-
point : :class:`compas.geometry.Point`
131+
point : Point
132132
The base point.
133133
number : int
134134
The number of nearest neighbors.

0 commit comments

Comments
 (0)