-
Notifications
You must be signed in to change notification settings - Fork 3
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 struct.detached #161
Fix struct.detached #161
Conversation
src/eko/output/struct.py
Outdated
del bases[basis] | ||
if basis in bases: | ||
bases[f"_{basis}"] = bases[basis] | ||
del bases[basis] | ||
bases["pids"] = np.array(br.flavor_basis_pids) | ||
for k in ("xgrid", "_inputgrid", "_targetgrid"): |
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.
Dropping the former loop, also this loop has to be dropped. Essentially, replace k
everywhere with "xgrid"
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.
This is what I did before but then the tests are really a problem. Of course fixing the tests would be the correct solution but, since at the moment we are not using at all rotations
, I believe that in the next future we need to get rid completely of it. This will be the proper change and at that moment we can drop these loops and fix the tests accordingly.
BTW I am saying that we are not using at all rotations
because even if I use x_grid_reshape
and it changes targetgrid
, then load()
would completely ignore targetgrid
and would set it to xgrid
(wrongly because instead the operator is rotated). This is the problem that I have with pineko. So now rotations
is not even keeping track of the rotations. It is completely useless.
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.
BTW I am saying that we are not using at all
rotations
because even if I usex_grid_reshape
and it changestargetgrid
, thenload()
would completely ignoretargetgrid
and would set it toxgrid
This should not happen: we want to "ignore" targetgrid
(i.e. not putting it at all) only in the runcard. The reason why it is failing in Pineko is different: metadata are not automatically updated, and you are not doing it specifically.
Metadata are one thing, and runcards are another. Incidentally, they both have rotations
- but we can drop rotations
at all from the runcard, since we'll never use it any longer.
EDIT: this is partially the reason why I'm pressing for #160, since at the moment there is a huge clash
So I removed the loops as agreed yesterday and started to fix the tests. However, as you can see, this is not as trivial as removing every mention (but the ones in |
operator["rotations"][k], | ||
log=operator["configs"]["interpolation_is_log"], | ||
) | ||
if operator["rotations"]["xgrid"] is not None: |
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.
Actually, I'm not sure any longer with need this if
: xgrid
should not be allowed to be None
.
Isn't it? @felixhekhorn
I believe that the tests that we are not passing now can only be fixed after we allow for the |
This PR updates I would close without merging. |
Agreed - let's close without merging.
you mean close all PRs and change the target branch of the last? |
We want
output.struct.detached
to work even if the eko does not containinputpids
,targetpids
,inputgrid
andtargetgrid
, as this will be the case from now on. @felixhekhorn @alecandido