Skip to content

Commit

Permalink
Merge pull request #58630 from nyalldawson/sip_out
Browse files Browse the repository at this point in the history
Correctly handle multiline SIP_OUT param documentation
  • Loading branch information
troopa81 authored Sep 10, 2024
2 parents c223344 + 391b615 commit 6fd8790
Show file tree
Hide file tree
Showing 114 changed files with 405 additions and 348 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Transforms the specified input ``geometry`` using the GCP based transform.
If this is done, the geometry will be left in a semi-transformed state.

:return: - transformed geometry
- ok: will be set to ``True`` if geometry was successfully transformed, or ``False`` if an error occurred
- ok: ``True`` if geometry was successfully transformed, or ``False`` if an error occurred
%End

QgsGcpTransformerInterface *gcpTransformer() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ Make a graph using :py:class:`QgsGraphBuilder`

:param builder: the graph builder
:param additionalPoints: list of points that should be snapped to the graph
:param snappedPoints: list of snapped points
:param feedback: feedback object for reporting progress

.. note::

if snappedPoints[i] == QgsPointXY(0.0,0.0) then snapping failed.

:return: list of snapped points
%End

void addStrategy( QgsNetworkStrategy *prop /Transfer/ );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ This will calculate the classes for a given layer to define the classes.
:param nclasses: The number of classes to be returned

:return: - list of generated classes
- error: will be set to error string if an error occurred while generating the classes
- error: error string if an error occurred while generating the classes

.. versionadded:: 3.38
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,8 @@ Returns ``True`` if the given ``expression`` is a simple "field=value" type expr
:param expression: expression to test

:return: - ``True`` if the expression is a field equality expression
- field: will be set to the field name if the expression is a field equality expression
- value: will be set to the value if the expression is a field equality expression
- field: the field name if the expression is a field equality expression
- value: the value if the expression is a field equality expression

.. versionadded:: 3.18
%End
Expand All @@ -714,7 +714,7 @@ Returns ``True`` if the given ``expressions`` could be converted to an IN type e
:param expressions: expressions to test

:return: - ``True`` if the expression was converted to a field IN type expression
- result: will be set to the calculated "field IN (...)" expression, wherever possible
- result: the calculated "field IN (...)" expression, wherever possible

.. versionadded:: 3.18
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,11 @@ Returns the point corresponding to a specified vertex id
Searches for the closest segment of the geometry to a given point.

:param pt: specifies the point to find closest segment to
:param segmentPt: storage for the closest point within the geometry
:param vertexAfter: storage for the ID of the vertex at the end of the closest segment
:param epsilon: epsilon for segment snapping

:return: - squared distance to closest segment or negative value on error
- segmentPt: the closest point within the geometry
- vertexAfter: the ID of the vertex at the end of the closest segment
- leftOf: indicates whether the point lies on the left side of the geometry (-1 if point is to the left of the geometry, +1 if the point is to the right of the geometry, or 0 for cases where left/right could not be determined, e.g. point exactly on a line) ``False`` if point is to right of segment)
%End

Expand Down Expand Up @@ -784,7 +784,7 @@ Checks validity of the geometry, and returns ``True`` if the geometry is valid.
(corresponding to :py:class:`Qgis`.GeometryValidityFlags).

:return: - ``True`` if geometry is valid
- error: will be set to the validity error message
- error: the validity error message

.. versionadded:: 3.8
%End
Expand Down
4 changes: 2 additions & 2 deletions python/PyQt6/core/auto_generated/geometry/qgscurve.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ Returns the point and vertex id of a point within the curve.
:param node: node number, where the first node is 0

:return: - ``True`` if node exists within the curve
- point: will be set to point at corresponding node in the curve
- type: will be set to the vertex type of the node
- point: point at corresponding node in the curve
- type: the vertex type of the node
%End

virtual int indexOf( const QgsPoint &point ) const = 0;
Expand Down
8 changes: 4 additions & 4 deletions python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,10 @@ and the indices of the vertices before and after the closest vertex.
:param point: point to search for

:return: - closest point in geometry. If not found (empty geometry), returns null point and sqrDist is negative.
- closestVertexIndex: will be set to the vertex index of the closest found vertex
- previousVertexIndex: will be set to the vertex index of the previous vertex from the closest one. Will be set to -1 if not present.
- nextVertexIndex: will be set to the vertex index of the next vertex after the closest one. Will be set to -1 if not present.
- sqrDist: will be set to the square distance between the closest vertex and the specified point
- closestVertexIndex: the vertex index of the closest found vertex
- previousVertexIndex: the vertex index of the previous vertex from the closest one. Will be set to -1 if not present.
- nextVertexIndex: the vertex index of the next vertex after the closest one. Will be set to -1 if not present.
- sqrDist: the square distance between the closest vertex and the specified point
%End

