Adds a warning whenever a _mesh is different for a field when added to a FieldSet, or during Fieldset creation#2761
Conversation
for more information, see https://pre-commit.ci
|
It is unclear to me whether a call to |
|
Thanks @wyatt-fluidnumerics!
Yes, I would also add this test when adding constant fields. And any errors in the test suite should will then have to be patched? |
…ly combine/create FieldSets with the same underlying mesh
|
I added the check to |
erikvansebille
left a comment
There was a problem hiding this comment.
Thanks @wyatt-fluidnumerics. Happy for this to be merged!
Description
Currently, mixing
"flat"and"spherical"meshes in a FieldSet is allowed without warning. This can happen without intention whenever a field is created with the default mesh, which may not be the same mesh as underlies the rest of the FieldSet. This PR adds a function_warn_if_fields_use_different_meshes(fields: Iterable[Field | VectorField])infieldset.pywhich produces aFieldSetWarningif fields in the input iterable have different _mesh in their underlying grid. A call to the function is also added at the end ofFieldSet.__init__andFieldSet.add_fieldChecklist
mainfor normal development,v3-supportfor v3 support)AI Disclosure