Skip to content

Commit

Permalink
Getting ready for release 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Oct 12, 2022
1 parent d067d3a commit 3660c95
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cibuildwheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-build.txt
python -m pip install -r requirements-tests.txt
python -m pip install -r requirements-test-wheels.txt
- name: Build wheels (Windows)
if: runner.os == 'Windows'
Expand All @@ -72,7 +72,7 @@ jobs:
env:
CIBW_BUILD: 'cp38-win_amd64 cp39-win_amd64 cp310-win_amd64'
CIBW_BEFORE_BUILD: python -m pip install -r requirements-build.txt
CIBW_BEFORE_TEST: python -m pip install -r requirements-tests.txt
CIBW_BEFORE_TEST: python -m pip install -r requirements-test-wheels.txt
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
CIBW_BUILD_VERBOSITY: 1

Expand All @@ -87,7 +87,7 @@ jobs:
CIBW_SKIP: '*-manylinux*_i686'
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_BEFORE_BUILD: python -m pip install -r requirements-build.txt
CIBW_BEFORE_TEST: python -m pip install -r requirements-tests.txt
CIBW_BEFORE_TEST: python -m pip install -r requirements-test-wheels.txt
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
CIBW_BUILD_VERBOSITY: 1

Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release notes

## Changes from 0.5.0 to 0.5.1

* Remove the testing of packing PyTorch or TensorFlow objects during wheels build.


## Changes from 0.4.1 to 0.5.0

* New `pack_tensor`, `unpack_tensor`, `save_tensor` and `load_tensor` functions for serializing/deserializing PyTorch and TensorFlow tensor objects. They also understand NumPy arrays, so these are the new recommended ones for serialization.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.5.1
24 changes: 11 additions & 13 deletions blosc2/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,10 @@ def pack_tensor(tensor, chunksize=None, **kwargs):
Examples
--------
>>> import torch
>>> th = torch.arange(1e6, dtype=torch.float32)
>>> import numpy as np
>>> th = np.arange(1e6, dtype=np.float32)
>>> cframe = blosc2.pack_tensor(th)
>>> len(cframe) < th.size()[0] * 4
>>> len(cframe) < th.size * th.itemsize
True
See also
Expand Down Expand Up @@ -680,11 +680,10 @@ def unpack_tensor(cframe):
Examples
--------
>>> import torch
>>> import numpy as np
>>> th = torch.arange(1e3, dtype=torch.float32)
>>> th = np.arange(1e3, dtype=np.float32)
>>> cframe = blosc2.pack_tensor(th)
>>> len(cframe) < th.size()[0] * 4
>>> len(cframe) < th.size * th.itemsize
True
>>> th2 = blosc2.unpack_tensor(cframe)
>>> a = np.asarray(th)
Expand Down Expand Up @@ -728,10 +727,10 @@ def save_tensor(tensor, urlpath, chunksize=None, **kwargs):
Examples
--------
>>> import torch
>>> th = torch.arange(1e6, dtype=torch.float32)
>>> import numpy as np
>>> th = np.arange(1e6, dtype=np.float32)
>>> serial_size = blosc2.save_tensor(th, "test.bl2", mode="w")
>>> serial_size < th.size()[0] * 4
>>> serial_size < th.size * th.itemsize
True
See also
Expand Down Expand Up @@ -766,13 +765,12 @@ def load_tensor(urlpath):
Examples
--------
>>> import numpy as np
>>> import torch
>>> th = torch.arange(1e6, dtype=torch.float32)
>>> th = np.arange(1e6, dtype=np.float32)
>>> size = blosc2.save_tensor(th, "test.bl2", mode="w")
>>> size < th.size()[0] * 4
>>> size < th.size * th.itemsize
True
>>> th2 = blosc2.load_tensor("test.bl2")
>>> np.array_equal(th.numpy(), th2.numpy())
>>> np.array_equal(th, th2)
True
See also
Expand Down
5 changes: 5 additions & 0 deletions requirements-test-wheels.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pip
numpy
pytest
psutil
msgpack
8 changes: 6 additions & 2 deletions tests/test_array.py → tests/test_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
import numpy as np
import pytest
import blosc2
import torch
import tensorflow as tf

try:
import torch
import tensorflow as tf
except ImportError:
pytest.skip("skipping torch / tensorflow tests", allow_module_level=True)


##### pack / unpack #####
Expand Down

0 comments on commit 3660c95

Please sign in to comment.