double distanceToVertex( int vertex ) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,14 @@ Determines whether the geometry is simple (according to OGC definition).
Splits this geometry according to a given line.

:param splitLine: the line that splits the geometry
:param newGeometries: list of new geometries that have been created with the split
:param topological: ``True`` if topological editing is enabled
:param topologyTestPoints: points that need to be tested for topological completeness in the dataset
:param errorMsg: error messages emitted, if any
:param skipIntersectionCheck: set to ``True`` to skip the potentially expensive initial intersection check. Only set this flag if an intersection
test has already been performed by the caller!

:return: 0 in case of success, 1 if geometry has not been split, error else
:return: - 0 in case of success, 1 if geometry has not been split, error else
- newGeometries: list of new geometries that have been created with the split
%End

virtual QgsAbstractGeometry *offsetCurve( double distance, int segments, Qgis::JoinStyle joinStyle, double miterLimit, QString *errorMsg = 0 ) const = 0 /Factory/;
Expand Down
21 changes: 13 additions & 8 deletions python/PyQt6/core/auto_generated/geometry/qgsgeometryutils.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ Retrieves the vertices which are before and after the interpolated point at a sp

:param geometry: line or polygon geometry
:param distance: distance to traverse along geometry
:param previousVertex: will be set to previous vertex ID

:return: - ``True`` if vertices were successfully retrieved
- nextVertex: will be set to next vertex ID
- previousVertex: previous vertex ID
- nextVertex: next vertex ID

.. note::

Expand Down Expand Up @@ -368,6 +368,10 @@ Returns the coefficients (a, b, c for equation "ax + by + c = 0") of a line defi

:param pt1: first point.
:param pt2: second point.

:return: - a: Output parameter, a coefficient of the equation.
- b: Output parameter, b coefficient of the equation.
- c: Output parameter, c coefficient of the equation.
%End

static QgsLineString perpendicularSegment( const QgsPoint &p, const QgsPoint &s1, const QgsPoint &s2 ) /HoldGIL/;
Expand Down Expand Up @@ -808,12 +812,13 @@ The result is a line (segment) centered in point p and perpendicular to segment
:param segmentPoint1y: : y-coordinate of segmentPoint1, the segment's start point
:param segmentPoint2x: : x-coordinate of segmentPoint2, the segment's end point
:param segmentPoint2y: : y-coordinate of segmentPoint2, the segment's end point
:param perpendicularSegmentPoint1x: : x-coordinate of the perpendicularCenterSegment's start point
:param perpendicularSegmentPoint1y: : y-coordinate of the perpendicularCenterSegment's start point
:param perpendicularSegmentPoint2x: : x-coordinate of the perpendicularCenterSegment's end point
:param perpendicularSegmentPoint2y: : y-coordinate of the perpendicularCenterSegment's end point
:param segmentLength: (optional) Trims to given length. A segmentLength value of 0 refers to the default length which is double the length of the input segment. Set to 1 for a normalized length.

:return: - perpendicularSegmentPoint1x: : x-coordinate of the perpendicularCenterSegment's start point
- perpendicularSegmentPoint1y: : y-coordinate of the perpendicularCenterSegment's start point
- perpendicularSegmentPoint2x: : x-coordinate of the perpendicularCenterSegment's end point
- perpendicularSegmentPoint2y: : y-coordinate of the perpendicularCenterSegment's end point

.. versionadded:: 3.24

.. deprecated:: 3.40
Expand Down Expand Up @@ -848,10 +853,10 @@ A method to project one skew line onto another.
:param P12: is the second point that belongs to first skew line,
:param P2: is the first point that belongs to second skew line,
:param P22: is the second point that belongs to second skew line,
:param X1: is the result projection point of line P2P22 onto line P1P12,
:param epsilon: the tolerance to use.

:return: ``True`` if such point exists, ``False`` - otherwise.
:return: - ``True`` if such point exists, ``False`` - otherwise.
- X1: is the result projection point of line P2P22 onto line P1P12,

