Skip to content

Pickling Dataset not working after QC with use_mp=True #612

@vergauwenthomas

Description

@vergauwenthomas

_thread_lock objects are included in the Dataset that cannot be serialized.

File ~/.cache/pypoetry/virtualenvs/paper-qc-JI7hhufK-py3.11/lib/python3.11/site-packages/metobs_toolkit/dataset.py:838, in Dataset.save_dataset_to_pkl(self, filepath, overwrite)
    830 filepath = fmt_output_filepath(
    831     filepath=filepath,
    832     default_filename="saved_dataset.pkl",
    833     suffix=".pkl",
    834     overwrite=overwrite,
    835 )
    837 with open(filepath, "wb") as outp:
--> [838](https://file+.vscode-resource.vscode-cdn.net/home/thoverga/Documents/github/paper_qc/~/.cache/pypoetry/virtualenvs/paper-qc-JI7hhufK-py3.11/lib/python3.11/site-packages/metobs_toolkit/dataset.py:838)     pickle.dump(self, outp, pickle.HIGHEST_PROTOCOL)

TypeError: cannot pickle '_thread.lock' object

Metadata

Metadata

Assignees

No one assigned

    Labels

    technicalAn issue related to the code, the functionality to the end-user will not be affected

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions