Skip to content

Commit

Permalink
bara: don't skip root-level leaves where PODIO stores vector member v…
Browse files Browse the repository at this point in the history
…alues
  • Loading branch information
veprbl committed Jun 5, 2024
1 parent e938ec9 commit b89d7e0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions epic_capybara/cli/bara.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def bara(files, match, unmatch, serve):
keys = [
key for key in tree.keys(recursive=True)
if not key.startswith("PARAMETERS")
and key.find("/") != -1
and len(tree[key].branches) == 0
and match_filter(key, match, unmatch)
]
for key in keys:
Expand Down Expand Up @@ -86,8 +86,13 @@ def bara(files, match, unmatch, serve):
or any("* int" in str(ak.type(a)) for a in arr[key].values())):
nbins = int(min(100, np.ceil(x_range)))

fig = figure(x_axis_label=key.split("/", 1)[1], y_axis_label="Entries")
collection_figs.setdefault(key.split("/")[0], []).append(fig)
if "/" in key:
branch_name, leaf_name = key.split("/", 1)
else:
branch_name = key
leaf_name = key
fig = figure(x_axis_label=leaf_name, y_axis_label="Entries")
collection_figs.setdefault(branch_name, []).append(fig)

prev_file_arr = None
vis_params = [
Expand All @@ -98,7 +103,7 @@ def bara(files, match, unmatch, serve):

if set(arr[key].keys()) != set(files):
# not every file has the key
collection_with_diffs.add(key.split("/")[0])
collection_with_diffs.add(branch_name)

for _file, label, (color, line_width, line_dash) in zip(files, labels, vis_params):
if _file not in arr[key]:
Expand Down Expand Up @@ -138,7 +143,7 @@ def bara(files, match, unmatch, serve):
pvalue = 0
print(key)
print(prev_file_arr, file_arr, f"p = {pvalue:.3f}")
collection_with_diffs.add(key.split("/")[0])
collection_with_diffs.add(branch_name)
prev_file_arr = file_arr

def to_filename(branch_name):
Expand Down

0 comments on commit b89d7e0

Please sign in to comment.