.. deprecated:: 3.40

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,13 @@ The result is a line (segment) centered in point p and perpendicular to segment
:param segmentPoint1y: : y-coordinate of segmentPoint1, the segment's start point
:param segmentPoint2x: : x-coordinate of segmentPoint2, the segment's end point
:param segmentPoint2y: : y-coordinate of segmentPoint2, the segment's end point
:param perpendicularSegmentPoint1x: : x-coordinate of the perpendicularCenterSegment's start point
:param perpendicularSegmentPoint1y: : y-coordinate of the perpendicularCenterSegment's start point
:param perpendicularSegmentPoint2x: : x-coordinate of the perpendicularCenterSegment's end point
:param perpendicularSegmentPoint2y: : y-coordinate of the perpendicularCenterSegment's end point
:param segmentLength: (optional) Trims to given length. A segmentLength value of 0 refers to the default length which is double the length of the input segment. Set to 1 for a normalized length.

:return: - perpendicularSegmentPoint1x: : x-coordinate of the perpendicularCenterSegment's start point
- perpendicularSegmentPoint1y: : y-coordinate of the perpendicularCenterSegment's start point
- perpendicularSegmentPoint2x: : x-coordinate of the perpendicularCenterSegment's end point
- perpendicularSegmentPoint2y: : y-coordinate of the perpendicularCenterSegment's end point

.. versionadded:: 3.24
%End

Expand Down Expand Up @@ -290,10 +291,10 @@ A method to project one skew line onto another.
:param P12: is the second point that belongs to first skew line,
:param P2: is the first point that belongs to second skew line,
:param P22: is the second point that belongs to second skew line,
:param X1: is the result projection point of line P2P22 onto line P1P12,
:param epsilon: the tolerance to use.

:return: ``True`` if such point exists, ``False`` - otherwise.
:return: - ``True`` if such point exists, ``False`` - otherwise.
- X1: is the result projection point of line P2P22 onto line P1P12,
%End

