Blosc / python-blosc2

https://www.blosc.org/python-blosc2
Other
83 stars 19 forks source link

Replace legacy `np.random.normal` #241

Closed DimitriPapadopoulos closed 2 months ago

DimitriPapadopoulos commented 2 months ago

Ruff issue in notebooks:

doc/getting_started/tutorials/02.ndarray-basics.ipynb:cell 32:1:16: NPY002 Replace legacy `np.random.normal` call with `np.random.Generator`
  |
1 | buffer = bytes(np.random.normal(0, 1, np.prod(shape)) * 8)
  |                ^^^^^^^^^^^^^^^^ NPY002
2 | b2ndarray = blosc2.frombuffer(buffer, shape, dtype=dtype)
3 | print("Compression ratio:", b2ndarray.schunk.cratio)
  |
FrancescAlted commented 2 months ago

Can you provide a PR please?