Skip to content

ndtiff Datasets cannot be pickled #109

@ieivanov

Description

@ieivanov

Dask arrays created by the ndtiff library cannot be pickled. Pickling is important for multiprocessing applications.

For example,

dataset = Dataset(\path\to\ndtiff\dataset)
data_dask_array = dataset.as_array()
pickle.dumps(data_dask_array)

first throws a AttributeError: Can't pickle local object 'NDTiffDataset.as_array.<locals>.read_one_image', which is fixed by #108. It then throws TypeError: cannot pickle '_thread.RLock' object, which I don't think I'll be able to fix myself.

A workaround may be to open a new dask array in every worker rather than pickling the opened dask array for distribution to workers.

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