Skip to content

Error using call_dms #65

@juychen

Description

@juychen

The call_dms function will raise an error of no file to open when some of the region chunks have empty enriched dms.
It is suggested to add a check on the length of chunks in the write_ordered_chunks function (335.utilities.py)


    for _, output_path in sorted(chunks_to_write.items(), key=lambda _i: _i[0]):
        # save chunk into the zarr
        chunk_ds = xr.open_dataset(output_path, engine=engine).load()
        obj_to_str(chunk_ds, coord_dtypes)
        if len(chunk_ds[append_dim]) < 1:
            # if the chunk is empty, skip
            continue
        if dtype is not None:
            chunk_ds = chunk_ds.astype(dtype)
        if not wrote:
            wrote = True
            # create the new da
            chunk_ds.to_zarr(final_path, mode="w")
        else:
            chunk_ds.to_zarr(final_path, mode="a", append_dim=append_dim)
     

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions