-
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
fix field data flux #1606
fix field data flux #1606
Conversation
Ah. Kinda bad. I kinda prefer 1 (not sure how 2 differs, if this is an issue only with multi-freq). It's probably rare to want to sum the values, and even if you do, you can still do it very easily in your own function. Not sure how many people we'll have to explain this to but it feels like we should just pull the band-aid... |
Option 2 would keep the current handling (return |
955f5ec
to
1b39cc2
Compare
I just revised this PR to try the handling in 2. see the new code here: tidy3d/tidy3d/plugins/adjoint/components/data/monitor_data.py Lines 163 to 174 in 1b39cc2
also added a more proper test of both cases. Maybe I'd prefer this for now? |
I think this makes sense. Do we really want to put it in a patch though? Since we're planning the 2.7.0rc1 for Monday is it better to just put it there? |
Fine with me. I'll try to change it to pre/2.7 before Monday |
1b39cc2
to
b3c257d
Compare
@momchil-flex rebased against 2.7 |
…`JaxDataArray` for multi-freq
b3c257d
to
5265373
Compare
The
adjoint
pluginFieldData.flux
previously returned afloat
that summed over all of the flux values.For multi-frequency adjoint, this is not quite what we want, rather we want a
JaxDataArray
with frequency coordinate.(I think this was added before multi-frequency adjoint and just wasn't fixed when that was introduced).
This PR properly returns a
JaxDataArray
(FluxDataArray
).A potential issue for backwards compatibility if users have
.flux
in their notebooks. I'm not sure how to resolve this. Options aresum()
if certain conditions are met (like a single frequency coordinate)sum: bool=True
kwarg so we can instruct users that want all the flux values to set this toFalse
fyi @tomflexcompute