When passing [] to xu.merge_partitions() it raises KeyError: 'pop from an empty set':
>> xu.merge_partitions() with 0 partition(s): Traceback (most recent call last):
File ~\Anaconda3\envs\dfm_tools_env\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)
File c:\data\dfm_tools\dfm_tools\untitled0.py:29
uds = xu.merge_partitions(partitions)
File ~\Anaconda3\envs\dfm_tools_env\Lib\site-packages\xugrid\ugrid\partitioning.py:336 in merge_partitions
obj_type = types.pop()
KeyError: 'pop from an empty set'
This is a bit of a silly issue, but the usecase is using a file pattern that is expanded to a list of files. If there is no connection to P, or there is a typo in the file pattern, glob will generate an empty list. This is not catched in xu.merge_partitions(). Might be useful to add it, although I think this is the first time in a few years I have encountered it. So feel free to close this as "won't do".
When passing
[]
toxu.merge_partitions()
it raisesKeyError: 'pop from an empty set'
:This is a bit of a silly issue, but the usecase is using a file pattern that is expanded to a list of files. If there is no connection to P, or there is a typo in the file pattern, glob will generate an empty list. This is not catched in
xu.merge_partitions()
. Might be useful to add it, although I think this is the first time in a few years I have encountered it. So feel free to close this as "won't do".