xarray_mergeload

PlasmaCalcs.tools.xarray_tools.xarray_io.xarray_mergeload(dirpath, *, verbose=True, ngroup=UNSET, kw_merge={}, _merge=True, **kw__xarray_load)

xarray_load all .pcxarr files from dirpath, then xr.merge() the results.

kwargs will be passed to xarray_load.
verbose: bool or int
whether to print progress updates.
0: never print progress updates
1: print updates every DEFAULTS.PROGRESS_UPDATES_PRINT_FREQ seconds (default: 2)
2: print updates every file.
ngroup: int>=2, None, or UNSET
[EFF] max number of arrays per xr.merge() call. See xarray_merge for more detauls.
(Final results should be unaffected by ngroup, just affects internal strategy.)
UNSET –> use DEFAULTS.XARRAY_MERGE_NGROUP (default: 16).
None –> merge all arrays in a single xr.merge() call.
int>=2 –> merge arrays in groups of size ngroup, then merge the merged groups.
(This can be much faster than ngroup=None; see xarray_merge for details.)
kw_merge: dict
kwargs to pass to xr.merge().
_merge: bool
whether to actually merge all loaded arrays.
False –> just return list of loaded arrays. Can be useful for debugging.
If mergeload(merge=True) is taking too long, also consider using ngroup.