|
1 | | -Announcing Python-Blosc2 4.6.0 |
| 1 | +Announcing Python-Blosc2 4.7.0 |
2 | 2 | ============================== |
3 | 3 |
|
4 | | -We are happy to announce this release, which sharpens the **columnar / query |
5 | | -side** of blosc2: zero-copy sorted views, queries over string (dictionary) |
6 | | -columns, a more flexible and faster ``group_by``, and an ``b2view`` terminal |
7 | | -browser that can now group, sort, and plot interactively. |
| 4 | +We are happy to announce this release, which brings a **DSL → JavaScript JIT |
| 5 | +backend** for running compute kernels under WebAssembly/Pyodide, a new helper to |
| 6 | +check whether your DSL kernels actually JIT-compile, and a batch of miniexpr |
| 7 | +fixes. |
8 | 8 |
|
9 | 9 | The main highlights are: |
10 | 10 |
|
11 | | -- **Zero-copy sorted views**: ``CTable.sort_by(..., view=True)`` returns a |
12 | | - lightweight sorted view that shares the parent's column data and gathers rows |
13 | | - on demand — no whole-table copy. Sorting on a fully indexed column streams |
14 | | - straight from the index, so reading a sorted slice of a huge (on-disk) table |
15 | | - is as easy as ``t.sort_by("col", view=True)[:10]``. |
16 | | - |
17 | | -- **Queries over string columns**: ``where`` expressions now work on |
18 | | - dictionary-encoded (string) columns, including membership tests such as |
19 | | - ``'"Acme" in company'``, filtering categorical text without decoding the whole |
20 | | - column. |
21 | | - |
22 | | -- **Smarter, faster group_by**: ``group_by(...).agg()`` accepts flexible |
23 | | - aggregation specs and explicit output names (pandas-style), a new tri-state |
24 | | - ``sort=`` (``None``/``True``/``False``) sorts only when cheap, the last |
25 | | - grouping is memoized, and ``min``/``max``/``argmin``/``argmax`` are |
26 | | - accelerated from per-block index summaries instead of decompressing data. |
27 | | - |
28 | | -- **b2view grows up**: interactive **group-by** (``G``, including float keys), |
29 | | - **sort-by-column** (``S``, zero-copy via the index), and much **better plots** |
30 | | - — bars for categorical keys, lines/stems for numeric keys, hi-res variants for |
31 | | - every plot type, and ``--max`` to maximize a panel. ``b2view`` is now an |
32 | | - **opt-in extra** (``pip install "blosc2[tui]"``), so a plain |
33 | | - ``pip install blosc2`` stays lean. |
34 | | - |
35 | | -- **Fixes & maintenance**: the bundled **C-Blosc2 is upgraded to 3.1.5**, the |
36 | | - open-file cache now validates cached handles against the file's fingerprint (so |
37 | | - a file changed underneath an open handle is never served stale), plus |
38 | | - compatibility with **NumPy 2.5**. |
39 | | - |
40 | | -A quick taste — grab a table and explore it:: |
41 | | - |
42 | | - $ pip install "blosc2[tui]" --upgrade |
43 | | - $ b2view --download --panel data |
44 | | - |
45 | | -Press ``G`` to group, ``S`` to sort, and ``p`` to plot a column — all without |
46 | | -decompressing anything you do not look at. |
| 11 | +- **DSL → JavaScript backend (``jit_backend="js"``)**: under WebAssembly/Pyodide, |
| 12 | + ``@blosc2.dsl_kernel`` kernels can now be transpiled to JavaScript and run via |
| 13 | + the browser's JIT. It is the **default there** for transpilable floating-point |
| 14 | + kernels (silently falling back to miniexpr for anything it can't handle), and |
| 15 | + beats the WASM TinyCC JIT on compute-heavy kernels (e.g. ~2.8x on a Newton |
| 16 | + fractal). It supports index/shape symbols (``_i0``/``_n0``/``_ndim``/ |
| 17 | + ``_flat_idx``) and integer inputs with a floating-point output. Request it |
| 18 | + explicitly with ``compute(jit_backend="js")``; outside WebAssembly that raises. |
| 19 | + Native builds are unaffected. |
| 20 | + |
| 21 | +- **New ``blosc2.validate_dsl_jit()``**: an introspection helper that reports |
| 22 | + whether a DSL kernel actually JIT-compiles (vs. silently falling back to the |
| 23 | + interpreter) for given operand/output dtypes — without running it on real |
| 24 | + data. |
| 25 | + |
| 26 | +- **miniexpr fixes**: clearer errors for ``;``-joined statements and for |
| 27 | + assigning to an input parameter, and a fix for a name collision where DSL |
| 28 | + variables named ``out``/``idx``/``nitems``/``inputs``/``output`` clashed with |
| 29 | + codegen-internal identifiers and silently fell back to the interpreter. |
| 30 | + |
| 31 | +A quick taste — run a DSL kernel on the JS backend under Pyodide:: |
| 32 | + |
| 33 | + @blosc2.dsl_kernel |
| 34 | + def k(a, b): |
| 35 | + return a * a + b * b |
| 36 | + |
| 37 | + out = k.compute(operands, jit_backend="js") # JS JIT under WebAssembly |
47 | 38 |
|
48 | 39 | Install it with:: |
49 | 40 |
|
|
0 commit comments