TST: Use numpy random generator for testing data 
This PR diff is large, but essentially it enables a ruff rule `NPY002` to use the numpy random `Generator` instead of the legacy random methods.

The change is replacing `np.random` with `np.random.default_rng(2)` before calling the data generation method. I think starting to use a fixed seed is good to make failures more reproducible.
Looks like tests are passing here so going to merge. Happy to follow up if needed