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

Cascade plot crashes with more than 26 platforms #39

Open
Pennycook opened this issue Apr 22, 2024 · 0 comments
Open

Cascade plot crashes with more than 26 platforms #39

Pennycook opened this issue Apr 22, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@Pennycook
Copy link
Contributor

Expected behavior

We should either:

  • Produce a cascade plot containing all the platforms provided; or
  • Document the 26 platform limit and exit with an errror message.

Supporting a larger number of platforms would be my preference, but we'll need to come up with an alternative naming scheme for platforms that isn't A-Z. We'll also need to make sure that the plot correctly resizes everything to fit the new naming scheme.

Actual behavior

Traceback (most recent call last):
  File "/home/p3-analysis-library/cascade.py", line 15, in <module>
    cascade = p3.plot.cascade(df, size=(6, 5))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/p3-analysis-library/p3/plot/_cascade.py", line 95, in cascade
    return CascadePlot(df, eff, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/p3-analysis-library/p3/plot/backend/matplotlib.py", line 181, in __init__
    self.__platform_chart(
  File "/home/p3-analysis-library/p3/plot/backend/matplotlib.py", line 361, in __platform_chart
    plat_labels[supported_platforms[j]],
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'PlatformName'

This occurs because of how we choose platform labels:

# Choose labels for each platform
plat_labels = dict(zip(platforms, string.ascii_uppercase))

Steps to reproduce the problem

Try to plot a cascade with more than 26 platforms.

Specifications

Tested with the tip of main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant