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

Is it possible to save the analysis object to disk? #377

Open
danieljfarrell opened this issue Jul 9, 2024 · 0 comments
Open

Is it possible to save the analysis object to disk? #377

danieljfarrell opened this issue Jul 9, 2024 · 0 comments

Comments

@danieljfarrell
Copy link

Environment (OS, Python version, PySpice version, simulator)

macOS 13.5, Python 3.12.2, PySpice 1.5, ngspice-42

I am simulating very large circuits that can take many minutes to solve.

For this reason I would like to be able to save the analysis object, so I do not have to recalculate it.

How can I save the analysis object to disk?

Pickle does not work

cir = Circuit(net)
simulator = cir.simulator(temperature=25, nominal_temperature=25)
result = simulator.dc(Vin=slice(-1, 2, 0.01))

import pickle
with open("result.obj", "wb") as f:
    pickle.dump(result, f)  # <-- this line crashes

The pickle fails,

Traceback (most recent call last):
  File "<snip>.py", line <snip>, in <module>
    pickle.dump(result, f)
TypeError: cannot pickle '_cffi_backend.__CDataOwn' object

Is there another way to export this object and save the data that you can recommend?

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