Skip to content

Fix parameter names in three compas.geometry docstrings - #1538

Merged
gonzalocasas merged 1 commit into
compas-dev:mainfrom
mmporong:docs-geometry-param-names
Oct 28, 2026
Merged

gonzalocasas merged 1 commit into
compas-dev:mainfrom
mmporong:docs-geometry-param-names

Conversation

@mmporong

Copy link
Copy Markdown
Contributor

Three docstrings in compas.geometry document parameters that the functions do not have:

  • Shear.from_entries(shear_entries) documented the argument as shear_factors.
  • Polyline.split_by_length(length, strict=True) documented a tol argument. The method has no tol; the entry looks copied from divide_by_length, which does take one.
  • trimesh_gradient_numpy(M, rtype="array") documented separate V and F arguments, but it takes a single M and unpacks it as V, F = M (as trimesh_descent_numpy calls it, trimesh_gradient_numpy((V, F))). The entry now follows the wording of the other trimesh_* functions that take M.

I found these by comparing the documented parameter names with the function signatures. After the change, the comparison reports no mismatch for these three functions. The doctests in shear.py and the split_by_length examples still pass, and trimesh_gradient_numpy((V, F)) runs on a one-triangle mesh. Docstrings and changelog only.

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas.datastructures.Mesh.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

- Shear.from_entries: the argument is shear_entries, not shear_factors.
- Polyline.split_by_length: remove the tol entry; the method has no tol
  argument (the docstring was copied from divide_by_length).
- trimesh_gradient_numpy: the function takes one argument M = (V, F),
  not separate V and F arguments.

@gonzalocasas gonzalocasas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

@gonzalocasas
gonzalocasas merged commit 0c2d98d into compas-dev:main Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants