Skip to content

Conversation

@achiefa
Copy link
Contributor

@achiefa achiefa commented Nov 11, 2025

This PR addresses #2399

@achiefa achiefa self-assigned this Nov 11, 2025
@achiefa achiefa linked an issue Nov 11, 2025 that may be closed by this pull request
@achiefa
Copy link
Contributor Author

achiefa commented Nov 11, 2025

I've implemented the try-except block to catch possible failures in the computation of the systematic shifts. Note that now if either with_shift is False or the function shifts_from_systematics raises a LinAlgError, the titles in the plots are supplemented with the "unshifted" label (see plot below):

matched_datasets_from_dataspecs80_plot_fancy_dataspecs_0.pdf

I'm done with this PR. Let's wait for the tests. Let me know if you spot anything silly or wrong. @scarlehoff @andrpie

Copy link
Member

@scarlehoff scarlehoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Make sure that the label is the right one!

Comment on lines 336 to 343
if with_shift:
ax.set_title(
"{} {} (unshifted)".format(info.dataset_label, info.group_label(samefig_vals, info.figure_by))
)
else:
ax.set_title(
"{} {}".format(info.dataset_label, info.group_label(samefig_vals, info.figure_by))
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you swapped here shifted and unshifted ^^U

In any case, I would keep a single set_title and just set the string with the conditional like:

if with_shift:
    shift_label = "(shifted)"
else:
    shift_label = "(unshifted)"
ax.set_title(
    "{} {} {}".format(info.dataset_label, info.group_label(samefig_vals, info.figure_by, shift_label))
)

@achiefa achiefa merged commit 201267d into master Nov 12, 2025
12 checks passed
@achiefa achiefa deleted the 2399-issue-with-shifts-in-plotting-utilities branch November 12, 2025 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with shifts in plotting utilities

3 participants