Skip to content

[integration] test: Pin histogram bins so plot references don't depend on numpy - #8755

Open
chrisburr wants to merge 1 commit into
DIRACGrid:integrationfrom
chrisburr:fix/plot-tests-numpy-bins-integration
Open

[integration] test: Pin histogram bins so plot references don't depend on numpy#8755
chrisburr wants to merge 1 commit into
DIRACGrid:integrationfrom
chrisburr:fix/plot-tests-numpy-bins-integration

Conversation

@chrisburr

Copy link
Copy Markdown
Member

Forward port of #8753

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.
@chrisburr
chrisburr marked this pull request as ready for review August 27, 2026 13:41
@chrisburr
chrisburr requested a review from fstagni as a code owner August 27, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant