Skip to content
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 grid with long_culverts #86

Closed
veenstrajelmer opened this issue Jun 1, 2023 · 1 comment
Closed

merge_partitions fails for grid with long_culverts #86

veenstrajelmer opened this issue Jun 1, 2023 · 1 comment

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Jun 1, 2023

Raises "ValueError: Expected 3 UGRID topologies for 3 partitions, received: defaultdict [...]"

MWE:

import xugrid as xu

file_nc_list = ['p:\\11209233-mad09a-2023-rijn\\C_Work\\02_lange_duikers\\02_berekeningen\\dflowfm2d-rijn-j19_6-v2a\\computations\\hist\\hw2018_kort\\v15\\results\\converted_RIJN_0000_map.nc',
                'p:\\11209233-mad09a-2023-rijn\\C_Work\\02_lange_duikers\\02_berekeningen\\dflowfm2d-rijn-j19_6-v2a\\computations\\hist\\hw2018_kort\\v15\\results\\converted_RIJN_0001_map.nc',
                'p:\\11209233-mad09a-2023-rijn\\C_Work\\02_lange_duikers\\02_berekeningen\\dflowfm2d-rijn-j19_6-v2a\\computations\\hist\\hw2018_kort\\v15\\results\\converted_RIJN_0002_map.nc',
                ]


chunks={'time':1} 
partitions = []
for iF, file_nc_one in enumerate(file_nc_list):
    uds = xu.open_dataset(file_nc_one, chunks=chunks)
    partitions.append(uds)
ds_merged_xu = xu.merge_partitions(partitions)

When supplying only the partition with long_culverts (the second one), it raises "ValueError: indexes must be provided for attrs". The grid of the single partition can also not be plotted, it raises "TypeError: Can only access grid topology via .grid if dataset contains exactly one grid. Dataset contains 3 grids. Use .grids instead."

This is related to #134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants