ANN: Python-Blosc2 3.0.0 rc2 is out!

33 views
Skip to first unread message

Francesc Alted

unread,
Dec 2, 2024, 8:04:28 AM12/2/24
to Discussion of Numerical Python, pyd...@googlegroups.com, python-ann...@python.org
Announcing Python-Blosc2 3.0.0-rc2
==================================

The Blosc development team is pleased to announce the second candidate
release of
Python-Blosc2 3.0.0. Here, we are streamlining the API and adding more
flexibility
to the compute engine (e.g. support for reductions in fields of struct arrays).
You can think of Python-Blosc2 3.0 as a replacement of numexpr, but better :-)

As always, we would like to get feedback from the community before the final
release. We are providing binary wheels that you can easily install from PyPI
with:

pip install blosc2==3.0.0rc2

For more info, you can have a look at the release notes in:

https://github.com/Blosc/python-blosc2/releases

Docs and examples are available in the documentation site:

https://www.blosc.org/python-blosc2

Code example::

import blosc2
from time import time

# Create some data operands
N = 10_000
a = blosc2.linspace(0, 1, N * N, dtype="float32", shape=(N, N))
b = blosc2.linspace(1, 2, N * N, shape=(N, N))
c = blosc2.linspace(-10, 10, N * N, shape=(N, N))

# Expression
t0 = time()
expr = ((a**3 + blosc2.sin(c * 2)) < b) & (c > 0)
print(f"Time to create expression: {time()-t0:.5f}")

# Evaluate and get a NDArray as result
t0 = time()
out = expr.compute()
print(f"Time to compute: {time()-t0:.5f}")

This will output something like::

Time to create expression: 0.00041
Time to compute: 0.56215

Note that the expression is computed lazily, i.e. only when the `compute`
method is called.

Finally, I'll be teaching about Python-Blosc2 3.0 in my forthcoming tutorial
at PyData Global 2024 (https://pydata.org/global2024). Be sure to be there for
an exciting introduction to the bells and whistles of the shiny new
computation engine and its enhanced capabilities to deal with large datasets.

Thanks and see you there!

--
Francesc Alted
Reply all
Reply to author
Forward
0 new messages