Conversation
|
As I commented in Mattermost, I think this change of --select that adds the sum keyword to keep or remove the axis after the operation is making --select equivalent to --axlim (at least in the default case), which slices but doesn't remove the axis. |
| logger.debug("Applying global action") | ||
| h = self.globalAction(h) | ||
|
|
||
| sum_axes = [x for x in self.sum_gen_axes if x in h.axes.name] |
There was a problem hiding this comment.
Since you are touching this part, can we take this occasion to rename sum_axes (which is only used in this and the next few lines) as sum_gen_axes or something to explicitly mark it as such? It is probably already quite clear from the right had side that it only affects gen axes, usually for the unfolding or alphaS, but if you did it would make this part of the code easier to understand. Other possible axes on which we might apply actions are managed elsewhere, for example through the globalAction.
scripts/rabbit/setupRabbit.py
Outdated
| sel_ax, sel_lb, sel_ub = sel.split() | ||
| parts = sel.split() | ||
| sel_ax, sel_lb, sel_ub = parts[0], parts[1], parts[2] | ||
| do_sum = len(parts) > 3 and parts[3] == "sum" |
There was a problem hiding this comment.
In spite of my previous comment, I think it makes sense that you made this action act more generically, allowing the user to control whether the marginalisation of the axis should happen or not.
Unfortunately it modifies the previous default behaviour, but if this is properly advertised to all users I can accept it
|
Hi @cippy @davidwalter2 thank you for the discussions. I propose the following
what do you think? |
|
wremnants/utilities/styles/styles.py
Outdated
| ], | ||
| "min": common_groups | ||
| + [ | ||
| "angularCoeffs", |
There was a problem hiding this comment.
I am not generally using this whole group, but I think its logic was to have the minimal grouping with no redundancy (i.e. without adding also groups of listed subgroups), to avoid that one tends to double-count the lines with impacts
| raise ValueError( | ||
| f"--preselect requested axis '{axis}', but histogram axes are {h.axes.name}" | ||
| ) | ||
| h = h[{axis: slice(low, hh.get_hist_slice_upper(h, axis, high))}] |
There was a problem hiding this comment.
This requires changing the submodules I think, the current commit in the repository points to an older commit (CI didn't notice it, probably because it doesn't use it)
|
Fine to merge for me. Have you checked that the options work as expected? Especially for negative numbers, it might still be true that we need to pass " -2.4" (note the white space) instead of just -2.4 or "-2.4" |
--selectand--axlimare possibly overlapping, and inconsistent with the order of operations like projecting. The goal of this PR is to separate the two, and ensure that things aren't quietly failing.