Skip to content

Commit 39f4fdb

Browse files
committed
Getting ready for release 4.7.0
1 parent eb75b7e commit 39f4fdb

4 files changed

Lines changed: 54 additions & 44 deletions

File tree

ANNOUNCE.rst

Lines changed: 32 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,40 @@
1-
Announcing Python-Blosc2 4.6.0
1+
Announcing Python-Blosc2 4.7.0
22
==============================
33

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.
88

99
The main highlights are:
1010

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
4738

4839
Install it with::
4940

RELEASE_NOTES.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release notes
22

3-
## Changes from 4.6.0 to 4.6.1
3+
## Changes from 4.6.0 to 4.7.0
44

55
### DSL → JavaScript backend for WebAssembly (`jit_backend="js"`)
66

@@ -14,6 +14,25 @@
1414
with a floating-point output. Integer/complex *output*, reductions, and
1515
unsupported constructs stay on miniexpr. Native builds are unaffected.
1616

17+
### New `blosc2.validate_dsl_jit()`
18+
19+
- A new introspection helper reports whether a DSL kernel actually JIT-compiles
20+
(vs. silently falling back to the interpreter) for a given set of operand and
21+
output dtypes, without running it on real data::
22+
23+
status = blosc2.validate_dsl_jit(kernel, [np.float64, np.float64], np.float64)
24+
status["jit"] # True if a runtime JIT kernel was produced
25+
26+
### miniexpr fixes
27+
28+
- `DSLValidator` now rejects `;`-joined sibling statements with a clear
29+
"one statement per line" error, and assigning to an input parameter raises a
30+
targeted error naming the param.
31+
- Fixed (in miniexpr) a name collision where DSL variables named `out`, `idx`,
32+
`nitems`, `inputs` or `output` clashed with codegen-internal identifiers,
33+
causing the generated C to fail to compile and silently fall back to the
34+
interpreter. Codegen identifiers are now namespaced under `__me`.
35+
1736
## Changes from 4.5.1 to 4.6.0
1837

1938
### `CTable.sort_by(view=True)`: zero-copy sorted views

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencies = [
4141
"rich",
4242
"threadpoolctl; platform_machine != 'wasm32'",
4343
]
44-
version = "4.6.1.dev0"
44+
version = "4.7.0"
4545
[project.entry-points."array_api"]
4646
blosc2 = "blosc2"
4747

src/blosc2/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "4.6.1.dev0"
1+
__version__ = "4.7.0"
22
__array_api_version__ = "2024.12"

0 commit comments

Comments
 (0)