Skip to content

Pickling fails for quantities with dtype=object #113

@burnpanck

Description

@burnpanck

The following code fails:

import pickle
import numpy as np
import quantities as pq

pickle.loads(pickle.dumps(np.array(1,'O')*pq.V))

Inside Quantity.__setstate__, the call to np.ndarray.__setstate__ fails with TypeError: object pickle not returning list. So far I do not understand more about this.
Of course, there is rarely a good reason to have dtype=object with quantities, but if the constructor accepts it, then pickling should work too.

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