Skip to content

katdal datasets are not pickleable #392

Description

@sjperkins
import pickle
import katdal

url = "https://archive-gw-1-kat.ac.za/12345/12345_sdk_l0.full.rdb?token=eyABCD"
ds = katdal.open(url)
pickle.dumps(ds)

results in

TypeError: cannot pickle '_thread.lock' object

The proximal cause is the default pickle functionality attempting to pickle threading Locks (of which there aren't many)

Image

but serialisability of datasets was probably never part of the design. A solution might involve implementing __reduce__ where appropriate.

This impacts the katdal backend in dask-ms (its not possible to pickle xarray Datasets derived from katdal)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions