sandialabs / pyGSTi

A python implementation of Gate Set Tomography
http://www.pygsti.info
Apache License 2.0
132 stars 55 forks source link

Pickles are Bad, JSON is Good #446

Open coreyostrove opened 1 month ago

coreyostrove commented 1 month ago

While it happens that I also dislike pickles of the cucumber variety, I am of course referring to serialized objects produced using the pickle module. The issue is often due to backwards compatibility issues that arise that make it very difficult to unpickle things produced using prior versions of pygsti in the newest environment. This is all stuff that we know already, and was the impetus for spinning up our own bespoke json-based serialization routines.

I bring this up because there are still a bunch of pickles floating around the repository, notably in the testing modules, which themselves are just as susceptible to breaking (as happened recently with the changes made on PR #445). While it wasn't a big deal to update the pickle file in this one instance, I suspect we should be able to nix most instances of these in the codebase and substitute them with natively serialized equivalents. (Also, pickles are notoriously insecure and we probably should avoid having them in the repository as much as possible to begin with).

Not a high priority, but I wanted to bookmark this as something to work on the next time we take a dive into the testing infrastructure.