Repository navigation
fix(scripts): import BarContainer from matplotlib.container - #52
Merged
Merged
Conversation
scripts/_plot_helpers.py annotated label_bars with plt.BarContainer, which matplotlib.pyplot imports for type checkers only, so importing the helpers raised AttributeError and generate_example_outputs.py could not start. The annotations now name matplotlib.container.BarContainer and matplotlib.axes.Axes, and the type-ignore comments they carried go. A test labels a bar chart through the helper; it failed at import before the change. The test extra declares matplotlib, which the test imports and which reached the test environment only through sibling packages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/generate_example_outputs.pyfailed at import:scripts/_plot_helpers.pyannotatedlabel_barswithplt.BarContainer, whichmatplotlib.pyplotimports only underTYPE_CHECKING(matplotlib 3.10.9), so the annotation raisedAttributeErrorwhen the module loaded.The generator's simulated plots (training curves and ROC curves drawn from random numbers) belong to the drug-discovery pages they illustrate and are replaced in the docs change that regenerates those pages from real runs.
Evidence
AttributeError: module 'matplotlib.pyplot' has no attribute 'BarContainer'.After:
tests/scripts6 passed; pyright reports 0 errors on the helper with the ignores removed.uv lock --checkpasses; pre-commit passes on all files;tests/test_ci_shards.pypasses.Merge Danger
Door: two-way
Blast Radius: documentation scripts