You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the python bindings will catch this, but throw only a generic error:
File "mysolver.py", line 75, in main
vertex_ids = Interface.set_mesh_vertices(mesh_id, vertices)
File "precice.pyx", line 525, in precice.Interface.set_mesh_vertices
AssertionError
preCICE itself should already catch this (and it give a clear error), so this raises the question whether we really need this duplicate error checking.
I understand that there is probably a good for having this assertion here (I vaguely remember a long discussion about it), but we need then an informative error message.
I am using preCICE v2.1.1 and the python bindings v2.1.1.1.
The text was updated successfully, but these errors were encountered:
The assertion hit indeed does not give a clear idea of what went wrong. Improved error messages for the python bindings is ongoing work here: #9 and will be completed in the near-future. This particular assertion will then provide a proper message stating what went wrong.
The philosophy followed for the python bindings is that whichever errors can be caught at the bindings API level should be caught. Some points in favour of this argumentation:
Since we can derive the shape of an array in python it is relevant to catch errors then and there as the user might provide arrays of incorrect dimensions
A user of preCICE who is writing a code in python would be more comfortable to have a pythonic error feedback
When providing e.g. an array of 2D points:
to a 3D mesh:
the python bindings will catch this, but throw only a generic error:
preCICE itself should already catch this (and it give a clear error), so this raises the question whether we really need this duplicate error checking.
I understand that there is probably a good for having this assertion here (I vaguely remember a long discussion about it), but we need then an informative error message.
I am using preCICE v2.1.1 and the python bindings v2.1.1.1.
The text was updated successfully, but these errors were encountered: