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

Replace golang.org/x/exp/rand with math/rand/v2 #797

Closed
Juneezee opened this issue Mar 21, 2025 · 2 comments · Fixed by #801
Closed

Replace golang.org/x/exp/rand with math/rand/v2 #797

Juneezee opened this issue Mar 21, 2025 · 2 comments · Fixed by #801

Comments

@Juneezee
Copy link
Contributor

This is similar to gonum/gonum#1906. We have already upgraded our minimum Go version to 1.23 in PR #790. golang.org/x/exp/rand has been deprecated is scheduled for removal (golang/exp@f9890c6).

Our usage of golang.org/x/exp/rand is limited to tests and examples, so replacing it should not introduce any breaking changes.

$ grep --recursive --line-number --include='*.go' 'golang.org/x/exp'

plotter/contour_example_test.go:13:	"golang.org/x/exp/rand"
plotter/boxplot_example_test.go:12:	"golang.org/x/exp/rand"
plotter/barchart_example_test.go:12:	"golang.org/x/exp/rand"
plotter/bubbles_example_test.go:12:	"golang.org/x/exp/rand"
plotter/histogram_example_test.go:12:	"golang.org/x/exp/rand"
plotter/contour_test.go:16:	"golang.org/x/exp/rand"
plotter/filledLine_test.go:12:	"golang.org/x/exp/rand"
plotter/step_example_test.go:11:	"golang.org/x/exp/rand"
plotter/errbars_example_test.go:10:	"golang.org/x/exp/rand"
plotter/quartile_example_test.go:10:	"golang.org/x/exp/rand"
plotter/scatter_example_test.go:11:	"golang.org/x/exp/rand"
plotter/filledLine_example_test.go:11:	"golang.org/x/exp/rand"
plotter/scatterColor_example_test.go:13:	"golang.org/x/exp/rand"
plotter/timeseries_example_test.go:12:	"golang.org/x/exp/rand"
gob/gob_test.go:14:	"golang.org/x/exp/rand"
plotutil/main.go:11:	"golang.org/x/exp/rand"
plotutil/errorpoints_example_test.go:8:	"golang.org/x/exp/rand"
palette/moreland/luminance_test.go:12:	"golang.org/x/exp/rand"
palette/moreland/smooth_test.go:13:	"golang.org/x/exp/rand"

If this proposal is accepted, I am happy to open a PR.

@sbinet
Copy link
Member

sbinet commented Mar 22, 2025

yes, please.
(but perhaps a fix for #798 should first be submitted ? as #797 relies on it to correctly run)

@Juneezee
Copy link
Contributor Author

(but perhaps a fix for #798 should first be submitted ? as #797 relies on it to correctly run)

@sbinet Yes. The bug fix has been submitted here #799

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 a pull request may close this issue.

2 participants