Skip to content

refc: lazy loading of tidy3d namespace modules #2422

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

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

yaugenst-flex
Copy link
Collaborator

@yaugenst-flex yaugenst-flex commented Apr 30, 2025

Attempts to improve tidy3d import times by lazy-loading all modules in the tidy3d namespace, so import tidy3d as td becomes almost instant. Running into some issues with the tests though, so draft for now.

In principle _build_lazy_map() doesn't need to be called on import but we could just statically generate this to some file and then read it. The only problem is that this would mean building this map would need to be triggered whenever something in the import structure changes.

@yaugenst-flex yaugenst-flex self-assigned this Apr 30, 2025
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

Successfully merging this pull request may close these issues.

1 participant