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

Save/load Modes objects to disk #64

Open
simbilod opened this issue Jul 6, 2023 · 1 comment
Open

Save/load Modes objects to disk #64

simbilod opened this issue Jul 6, 2023 · 1 comment

Comments

@simbilod
Copy link
Contributor

simbilod commented Jul 6, 2023

Pickling Modes currently leads to ~100MB objects on disk

What would be a best practice to save/load modes to disk?

In gdsfactory with the old femwell API I had something that saved the mesh, element, an field values, and would reconstruct the basis at runtime, which led to much smaller files (~1MB or less instead of 100)

@HelgeGehring
Copy link
Owner

There's the cached solver you can use, see https://github.com/HelgeGehring/femwell/blob/main/femwell/solver.py#L145
It only caches the actual call to the solver, nothing more.

There's still some calculations afterwards for normalizing the field. So it might be not saving enough time.

Maybe give it a try and then we can see if we add something!

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

2 participants