Skip to content

Commit

Permalink
throw error when tagging if not enough clusters #168
Browse files Browse the repository at this point in the history
  • Loading branch information
jacanchaplais committed Nov 28, 2023
1 parent d30c5da commit dac2859
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions graphicle/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,11 @@ def monte_carlo_tag(
if clustered_pmu is None:
clustered_pmu = particles.pmu[particles.final]
ref_length = "particles.final"
if len(cluster_masks) < len(hard_pmu):
raise ValueError(
f"shape mismatch: only {len(cluster_masks)} clusters "
f"passed to tag {len(hard_pmu)} partons."
)
if len(clustered_pmu) != len(cluster_masks[0]):
raise ValueError(
"shape mismatch: length of elements in cluster_masks must be the "
Expand Down

0 comments on commit dac2859

Please sign in to comment.