-
Notifications
You must be signed in to change notification settings - Fork 50
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
add internal construct smatrix #2037
Conversation
…velopment/debugging. also fixed some broken docstring links
PR looks good About the switching between run functions, I think this might be a problem we had recently with the inverse design plugin. I dont know if @momchil-flex has some insight on that. It seems like something we should think about. Off the top of my head I don't have a great idea besides maybe setting some kind of |
Yeah this would certainly be nice. So far I've been doing it by monkeypatching (in on-prem builds). For example you should be able to do something like
Then in your other scripts replace Regarding loading from files: isn't this basically equivalent to implementing local caching? I don't see how else it would work in a convenient way, i.e. we probably don't want to expect the user to pass the simulation file names (if that was the case they might as well just use |
You don't even need to to that. Just importing # File patch_run.py
from tidy3d import web
web.run = lambda *a, **b: print("NOPE") Just importing it works: In [1]: import tidy3d as td
In [2]: import patch_run
In [3]: td.web.run("Please?")
NOPE |
Nice approach, and it looks you don't even need to write that in a separate |
Thanks for the ideas everyone, seems like there are fairly simple ways to do what I want! +1 for local caching too, that would be useful! |
I find for development work it is handy to have a
_construct_smatrix
version that accepts an arbitrarybatch_data
. This allows us to run the simulations once and save/load thebatch_data
to/from file. I also fixed some docstring links that were broken.Additional question, @tylerflex is there a simple way to change how the
BatchData
is created and read from so that it is easier to switch between:Batch.run
run_sim
I find when I am developing I always have some code that is needed to change between these methods for generating
BatchData
.