Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for byte shuffle as a codec so that it can be used as a Zarr filter #273

Merged
merged 33 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fd7adbb
Add numba to requirements
Feb 17, 2021
bb912ec
Add shuffle to codec registry
Feb 17, 2021
99451ab
First implementation of shuffle with numba
Feb 17, 2021
143c7f3
Shuffle tests
Feb 17, 2021
4aa207d
fix pep8 issues
Feb 17, 2021
3356e3c
pep8 fix
Feb 17, 2021
ebc01e0
Add numba to setup.py for wheels
Mar 2, 2021
5875c44
Add install requirements for numba
Mar 3, 2021
40b35b0
Test numba==0.53.0rc2 for Python 3.9 support
Mar 3, 2021
2db05b6
shuffle with cython (#1)
martindurant Mar 11, 2021
2592cc2
removed shuffle.c
Mar 11, 2021
e0687d3
Remove numba dependency
Mar 11, 2021
05ca79c
remove shuffle.py
Mar 11, 2021
5789d13
tidy up init
Mar 11, 2021
51a9e36
reinstate updated shuffle.c
Mar 11, 2021
49729f0
update shuffle.c to python 3.9 cython
Mar 11, 2021
786cc4d
add exception handling to filter reg in init
Mar 11, 2021
fdc06c8
add mdurants optimised cython, fixtures and expected result test
Mar 12, 2021
2a5ae74
revert init error handler
Mar 12, 2021
a22c390
fix flake8
Mar 12, 2021
382bb68
change from int to Py_ssize_t
Mar 12, 2021
68eb615
update docs
Mar 12, 2021
cabff90
reinstate init error handler for CI
Mar 12, 2021
4850825
Update numcodecs/shuffle.pyx
pbranson Mar 12, 2021
9733a51
Update numcodecs/shuffle.pyx
pbranson Mar 12, 2021
06f380e
refactor to remove unecessessary intermediate fncs
Mar 12, 2021
29036e9
Merge online changes
Mar 12, 2021
edda78e
Refactor to separate cython from
Mar 15, 2021
e92f1ec
Adjust setup.py
Mar 15, 2021
26573c6
Tidy release notes, catch register importError
Mar 15, 2021
a520bfd
Merge upstream and finalise
Mar 18, 2021
7567209
fix merge error in docs
Mar 18, 2021
fcdf9a0
Correct incorrect username for martindurant
Mar 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Contents
pickles
msgpacks
vlen
shuffle
release
contributing

Expand All @@ -96,6 +97,8 @@ documentation, code reviews, comments and/or ideas:
* :user:`Trevor Manz <manzt>`
* :user:`Grzegorz Bokota <Czaki>`
* :user:`Josh Moore <joshmoore>`
* :user:`Martin Durant <mdurant>`
pbranson marked this conversation as resolved.
Show resolved Hide resolved
* :user:`Paul Branson <pbranson>`

Numcodecs bundles the `c-blosc <https://github.com/Blosc/c-blosc>`_ library.

Expand Down
8 changes: 8 additions & 0 deletions docs/release.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Release notes
=============

.. _release_0.7.4:

0.7.4
-----

* Add support for Python 3.9 and Update GitHub Actions.
By :user:`Paul Branson <pbranson>` and :user:`Martin Durant <mdurant>` :issue:`273`.
pbranson marked this conversation as resolved.
Show resolved Hide resolved

.. _release_0.7.3:

0.7.3
Expand Down
9 changes: 9 additions & 0 deletions docs/shuffle.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Shuffle
=======
.. automodule:: numcodecs.shuffle

.. autoclass:: Shuffle

.. autoattribute:: codec_id
.. automethod:: encode
.. automethod:: decode
Binary file added fixture/shuffle/array.00.npy
Binary file not shown.
Binary file added fixture/shuffle/array.01.npy
Binary file not shown.
Binary file added fixture/shuffle/array.02.npy
Binary file not shown.
Binary file added fixture/shuffle/array.03.npy
Binary file not shown.
Binary file added fixture/shuffle/array.04.npy
Binary file not shown.
Binary file added fixture/shuffle/array.05.npy
Binary file not shown.
Binary file added fixture/shuffle/array.06.npy
Binary file not shown.
Binary file added fixture/shuffle/array.07.npy
Binary file not shown.
Binary file added fixture/shuffle/array.08.npy
Binary file not shown.
Binary file added fixture/shuffle/array.09.npy
Binary file not shown.
Binary file added fixture/shuffle/array.10.npy
Binary file not shown.
Binary file added fixture/shuffle/array.11.npy
Binary file not shown.
Binary file added fixture/shuffle/array.12.npy
Binary file not shown.
4 changes: 4 additions & 0 deletions fixture/shuffle/codec.00/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"elementsize": 4,
"id": "shuffle"
}
Binary file added fixture/shuffle/codec.00/encoded.00.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.01.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.02.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.03.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.04.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.05.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.06.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.07.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.08.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.09.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.10.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.11.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.00/encoded.12.dat
Binary file not shown.
4 changes: 4 additions & 0 deletions fixture/shuffle/codec.01/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"elementsize": 0,
"id": "shuffle"
}
Binary file added fixture/shuffle/codec.01/encoded.00.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.01.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.02.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.03.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.04.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.05.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.06.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.07.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.08.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.09.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.10.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.11.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.01/encoded.12.dat
Binary file not shown.
4 changes: 4 additions & 0 deletions fixture/shuffle/codec.02/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"elementsize": 4,
"id": "shuffle"
}
Binary file added fixture/shuffle/codec.02/encoded.00.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.01.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.02.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.03.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.04.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.05.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.06.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.07.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.08.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.09.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.10.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.11.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.02/encoded.12.dat
Binary file not shown.
4 changes: 4 additions & 0 deletions fixture/shuffle/codec.03/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"elementsize": 8,
"id": "shuffle"
}
Binary file added fixture/shuffle/codec.03/encoded.00.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.01.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.02.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.03.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.04.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.05.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.06.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.07.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.08.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.09.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.10.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.11.dat
Binary file not shown.
Binary file added fixture/shuffle/codec.03/encoded.12.dat
Binary file not shown.
7 changes: 7 additions & 0 deletions numcodecs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
from numcodecs.base64 import Base64
register_codec(Base64)

try:
from numcodecs import shuffle
from numcodecs.shuffle import Shuffle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this can fail, as it has no dependencies (like gzip)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I thought the same, not sure what is going on but the tests fail on all platforms except linux if I dont include the exception handling (e.g. https://github.com/zarr-developers/numcodecs/pull/273/checks?check_run_id=2091910819)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakirkham do you have any advice on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored to separate cython code from python class

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still has errors on platforms other than linux....

register_codec(Shuffle)
except ImportError: # pragma: no cover
pass

try:
from numcodecs.msgpacks import MsgPack
register_codec(MsgPack)
Expand Down
Loading