[8.0] test: Pin histogram bins so plot references don't depend on numpy - #8753
Open
chrisburr wants to merge 1 commit into
Open
[8.0] test: Pin histogram bins so plot references don't depend on numpy#8753chrisburr wants to merge 1 commit into
chrisburr wants to merge 1 commit into
Conversation
The number of bins chosen by the default "bins=auto" comes from numpy, and numpy 2.1 changed the heuristic: [2, 2, 3, 4, 5, 5] is split into 4 bins by numpy 1.x but 3 bins by numpy >= 2.1. The matplotlib 3.11 reference images for histogram1 and histogram2 were generated with numpy 2, so they could never match DIRACOS, which pins numpy < 2 for elasticsearch < 7.14. Ask for an explicit number of bins for those two plots instead. The values are the ones "auto" picks with numpy 1.x, so the plots are unchanged and the existing pre-3.11 references stay valid; only the two matplotlib 3.11 references needed regenerating. histogram3 keeps "auto": it is the only shape used in production (see JobPlotter._plotHistogramCPUUsed) and it bins identically under both numpy versions. Test_Plots.py passes 8/8 on numpy 1.26.4 + matplotlib 3.11.1 (the DIRACOS stack), numpy 2.4.6 + matplotlib 3.11.1, and numpy 1.26.4 + matplotlib 3.10.9.
This was referenced Aug 27, 2026
chrisburr
marked this pull request as ready for review
August 27, 2026 13:41
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.
Fix test references for numpy 1.x with matplotlib 3.11.x
No need for release notes.