-
Notifications
You must be signed in to change notification settings - Fork 8
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
merge_partitions
fails for datasets with multiple topologies
#134
Comments
Debugged this, it appears the issue stems from the fact that the 1D grid only occurs in one partition, whereas the 2D grid occurs in all four partitions. What would be appropriate behavior here @Huite : Be strict, as is the current behavior, or allow Datasets with a mix of 2D grids as well as 1D grid in some partitions? |
For visual reference, this issue contains an image of the grid: Deltares/dfm_tools#497 |
Good question. It seems reasonable to allow this. The check is easy to adapt by also checking for length 1: n = n_partition
if not all(len(v) == n or len(v) == 1 for v in grouped.values()):
raise ValueError(
f"Expected {n} UGRID topologies for {n} partitions, received: " f"{grouped}"
) Maybe everything already __ just __ works if you only remove the check? Probably not, because the grid topologies are zipped with the data_objects. So if the single topology happens to be in the first partition, it'll work, but not if it's in the third. |
Issue #134 merge partitions with inconsistent grids amongst partitions
Merging partitions with multiple topologies (1D2D model) raises:
"ValueError: Expected 4 UGRID topologies for 4 partitions, received: [...]"
MWE:
The text was updated successfully, but these errors were encountered: