Skip to content

Commit d1d164c

Browse files
committed
Merge branch 'matmul' of github.com:ricardosp4/python-blosc2 into matmul
2 parents d5965f1 + 97d3206 commit d1d164c

25 files changed

Lines changed: 633 additions & 245 deletions

.github/workflows/cibuildwheels.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ on:
1111

1212
env:
1313
CIBW_BUILD_VERBOSITY: 1
14-
# Skip aarch64 for now, as it is emulated on GitHub Actions and takes too long
15-
CIBW_TEST_SKIP: "*linux*aarch64*"
14+
# Skip testing on aarch64 for now, as it is emulated on GitHub Actions and takes too long
15+
# Now that github provides native arm64 runners, we can enable tests again
16+
# CIBW_TEST_SKIP: "*linux*aarch64*"
1617

1718
jobs:
1819

@@ -27,11 +28,11 @@ jobs:
2728
CIBW_ARCHS_MACOS: "x86_64 arm64"
2829
strategy:
2930
matrix:
30-
os: [ubuntu-latest, windows-latest, macos-latest]
31-
# arch: [x86_64, aarch64]
31+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
32+
arch: [x86_64, aarch64]
3233
# aarch64 is emulated, and it is giving issues with cibuildwheel
3334
# Just build for x86_64 for now (Mac arm64 is already covered by cibuildwheel)
34-
arch: [x86_64]
35+
# arch: [x86_64]
3536
cibw_build: ["cp3{11,12,13}-*"]
3637
p_ver: ["3.11-3.13"]
3738
exclude:
@@ -40,6 +41,11 @@ jobs:
4041
# cibuild is already in charge to build aarch64 (see CIBW_ARCHS_MACOS)
4142
- os: macos-latest
4243
arch: aarch64
44+
# Mutually exclude aarch64 and x86_64 for ubuntu-24.04-arm and ubuntu-latest
45+
- os: ubuntu-24.04-arm
46+
arch: x86_64
47+
- os: ubuntu-latest
48+
arch: aarch64
4349

4450
steps:
4551
- name: Checkout repo
@@ -51,6 +57,7 @@ jobs:
5157
# Use the most recent released python
5258
python-version: '3.x'
5359

60+
# For some reason, this is still needed, even when using new arm64 runners
5461
- name: Set up QEMU
5562
if: ${{ matrix.arch == 'aarch64' }}
5663
uses: docker/setup-qemu-action@v3
@@ -73,7 +80,6 @@ jobs:
7380
name: wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.p_ver }}
7481
path: ./wheelhouse/*.whl
7582

76-
7783
build_sdist:
7884
name: Build sdist
7985
runs-on: ubuntu-latest
@@ -96,25 +102,25 @@ jobs:
96102
python-version: ${{ matrix.python-version }}
97103

98104
- name: Build sdist
99-
run: pipx run build --sdist
105+
run: pipx run build --sdist --outdir ./wheelhouse
100106

101107
- name: Upload sdist package
102108
uses: actions/upload-artifact@v4
103109
with:
104110
name: wheels-source
105-
path: dist/*.tar.gz
111+
path: wheelhouse/*.tar.gz
106112

107113
- name: Build building extension from sdist package
108114
run: |
109-
cd ./dist
115+
cd ./wheelhouse
110116
tar -xzf blosc2-*.tar.gz
111117
cd ./blosc2-*/
112118
pip install pip --upgrade
113119
pip install --break-system-packages -e .[test]
114120
115121
- name: Test sdist package with pytest
116122
run: |
117-
cd ./dist/blosc2-*/
123+
cd ./wheelhouse/blosc2-*/
118124
pytest
119125
120126
upload_pypi:
@@ -125,7 +131,8 @@ jobs:
125131
steps:
126132
- uses: actions/download-artifact@v4
127133
with:
128-
pattern: wheels-* # Download the wheels artifact
134+
name: wheels-*
135+
path: ./wheelhouse
129136
merge-multiple: true # Merge all the wheels artifacts into one directory
130137

131138
- uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: trailing-whitespace
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.8.6
19+
rev: v0.9.4
2020
hooks:
2121
- id: ruff
2222
args: ["--fix", "--show-fixes"]

ANNOUNCE.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
Announcing Python-Blosc2 3.0.0 final
2-
====================================
1+
Announcing Python-Blosc2 3.1.0 (and 3.1.1)
2+
==========================================
33

4-
The Blosc development team is pleased to announce the final release for
5-
Python-Blosc2 3.0.0. Now, we will be producing conda(-forge) packages,
6-
as well as providing wheels for the most common platforms, as usual.
4+
This is a minor release where we optimized the performance of the
5+
internal compute engine, as well as indexing for NDArrays. We also
6+
added new API:
7+
8+
* blosc2.evaluate: a drop-in replacement of numexpr.evaluate(). This
9+
allows to evaluate expressions with combinations of NDArrays and NumPy
10+
arrays. In addition, it has the next improvements:
11+
12+
- More functionality than numexpr (e.g. reductions).
13+
- Follow casting rules of NumPy more closely.
14+
- Use both NumPy arrays and Blosc2 NDArrays in the same expression.
15+
16+
* blosc2.jit: a decorator to compile a function with a NumPy expression
17+
using the compute engine of Blosc2. Useful to speed up the evaluation
18+
of pure NumPy expressions at runtime.
719

820
You can think of Python-Blosc2 3.0 as an extension of NumPy/numexpr that:
921

@@ -17,7 +29,7 @@ You can think of Python-Blosc2 3.0 as an extension of NumPy/numexpr that:
1729

1830
Install it with::
1931

20-
pip install blosc2==3.0.0 # if you prefer wheels
32+
pip install blosc2 --update # if you prefer wheels
2133
conda install -c conda-forge python-blosc2 mkl # if you prefer conda and MKL
2234

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

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ else()
5050
include(FetchContent)
5151
FetchContent_Declare(blosc2
5252
GIT_REPOSITORY https://github.com/Blosc/c-blosc2
53-
GIT_TAG d92b88e535f168fae45874b936b187c790fc9d59
53+
GIT_TAG 34db770e436aa4ceaa9b9110948f8dac1f1f443d
5454
)
5555
FetchContent_MakeAvailable(blosc2)
5656
include_directories("${blosc2_SOURCE_DIR}/include")

RELEASE_NOTES.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,66 @@
11
# Release notes
22

3-
## Changes from 3.0.0 to 3.0.1
3+
## Changes from 3.1.1 to 3.1.2
44

5-
XXX version-specific blurb XXX
5+
* Structured arrays can be larger than 255 bytes now. This was a limitation
6+
in the previous versions, but now it is gone (the new limit is ~512 MB,
7+
which I hope will be enough for some time).
68

79

10+
## Changes from 3.1.0 to 3.1.1
11+
12+
* Quick release to fix an issue with version number in the package (was reporting 3.0.0
13+
instead of 3.1.0).
14+
15+
16+
## Changes from 3.0.0 to 3.1.0
17+
18+
### Improvements
19+
20+
* Optimizations for the compute engine. Now, it is faster and uses less memory.
21+
In particular, careful attention has been paid to the memory handling, as
22+
this is the main bottleneck for the compute engine in many instances.
23+
24+
* Improved detection of CPU cache sizes for Linux and macOS. In particular,
25+
support for multi-CCX (AMD EPYC) and multi-socket systems has been implemented.
26+
Now, the library should be able to detect the cache sizes for most of the
27+
CPUs out there (specially on Linux).
28+
29+
* Optimization on NDArray slicing when the slice is a single chunk. This is a
30+
common operation when working with NDArray instances, and now it is faster.
31+
32+
### New API functions and decorators
33+
34+
* New `blosc2.evaluate()` function for evaluating expressions on NDArray/NumPy
35+
instances. This a drop-in replacement of `numexpr.evaluate()`, but with the
36+
next improvements:
37+
- More functionality than numexpr (e.g. reductions).
38+
- Follow casting rules of NumPy more closely.
39+
- Use both NumPy arrays and Blosc2 NDArrays in the same expression.
40+
41+
See [here](https://www.blosc.org/python-blosc2/reference/autofiles/utilities/blosc2.evaluate.html)
42+
for more information.
43+
44+
* New `blosc2.jit` decorator for allowing NumPy expressions to be computed
45+
using the Blosc2 compute engine. This is a powerful feature that allows for
46+
efficient computations on compressed data, and supports advanced features like
47+
reductions, filters and broadcasting. See
48+
[here](https://www.blosc.org/python-blosc2/reference/autofiles/utilities/blosc2.jit.html)
49+
for more information.
50+
51+
* Support `out=` in `blosc2.mean()`, `blosc2.std()` and `blosc2.var()` reductions
52+
(besides `blosc2.sum()` and `blosc2.prod()`).
53+
54+
55+
### Others
56+
57+
* Bumped to use latest C-Blosc2 sources (2.16.0).
58+
59+
* The cache for cpuinfo is now stored in `${HOME}/.cache/python-blosc2/cpuinfo.json`
60+
instead of `${HOME}/.blosc2-cpuinfo.json`; you can get rid of the latter, as
61+
the former is more standard (see PR #360). Thanks to Jonas Lundholm Bertelsen
62+
(@jonaslb).
63+
864
## Changes from 3.0.0-rc.3 to 3.0.0
965

1066
* A persistent cache for cpuinfo (stored in `$HOME/.blosc2-cpuinfo.json`) is

RELEASING.rst

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ Python-Blosc2 release procedure
44
Preliminaries
55
-------------
66

7-
* Set the version number in ``pyproject.toml`` to the new version number (e.g. ``X.Y.Z``).
7+
* Set the version number for the release by using::
8+
9+
python update_version.py X.Y.Z
10+
11+
and double-check the updated version number in ``pyproject.toml`` and with::
12+
13+
python -c "import blosc2; print(blosc2.__version__)"
814

915
* Make sure that the c-blosc2 repository is updated to the latest version (or a specific
1016
version that will be documented in the ``RELEASE_NOTES.md``). In ``CMakeLists.txt`` edit::
@@ -18,11 +24,10 @@ Preliminaries
1824

1925
* Make sure that the current main branch is passing the tests in continuous integration.
2026

21-
* Build the package and make sure that::
27+
* Build the package and make sure that tests are passing::
2228

23-
python -c "import blosc2; blosc2.print_versions()"
24-
25-
is printing the correct versions.
29+
pip install -e ".[test]"
30+
pytest
2631

2732
* Make sure that ``RELEASE_NOTES.md`` and ``ANNOUNCE.rst`` are up to date with the
2833
latest news in the release.
@@ -53,19 +58,35 @@ Tagging
5358

5459
git push --tags
5560

61+
* If you happen to have to delete the tag, such as artifacts demonstrates a fault, first delete it locally::
62+
63+
git tag --delete vX.Y.Z
64+
65+
and then remotely on Github:
66+
67+
git push --delete origin vX.Y.Z
68+
5669
* Make sure that the tag is passing the tests in continuous integration (this
57-
may take more than an hour).
70+
may take about 30 min).
71+
72+
* In case the automatic upload to PyPI fails, you can upload the package
73+
wheels (and tarball!) by downloading the artifacts manually, copying to
74+
an empty dir (say dist), and upload to PyPI with::
75+
76+
rm dist/*
77+
# download artifacts from the tag in github
78+
twine upload --repository blosc dist/*
5879

5980
* Update the latest release in the ``doc/python-blosc2.rst`` file with the new version
6081
number (and date?). Do a commit::
6182

6283
git commit -a -m "Update latest release in doc"
6384
git push
6485

65-
* Go to ``Blosc/blogsite`` repo, then to "Actions", click on the most recent
66-
workflow run (at the top of the list), and then click on the "Re-run all
67-
jobs" button to regenerate the documentation and check that it has been
68-
correctly updated in https://www.blosc.org.
86+
* Go to ``https://github.com/Blosc/blogsite`` repo, then to "Actions", click
87+
on the most recent workflow run (at the top of the list), and then click on
88+
the "Re-run all jobs" button to regenerate the documentation and check that
89+
it has been correctly updated in https://www.blosc.org.
6990

7091

7192
Checking packaging
@@ -93,6 +114,7 @@ Announcing
93114
skeleton (or possibly as the definitive version). Start the subject with ANN:.
94115

95116
* Announce in Mastodon via https://fosstodon.org/@Blosc2 account and rejoice.
117+
Announce it in Bluesky too.
96118

97119

98120
Post-release actions
@@ -109,8 +131,9 @@ Post-release actions
109131

110132
XXX version-specific blurb XXX
111133

112-
* Update the version number in ``pyproject.toml`` to the next version number
113-
(e.g. ``X.Y.(Z+1).dev``).
134+
* Update the version number in ``pyproject.toml`` and ``version.py`` to the next version number::
135+
136+
python update_version.py X.Y.(Z+1).dev0
114137

115138
* Commit your changes with::
116139

0 commit comments

Comments
 (0)