-
Notifications
You must be signed in to change notification settings - Fork 40
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
Use simulation reduction automatically only in case of custom mediums #1371
Conversation
tidy3d/web/api/mode.py
Outdated
if reduce_simulation == "auto": | ||
sim = mode_solver.simulation | ||
contains_custom = any(isinstance(s.medium, AbstractCustomMedium) for s in sim.structures) | ||
contains_custom = contains_custom or isinstance(sim.medium, AbstractCustomMedium) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do something like that in a bunch of places but yeah it seems like there's still no in-built way to get "all media, including the simulation one" and "all structures, including the simulation as a structure"...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I guess I could've just used Simulation.mediums
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah so there is something like that!
" Setting `reduce_simulation=True` will force simulation reduction in all cases and" | ||
" silence this warning." | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good, probably we should update the notebooks then to avoid the warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was there any other besides BullseyeCavityPSO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BullseyeCavityPSO will not have a warning anymore as it doesn't use custom medium, I was thinking of the heat notebooks actually.
addressed the comments, also updated heat notebooks flexcompute/tidy3d-notebooks#24 note, there is a change in web api container.py, I noticed that it was causing spurious errors due to pydantic trying to initialize the field |
grid.discretize_inds
on new region to avoid including possible spurious pixel