Skip to content

Commit

Permalink
Merge pull request #40 from Pennycook/26-platform-limit
Browse files Browse the repository at this point in the history
Raise exception for cascades with > 26 platforms
  • Loading branch information
Pennycook committed Apr 30, 2024
2 parents 68ae4d1 + b3366c2 commit 4f84770
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions p3/plot/backend/matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ def __init__(
plat_colors = self.__get_colors(platforms, plat_style.colors)

# Choose labels for each platform
if len(platforms) > len(string.ascii_uppercase):
raise RuntimeError(
"The number of platforms supported by cascade plots is "
+ f"currently limited to {len(string.ascii_uppercase)}.",
)
plat_labels = dict(zip(platforms, string.ascii_uppercase))

# Plot the efficiency cascade in the top-left (0, 0)
Expand Down

0 comments on commit 4f84770

Please sign in to comment.