Skip to content
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

Support Xbb in high level API #157

Merged
merged 9 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ sdist/
var/
plots/
outputs/
run/
wheels/
pip-wheel-metadata/
share/python-wheels/
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### [Latest]

- Add Xbb Support [!157](https://github.com/umami-hep/puma/pull/157)
- Improvements to the high level API [!155](https://github.com/umami-hep/puma/pull/155)
- Fixate the python container version [!153](https://github.com/umami-hep/puma/pull/153)
- Improve ROC format [#146](https://github.com/umami-hep/puma/pull/149)
Expand Down
6 changes: 3 additions & 3 deletions examples/plot_discriminant_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
plot_histo = HistogramPlot(
n_ratio_panels=1,
ylabel="Normalised number of jets",
ylabel_ratio_1="Ratio to DIPS",
ylabel_ratio=["Ratio to DIPS"],
xlabel="$b$-jet discriminant",
logy=False,
leg_ncol=1,
figsize=(5.5, 4.5),
bins=np.linspace(-10, 10, 50),
y_scale=1.5,
ymax_ratio_1=1.5,
ymin_ratio_1=0.5,
ymax_ratio=[1.5],
ymin_ratio=[0.5],
atlas_second_tag="$\\sqrt{s}=13$ TeV, dummy jets \ndummy sample, $f_{c}=0.018$",
)

Expand Down
9 changes: 4 additions & 5 deletions puma/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ def __init__( # pylint: disable=too-many-arguments
self.plot_objects = {}
self.add_order = []
self.ratios_objects = {}
self.ratio_axes = {}
self.reference_object = None

if self.n_ratio_panels > 1:
Expand Down Expand Up @@ -554,7 +553,7 @@ def plot_ratios(self):
ratio_unc_band_high = np.nan_to_num(ratio + ratio_unc, nan=0, posinf=0)

# Plot the ratio values with the step function
self.axis_ratio_1.step(
self.ratio_axes[0].step(
x=elem.bin_edges,
y=ratio,
color=elem.colour,
Expand All @@ -564,7 +563,7 @@ def plot_ratios(self):

# Plot the ratio uncertainty
if self.draw_errors:
self.axis_ratio_1.fill_between(
self.ratio_axes[0].fill_between(
x=elem.bin_edges,
y1=ratio_unc_band_low,
y2=ratio_unc_band_high,
Expand Down Expand Up @@ -625,8 +624,8 @@ def draw(self, labelpad: int = None):

if self.n_ratio_panels > 0:
self.set_ylabel(
self.axis_ratio_1,
self.ylabel_ratio_1,
self.ratio_axes[0],
self.ylabel_ratio[0],
align_right=False,
labelpad=labelpad,
)
Expand Down
Loading