static bool linesIntersection3D( const QgsVector3D &La1, const QgsVector3D &La2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Returns the best fix status and corresponding constellation.


:return: - best current fix status
- constellation: will be set to the constellation with best fix status
- constellation: the constellation with best fix status

.. versionadded:: 3.30
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ This method is based of Richard's algorithm (1981) from "Continued Fractions wit
:param tolerance: acceptable tolerance. Larger values will give "nicer" fractions.

:return: - ``True`` if ``value`` was successfully converted to a fraction
- numerator: will be set to calculated fraction numerator
- denominator: will be set to the calculated fraction denominator
- sign: will be set to the sign of the result (as -1 or +1 values)
- numerator: calculated fraction numerator
- denominator: the calculated fraction denominator
- sign: the sign of the result (as -1 or +1 values)
%End

static QString toUnicodeSuperscript( const QString &input );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ to the triangle defined by (``outX1``, ``outY1``), (``outY2``, ``outY2``), (``ou
:param outY3: destination triangle vertex 3 y-coordinate

:return: - Calculated transform (if possible)
- ok: will be set to ``True`` if the transform could be determined.
- ok: ``True`` if the transform could be determined.

.. versionadded:: 3.34
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Validates the model, returning ``True`` if all child algorithms in the model are


:return: - ``True`` if the child is valid
- issues: will be set to a list of issues encountered during the validation
- issues: a list of issues encountered during the validation

.. versionadded:: 3.14
%End
Expand Down Expand Up @@ -211,7 +211,7 @@ all mandatory inputs to the algorithm have valid values.
:param childId: ID for child to validate

:return: - ``True`` if the child is valid
- issues: will be set to a list of issues encountered during the validation
- issues: a list of issues encountered during the validation

.. versionadded:: 3.14
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ Note that some combinations of parameter types and values cannot be represented
:param context: processing context

:return: - equivalent qgis_process command
- ok: will be set to ``True`` if the command was successfully generated
- ok: ``True`` if the command was successfully generated

.. versionadded:: 3.24
%End
Expand Down Expand Up @@ -777,7 +777,7 @@ a conversion in this case and will return the target layer name in the ``layerNa
:param feedback: feedback object

:return: - path to source layer, or nearly converted compatible layer
- layerName: will be set to the target layer name for multi-layer sources (e.g. Geopackage)
- layerName: the target layer name for multi-layer sources (e.g. Geopackage)

.. seealso:: :py:func:`parameterAsCompatibleSourceLayerPath`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Returns a string version of the parameter output ``value`` (if possible).
:param context: processing context

:return: - value converted to string
- ok: will be set to ``True`` if value could be represented as a string.
- ok: ``True`` if value could be represented as a string.

.. seealso:: :py:func:`valueAsFormattedString`

Expand All @@ -148,7 +148,7 @@ By default this will return the same value as :py:func:`~QgsProcessingOutputDefi
:param context: processing context

:return: - value converted to string
- ok: will be set to ``True`` if value could be represented as a string.
- ok: ``True`` if value could be represented as a string.

.. seealso:: :py:func:`valueAsString`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ Returns a string version of the parameter input ``value`` (if possible).
:param context: processing context

:return: - value converted to string
- ok: will be set to ``True`` if value could be represented as a string.
- ok: ``True`` if value could be represented as a string.

.. seealso:: :py:func:`valueAsStringList`

Expand All @@ -553,7 +553,7 @@ Returns a string list version of the parameter input ``value`` (if possible).
:param context: processing context

:return: - value converted to string list
- ok: will be set to ``True`` if value could be represented as a string list
- ok: ``True`` if value could be represented as a string list

.. seealso:: :py:func:`valueAsString`

Expand Down Expand Up @@ -1140,7 +1140,7 @@ a conversion in this case and will return the target layer name in the ``layerNa
:param feedback: feedback object

:return: - path to source layer, or nearly converted compatible layer
- layerName: will be set to the target layer name for multi-layer sources (e.g. Geopackage)
- layerName: the target layer name for multi-layer sources (e.g. Geopackage)

.. seealso:: :py:func:`parameterAsCompatibleSourceLayerPath`

Expand Down Expand Up @@ -3507,7 +3507,7 @@ calls :py:func:`QgsProcessingProvider.isSupportedOutputValue()` to test compatib
:param context: Processing context

:return: - ``True`` if ``value`` is supported.
- error: will be set to a descriptive error string
- error: a descriptive error string

.. versionadded:: 3.14
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,11 @@ a conversion in this case and will return the target layer name in the ``layerNa
:param preferredFormat: preferred format extension to use if conversion if required
:param context: processing context
:param feedback: feedback object
:param layerName: will be set to the target layer name for multi-layer sources (e.g. Geopackage)
:param featureLimit: can be used to place a limit on the maximum number of features read from the layer
:param filterExpression: optional expression for filtering features read from the layer (since QGIS 3.32)

:return: path to source layer, or nearly converted compatible layer
:return: - path to source layer, or nearly converted compatible layer
- layerName: the target layer name for multi-layer sources (e.g. Geopackage)

.. seealso:: :py:func:`convertToCompatibleFormat`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ or the compound CRS could not be created for the combination.
:param verticalCrs: vertical component for CRS

:return: - compound CRS if it was possible to create one, or an invalid CRS if not
- error: will be set to a descriptive error if the compound CRS could not be created
- error: a descriptive error if the compound CRS could not be created

.. versionadded:: 3.38
%End
Expand Down
6 changes: 3 additions & 3 deletions python/PyQt6/core/auto_generated/project/qgsproject.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ The :py:func:`~QgsProject.verticalCrsChanged` signal will be raised if the verti
:param crs: the vertical CRS

:return: - ``True`` if vertical CRS was successfully set
- errorMessage: will be set to a descriptive message if the vertical CRS could not be set
- errorMessage: a descriptive message if the vertical CRS could not be set

.. seealso:: :py:func:`verticalCrs`

Expand Down Expand Up @@ -2246,7 +2246,7 @@ that the user has some chance of repairing the damage cleanly.
parameter is not mandatory, as the changes from all layers will be committed.

:return: - ``True`` if the commit was successful.
- commitErrors: will be set to a list of descriptive errors if the commit fails.
- commitErrors: a list of descriptive errors if the commit fails.

.. seealso:: :py:func:`startEditing`

Expand All @@ -2265,7 +2265,7 @@ Stops a current editing operation on vectorLayer and discards any uncommitted ed
parameter is not mandatory, as the changes from all layers will be rolled back.

:return: - ``True`` if the rollback was successful.
- rollbackErrors: will be set to a list of descriptive errors if the rollback fails.
- rollbackErrors: a list of descriptive errors if the rollback fails.

.. seealso:: :py:func:`startEditing`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Caller takes ownership of the returned object.
:param hasZ: set to ``True`` to if geometry includes Z values

:return: - converted geometry
- crs: will be set to the parsed geometry CRS
- crs: the parsed geometry CRS
%End

static QgsCoordinateReferenceSystem convertSpatialReference( const QVariantMap &spatialReferenceMap );
Expand Down
Loading

0 comments on commit 6fd8790

Please sign in to comment.