-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle writing of empty arrays to preCICE #69
Conversation
I converted this PR to a draft, since there are still some errors in the source code that the tests run into (see Travis). Do you already want me to do a review now or do you first fix the errors? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some formatting changes in setup.py
. If they are necessary due to code style, please directly commit them to develop. Don't add them to this PR.
Formatting changes to |
The error in tests was just due to a small spelling mistake. It is now rectified and PR is ready for review 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Minor point regarding the non-block
operations. I also added some tests in 86fc5d4 that worked nicely.
I also checked that the new tests actually fail for the current state of develop
and got the following error:
======================================================================
ERROR: test_read_write_block_scalar_data_empty (test_bindings_module.TestBindings)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test/test_bindings_module.pyx", line 201, in test_bindings_module.TestBindings.test_read_write_block_scalar_data_empty
solver_interface.write_block_scalar_data(1, [], write_data)
File "precice.pyx", line 952, in precice.Interface.write_block_scalar_data
size = vertex_ids.size
AttributeError: 'list' object has no attribute 'size'
======================================================================
ERROR: test_read_write_block_vector_data_empty (test_bindings_module.TestBindings)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test/test_bindings_module.pyx", line 237, in test_bindings_module.TestBindings.test_read_write_block_vector_data_empty
solver_interface.write_block_vector_data(1, [], write_data)
File "precice.pyx", line 871, in precice.Interface.write_block_vector_data
size, dimensions = values.shape
ValueError: need more than 1 value to unpack
----------------------------------------------------------------------
Co-authored-by: Benjamin Rüth <[email protected]>
* Correcting spelling mistake Co-authored-by: Benjamin Rüth <[email protected]> Co-authored-by: BenjaminRueth <[email protected]>
In a parallel coupling case, ranks which have no part of the coupling interface will call the write data functionality with empty data structures. The bindings need to handle this as the main preCICE API allows this.