Closed veenstrajelmer closed 7 months ago
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: https://github.com/Deltares/dfm_tools/issues/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.
Merging partitions with multiple topologies (1D2D model) raises:
"ValueError: Expected 4 UGRID topologies for 4 partitions, received: [...]"
MWE: