Skip to content

Commit aa9f0d7

Browse files
authored
Fix parameter names in docstrings (#2118)
* Fix parameter names in docstrings Workplane (inPlane), Workplane.translate (vec), Workplane.each (callback), Workplane.twistExtrude (angleDegrees), Workplane.sweep (multisection), Mixin1D.curvatures (ds) and DxfDocument.add_shape (shape) documented their parameters under old names, and Mixin1D.paramsLength also documented a pts parameter it does not take. * Remove duplicated Workplane constructor parameter documentation
1 parent 8df1d11 commit aa9f0d7

3 files changed

Lines changed: 8 additions & 19 deletions

File tree

‎cadquery/cq.py‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,6 @@ class Workplane(object):
125125
"""
126126
Defines a coordinate system in space, in which 2D coordinates can be used.
127127
128-
:param plane: the plane in which the workplane will be done
129-
:type plane: a Plane object, or a string in (XY|YZ|XZ|front|back|top|bottom|left|right)
130-
:param origin: the desired origin of the new workplane
131-
:type origin: a 3-tuple in global coordinates, or None to default to the origin
132-
:param obj: an object to use initially for the stack
133-
:type obj: a CAD primitive, or None to use the centerpoint of the plane as the initial
134-
stack value.
135-
:raises: ValueError if the provided plane is not a plane, a valid named workplane
136-
:return: A Workplane object, with coordinate system matching the supplied plane.
137-
138128
The most common use is::
139129
140130
s = Workplane("XY")
@@ -1169,8 +1159,8 @@ def translate(self: T, vec: VectorLike) -> T:
11691159
"""
11701160
Returns a copy of all of the items on the stack moved by the specified translation vector.
11711161
1172-
:param tupleDistance: distance to move, in global coordinates
1173-
:type tupleDistance: a 3-tuple of float
1162+
:param vec: distance to move, in global coordinates
1163+
:type vec: a 3-tuple of float
11741164
:returns: a CQ object
11751165
"""
11761166
return self.newObject(
@@ -2389,7 +2379,7 @@ def each(
23892379
23902380
Special note: a newly created workplane always has its center point as its only stack item
23912381
2392-
:param callBackFunction: the function to call for each item on the current stack.
2382+
:param callback: the function to call for each item on the current stack.
23932383
:param useLocalCoordinates: should values be converted from local coordinates first?
23942384
:param combine: True or "a" to combine the resulting solid with parent solids if found,
23952385
"cut" or "s" to remove the resulting solid from the parent solids if found.
@@ -2399,7 +2389,7 @@ def each(
23992389
24002390
The callback function must accept one argument, which is the item on the stack, and return
24012391
one object, which is collected. If the function returns None, nothing is added to the stack.
2402-
The object passed into the callBackFunction is potentially transformed to local coordinates,
2392+
The object passed into the callback is potentially transformed to local coordinates,
24032393
if useLocalCoordinates is true
24042394
24052395
useLocalCoordinates is very useful for plugin developers.
@@ -2997,7 +2987,7 @@ def twistExtrude(
29972987
complex geometries
29982988
29992989
:param distance: the distance to extrude normal to the workplane
3000-
:param angle: angle (in degrees) to rotate through the extrusion
2990+
:param angleDegrees: angle (in degrees) to rotate through the extrusion
30012991
:param combine: True or "a" to combine the resulting solid with parent solids if found,
30022992
"cut" or "s" to remove the resulting solid from the parent solids if found.
30032993
False to keep the resulting solid separated from the parent solids.
@@ -3172,7 +3162,7 @@ def sweep(
31723162
Use all un-extruded wires in the parent chain to create a swept solid.
31733163
31743164
:param path: A wire along which the pending wires will be swept
3175-
:param multiSection: False to create multiple swept from wires on the chain along path.
3165+
:param multisection: False to create multiple swept from wires on the chain along path.
31763166
True to create only one solid swept along path with shape following the list of wires on the chain
31773167
:param combine: True or "a" to combine the resulting solid with parent solids if found,
31783168
"cut" or "s" to remove the resulting solid from the parent solids if found.

‎cadquery/occ_impl/exporters/dxf.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def add_layer(
150150
def add_shape(self, shape: Union[WorkplaneLike, Shape], layer: str = "") -> Self:
151151
"""Add CadQuery shape to a DXF layer.
152152
153-
:param s: CadQuery Workplane or Shape
153+
:param shape: CadQuery Workplane or Shape
154154
:param layer: layer definition name
155155
"""
156156

‎cadquery/occ_impl/shapes.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,7 +2265,6 @@ def paramsLength(self: Mixin1DProtocol, locations: Iterable[float]) -> list[floa
22652265
22662266
:param locations: list of distances.
22672267
:returns: list of u values.
2268-
:param pts: the points to compute the parameters at.
22692268
"""
22702269

22712270
us = []
@@ -2601,7 +2600,7 @@ def curvatures(
26012600
"""
26022601
Calculate mean curvatures along the underlying curve.
26032602
2604-
:param d: distance or parameter values
2603+
:param ds: distance or parameter values
26052604
:param mode: position calculation mode (default: length)
26062605
:param resolution: resolution of the calculation (default: 1e-6)
26072606
:return: mean curvature value at the specified d value.

0 commit comments

Comments
 (0)