Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken layer names when loading pickles from v0.6 #274

Open
toumix opened this issue Mar 26, 2024 · 0 comments
Open

Broken layer names when loading pickles from v0.6 #274

toumix opened this issue Mar 26, 2024 · 0 comments

Comments

@toumix
Copy link
Collaborator

toumix commented Mar 26, 2024

From DisCoPy v0.6 run the following:

import pickle
from discopy import Ket, Measure
circuit = Ket(0) >> Measure(1)
f = open("circuit.pkl", "wb")
pickle.dump(circuit, f)
f.close()

From DisCoPy >1.0 we get a broken name for layers:

>>> import pickle
>>> f = open("circuit.pkl", "rb")
>>> print(pickle.load(f))
Layer >> Layer

This is because Layer.name is now calculated during the __init__.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant