Skip to content

Add lock on geometry when setting values manually - #51

Merged
olemarius90 merged 4 commits into
masterfrom
feature/add_probe_geometry_lock
Sep 8, 2026
Merged

olemarius90 merged 4 commits into
masterfrom
feature/add_probe_geometry_lock

Conversation

@olemarius90

@olemarius90 olemarius90 commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a protected lock_geometry flag to uff.probe that prevents update() from overwriting manually-set element geometry
  • When .geometry is set directly (e.g. from external element positions), it is now locked so that subsequent property setters (pitch, N, radius) do not silently recompute and overwrite it
  • Internal update() calls reset the lock after computing geometry, so the normal workflow (set N, pitch, radius) is unaffected
  • Applied to all probe subclasses: linear_array, curvilinear_array, matrix_array, curvilinear_matrix_array

Motivation

When integrating with external toolboxes (e.g. GEWH Voluson converter), element positions from the external source were set via .geometry, but then overwritten when .pitch or .radius were set afterwards. This caused coordinate mismatches between probe positions and source/origin definitions.

Cherry-picked from ustb/ustb Bitbucket PR 203 by Anders Vraalstad.

Test plan

  • Existing uff_probe_test passes (tests use N/pitch, never set geometry manually)
  • Verified with GEWH converter: manually-set geometry is preserved after pitch/radius assignment
  • Review that no existing examples rely on geometry being overwritten after manual assignment

Made with Cursor

olemarius90 and others added 4 commits May 27, 2026 16:33
When probe geometry is set manually via the .geometry property (e.g. from
external element positions), subsequent property setters (pitch, N, radius)
triggered update() which silently overwrote the manual geometry with
computed positions. This caused coordinate mismatches when integrating
with external toolboxes that provide their own element positions.

Add a protected lock_geometry flag to uff.probe that is set to true by
set.geometry and checked by update() in all probe subclasses. Internal
updates reset the lock to false after computing geometry.

Cherry-picked from ustb/ustb Bitbucket PR #203 by Anders Vraalstad.

Co-authored-by: Cursor <cursoragent@cursor.com>
@olemarius90
olemarius90 merged commit a539fbe into master Sep 8, 2026
3 checks passed
@olemarius90
olemarius90 deleted the feature/add_probe_geometry_lock branch September 8, 2026 09:01
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.

1 participant