[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri Jun 23 06:09:05 PDT 2017
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/4c25b930612c/
Changeset: 4c25b930612c
User: ngoldbaum
Date: 2017-06-22 16:35:02+00:00
Summary: improvements for FNV hash
Affected #: 2 files
diff -r b5fa47f8c92aaee458b551ee225fb6d22b3d5cd2 -r 4c25b930612c9ffd8b6d0915bda4e4aba866d70b yt/utilities/lib/fnv_hash.pxd
--- a/yt/utilities/lib/fnv_hash.pxd
+++ b/yt/utilities/lib/fnv_hash.pxd
@@ -18,4 +18,4 @@
import numpy as np
cimport numpy as np
-cdef np.int64_t c_fnv_hash(unsigned char[:] octets)
+cdef np.int64_t c_fnv_hash(unsigned unsigned char[:] octets) nogil
diff -r b5fa47f8c92aaee458b551ee225fb6d22b3d5cd2 -r 4c25b930612c9ffd8b6d0915bda4e4aba866d70b yt/utilities/lib/fnv_hash.pyx
--- a/yt/utilities/lib/fnv_hash.pyx
+++ b/yt/utilities/lib/fnv_hash.pyx
@@ -15,13 +15,18 @@
import numpy as np
cimport numpy as np
-cdef np.int64_t c_fnv_hash(unsigned char[:] octets):
+cimport cython
+
+ at cython.wraparound(False)
+ at cython.boundscheck(False)
+cdef np.int64_t c_fnv_hash(unsigned char[:] octets) nogil:
# https://bitbucket.org/yt_analysis/yt/issues/1052/field-access-tests-fail-under-python3
# FNV hash cf. http://www.isthe.com/chongo/tech/comp/fnv/index.html
cdef np.int64_t hash_val = 2166136261
- cdef char octet
- for octet in octets:
- hash_val = hash_val ^ octet
+ cdef unsigned char octet
+ cdef int i
+ for i in range(octets.shape[0]):
+ hash_val = hash_val ^ octets[i]
hash_val = hash_val * 16777619
return hash_val
https://bitbucket.org/yt_analysis/yt/commits/2fc4b8bc2f00/
Changeset: 2fc4b8bc2f00
User: jzuhone
Date: 2017-06-23 13:08:52+00:00
Summary: Merge pull request #1462 from ngoldbaum/fnv-change
Improvements for FNV hash
Affected #: 2 files
diff -r 41060eb49b72a97f7f50d93dd7248b4c585a88a7 -r 2fc4b8bc2f00c540b11c37bd82aefb39ab1537a0 yt/utilities/lib/fnv_hash.pxd
--- a/yt/utilities/lib/fnv_hash.pxd
+++ b/yt/utilities/lib/fnv_hash.pxd
@@ -18,4 +18,4 @@
import numpy as np
cimport numpy as np
-cdef np.int64_t c_fnv_hash(unsigned char[:] octets)
+cdef np.int64_t c_fnv_hash(unsigned unsigned char[:] octets) nogil
diff -r 41060eb49b72a97f7f50d93dd7248b4c585a88a7 -r 2fc4b8bc2f00c540b11c37bd82aefb39ab1537a0 yt/utilities/lib/fnv_hash.pyx
--- a/yt/utilities/lib/fnv_hash.pyx
+++ b/yt/utilities/lib/fnv_hash.pyx
@@ -15,13 +15,18 @@
import numpy as np
cimport numpy as np
-cdef np.int64_t c_fnv_hash(unsigned char[:] octets):
+cimport cython
+
+ at cython.wraparound(False)
+ at cython.boundscheck(False)
+cdef np.int64_t c_fnv_hash(unsigned char[:] octets) nogil:
# https://bitbucket.org/yt_analysis/yt/issues/1052/field-access-tests-fail-under-python3
# FNV hash cf. http://www.isthe.com/chongo/tech/comp/fnv/index.html
cdef np.int64_t hash_val = 2166136261
- cdef char octet
- for octet in octets:
- hash_val = hash_val ^ octet
+ cdef unsigned char octet
+ cdef int i
+ for i in range(octets.shape[0]):
+ hash_val = hash_val ^ octets[i]
hash_val = hash_val * 16777619
return hash_val
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list