Skip to content

Commit

Permalink
Enforce repo-review rules
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Aug 10, 2024
1 parent e76bc42 commit 4a03074
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ repos:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/scientific-python/cookie
rev: 2024.04.23
hooks:
- id: sp-repo-review
2 changes: 1 addition & 1 deletion .pyup.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# autogenerated pyup.io config file
# autogenerated pyup.io config file
# see https://pyup.io/docs/configuration/ for all available options

schedule: every month
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Numcodecs
=========

Numcodecs is a Python package providing buffer compression and transformation
Numcodecs is a Python package providing buffer compression and transformation
codecs for use in data storage and communication applications.

.. image:: https://readthedocs.org/projects/numcodecs/badge/?version=latest
Expand Down
2 changes: 1 addition & 1 deletion docs/checksum32.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ JenkinsLookup3
--------------

.. autoclass:: JenkinsLookup3

.. autoattribute:: codec_id
.. autoattribute:: initval
.. autoattribute:: prefix
Expand Down
2 changes: 1 addition & 1 deletion numcodecs/blosc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def decompress_partial(source, start, nitems, dest=None):
raise RuntimeError('error during blosc partial decompression: %d', ret)

return dest


# set the value of this variable to True or False to override the
# default adaptive behaviour
Expand Down
8 changes: 4 additions & 4 deletions numcodecs/jenkins.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ cpdef uint32_t jenkins_lookup3(const uint8_t[::1] _data, uint32_t initval=0):
if length == 12:
c += (<uint32_t>k[11]) << 24
length -= 1

if length == 11:
c += (<uint32_t>k[10]) << 16
length -= 1
Expand Down Expand Up @@ -231,7 +231,7 @@ cdef inline uint32_t _jenkins_lookup3_final(uint32_t a, uint32_t b, uint32_t c):
the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
is commonly produced by subtraction) look like a single 1-bit
difference.
* the base values were pseudorandom, all zero but one bit set, or
* the base values were pseudorandom, all zero but one bit set, or
all zero plus a counter that starts at zero.
These constants passed:
Expand Down Expand Up @@ -279,7 +279,7 @@ cdef inline (uint32_t, uint32_t, uint32_t) _jenkins_lookup3_mix(uint32_t a, uint
the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
is commonly produced by subtraction) look like a single 1-bit
difference.
* the base values were pseudorandom, all zero but one bit set, or
* the base values were pseudorandom, all zero but one bit set, or
all zero plus a counter that starts at zero.
Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that
Expand All @@ -289,7 +289,7 @@ cdef inline (uint32_t, uint32_t, uint32_t) _jenkins_lookup3_mix(uint32_t a, uint
14 9 3 7 17 3
Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
for "differ" defined as + with a one-bit base and a two-bit delta. I
used http://burtleburtle.net/bob/hash/avalanche.html to choose
used http://burtleburtle.net/bob/hash/avalanche.html to choose
the operations, constants, and arrangements of the variables.
This does not achieve avalanche. There are input bits of (a,b,c)
Expand Down
6 changes: 3 additions & 3 deletions numcodecs/zstd.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ cdef extern from "zstd.h":

ZSTD_CCtx* ZSTD_createCCtx() nogil
size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx) nogil
size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx,
ZSTD_cParameter param,
size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx,
ZSTD_cParameter param,
int value) nogil

size_t ZSTD_compress2(ZSTD_CCtx* cctx,
Expand Down Expand Up @@ -235,7 +235,7 @@ class Zstd(Codec):
"""

codec_id = 'zstd'

# Note: unlike the LZ4 and Blosc codecs, there does not appear to be a (currently)
# practical limit on the size of buffers that Zstd can process and so we don't
# enforce a max_buffer_size option here.
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ msgpack = [
]
zfpy = [
"zfpy>=1.0.0",
"numpy<2.0.0",
"numpy<2.0.0",
]
pcodec = [
"pcodec>=0.2.0",
Expand Down Expand Up @@ -98,6 +98,9 @@ exclude_lines = [
"pragma: ${PY_MAJOR_VERSION} no cover",
]

[tool.repo-review]
ignore = ["PY005", "PY007", "PP302", "PP304", "PP308", "GH103", "GH212", "PC111", "PC140", "PC160", "PC170", "PC180", "MY100", "RF103"]

[tool.pytest.ini_options]
addopts = "-ra --strict-config --strict-markers --cov=numcodecs --cov-report xml --doctest-modules --doctest-glob=*.pyx"
doctest_optionflags = [
Expand Down

0 comments on commit 4a03074

Please sign in to comment.