Skip to content

Allow in place operators to modify coordinates#5214

Open
dham wants to merge 1 commit into
mainfrom
dham/inplace_coordinate_operators
Open

Allow in place operators to modify coordinates#5214
dham wants to merge 1 commit into
mainfrom
dham/inplace_coordinate_operators

Conversation

@dham

@dham dham commented Jul 3, 2026

Copy link
Copy Markdown
Member

Replacing the coordinates property of a mesh is not allowed for lots of good reasons.

However, the Python implementation of in place operators does assignment. That is to say:

mesh.coordinates += 1.

is equivalent to:

mesh.coordinates = mesh.coordinates.__iadd__(1.)

This triggers the error even though mesh.coordinates.__iadd__ returns mesh.coordinates. This PR relaxes the error check so that assigning mesh.coordinates itself (i.e. a no-op) is allowed.

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