Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-tinyarray for 
openSUSE:Factory checked in at 2021-12-27 16:07:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tinyarray (Old)
 and      /work/SRC/openSUSE:Factory/.python-tinyarray.new.2520 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-tinyarray"

Mon Dec 27 16:07:20 2021 rev:4 rq:942712 version:1.2.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tinyarray/python-tinyarray.changes        
2021-04-21 21:01:06.846363389 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-tinyarray.new.2520/python-tinyarray.changes  
    2021-12-27 16:07:27.057702745 +0100
@@ -1,0 +2,6 @@
+Fri Dec 24 23:49:00 UTC 2021 - Atri Bhattacharya <badshah...@gmail.com>
+
+- Update to version 1.2.4:
+  * Fixes for python 3.10.
+
+-------------------------------------------------------------------

Old:
----
  tinyarray-1.2.3.tar.gz

New:
----
  tinyarray-1.2.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-tinyarray.spec ++++++
--- /var/tmp/diff_new_pack.lkkqBh/_old  2021-12-27 16:07:27.585703120 +0100
+++ /var/tmp/diff_new_pack.lkkqBh/_new  2021-12-27 16:07:27.589703123 +0100
@@ -18,7 +18,7 @@
 
 %define skip_python36 1
 Name:           python-tinyarray
-Version:        1.2.3
+Version:        1.2.4
 Release:        0
 Summary:        Arrays of numbers for Python, optimized for small sizes
 License:        BSD-2-Clause

++++++ tinyarray-1.2.3.tar.gz -> tinyarray-1.2.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tinyarray-1.2.3/PKG-INFO new/tinyarray-1.2.4/PKG-INFO
--- old/tinyarray-1.2.3/PKG-INFO        2020-09-17 14:23:07.000000000 +0200
+++ new/tinyarray-1.2.4/PKG-INFO        2021-12-17 14:55:14.558119000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tinyarray
-Version: 1.2.3
+Version: 1.2.4
 Summary: Arrays of numbers for Python, optimized for small sizes
 Home-page: https://gitlab.kwant-project.org/kwant/tinyarray
 Author: Christoph Groth (CEA) and others
@@ -18,7 +18,9 @@
         Unlike Python's built-in tuples, Tinyarrays support mathematical
         operations like element-wise addition and matrix multiplication.  
Unlike
         Numpy arrays, Tinyarrays can be used as dictionary keys because they 
are
-        hashable and immutable.
+        hashable and immutable.  What is more, tinyarrays are equivalent to
+        tuples with regard to hashing and comparisons: a dictionary or set with
+        tinyarray keys may by transparently indexed by tuples.
         
         The module's interface is a subset of that of NumPy and thus should be
         familiar to many.  Whenever an operation is missing from Tinyarray,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tinyarray-1.2.3/README.rst 
new/tinyarray-1.2.4/README.rst
--- old/tinyarray-1.2.3/README.rst      2017-05-22 14:59:27.000000000 +0200
+++ new/tinyarray-1.2.4/README.rst      2020-09-18 15:48:14.000000000 +0200
@@ -12,7 +12,9 @@
 Unlike Python's built-in tuples, Tinyarrays support mathematical
 operations like element-wise addition and matrix multiplication.  Unlike
 Numpy arrays, Tinyarrays can be used as dictionary keys because they are
-hashable and immutable.
+hashable and immutable.  What is more, tinyarrays are equivalent to
+tuples with regard to hashing and comparisons: a dictionary or set with
+tinyarray keys may by transparently indexed by tuples.
 
 The module's interface is a subset of that of NumPy and thus should be
 familiar to many.  Whenever an operation is missing from Tinyarray,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tinyarray-1.2.3/src/array.cc 
new/tinyarray-1.2.4/src/array.cc
--- old/tinyarray-1.2.3/src/array.cc    2020-09-16 14:15:36.000000000 +0200
+++ new/tinyarray-1.2.4/src/array.cc    2021-12-16 16:46:04.000000000 +0100
@@ -815,7 +815,7 @@
 // the only documentation for this is in the Python sourcecode
 const Py_hash_t HASH_IMAG = _PyHASH_IMAG;
 
-Py_hash_t hash(long x)
+Py_hash_t hash(void *inst, long x)
 {
     // For integers the hash is just the integer itself modulo _PyHASH_MODULUS
     // except for the singular case of -1.
@@ -834,24 +834,30 @@
 typedef unsigned long Py_uhash_t;
 const Py_hash_t HASH_IMAG = 1000003L;
 
-Py_hash_t hash(long x)
+Py_hash_t hash(void *inst, long x)
 {
     return x != -1 ? x : -2;
 }
 
 #endif
 
-Py_hash_t hash(double x)
+// We used to have our own implementation of this, but the extra function
+// call is quite negligible compared to the execution time of the function.
+#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 10
+Py_hash_t hash(void *inst, double x)
+{
+    return _Py_HashDouble((PyObject *)inst, x);
+#else
+Py_hash_t hash(void *, double x)
 {
-    // We used to have our own implementation of this, but the extra function
-    // call is quite negligible compared to the execution time of the function.
     return _Py_HashDouble(x);
+#endif
 }
 
-Py_hash_t hash(Complex x)
+Py_hash_t hash(void *inst, Complex x)
 {
     // x.imag == 0  =>  hash(x.imag) == 0  =>  hash(x) == hash(x.real)
-    return hash(x.real()) + HASH_IMAG * hash(x.imag());
+    return hash(inst, x.real()) + HASH_IMAG * hash(inst, x.imag());
 }
 
 // The following routine calculates the hash of a multi-dimensional array.  The
@@ -875,7 +881,7 @@
     Array<T> *self = reinterpret_cast<Array<T> *>(obj);
     self->ndim_shape(&ndim, &shape);
     T *p = self->data();
-    if (ndim == 0) return hash(*p);
+    if (ndim == 0) return hash(p, *p);
 
     const Py_uhash_t mult_init = 1000003, r_init = 0x345678;
     const Py_uhash_t mul_addend = 82520, r_addend = 97531;
@@ -891,7 +897,8 @@
             --i[d];
             if (d == ndim) {
                 // Innermost loop body.
-                r[d] = (r[d] ^ hash(*p++)) * mult[d];
+                r[d] = (r[d] ^ hash(p, *p)) * mult[d];
+                p++;
                 mult[d] += mul_addend + 2 * i[d];
             } else {
                 // Entering a loop.
@@ -958,7 +965,7 @@
     Array<T> *self = reinterpret_cast<Array<T> *>(obj);
     self->ndim_shape(&ndim, &shape);
     T *p = self->data();
-    if (ndim == 0) return hash(*p);
+    if (ndim == 0) return hash(p, *p);
 
     Py_ssize_t i[max_ndim];
     Py_uhash_t acc[max_ndim];
@@ -971,7 +978,8 @@
         if (i[d]) {
             --i[d];
             if (d == ndim) {
-                _hash_inner_loop(acc[d], hash(*p++));
+                _hash_inner_loop(acc[d], hash(p, *p));
+                p++;
             } else {
                 ++d;
                 i[d] = shape[d];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tinyarray-1.2.3/test_tinyarray.py 
new/tinyarray-1.2.4/test_tinyarray.py
--- old/tinyarray-1.2.3/test_tinyarray.py       2020-09-17 13:11:34.000000000 
+0200
+++ new/tinyarray-1.2.4/test_tinyarray.py       2021-12-16 16:46:04.000000000 
+0100
@@ -15,6 +15,7 @@
 import numpy as np
 from numpy.testing import assert_equal, assert_almost_equal
 import sys
+import ctypes
 import random
 
 
@@ -166,24 +167,33 @@
                     assert isinstance(dest[0], dest_dtype)
                     assert src == dest
 
-    # Check correct overflow detection.  We assume a typical architecture:
-    # sys.maxsize is also the maximum size of an integer held in a tinyarray
-    # array, and that Python floats are double-precision IEEE numbers.
-    for n in [10**100, -10**100, 123 * 10**20, -2 * sys.maxsize,
-              sys.maxsize + 1, np.array(sys.maxsize + 1),
-              -sys.maxsize - 2]:
+    # Determine maximum value of the C "long" type.  This is different from
+    # sys.maxsize, notably on 64 bit Windows.
+    maxlong = 2 ** (ctypes.sizeof(ctypes.c_long) * 8 - 1) - 1
+
+    # Check correct overflow detection when integers are used to initialize
+    # integer tinyarrays.
+    for n in [10**100, -10**100, 123 * 10**20, -2 * maxlong,
+              maxlong + 1, np.array(maxlong + 1),
+              -maxlong - 2]:
         raises(OverflowError, ta.array, n, int)
 
-    # Check that values just below the threshold of overflow work.
-    for n in [sys.maxsize, np.array(sys.maxsize),
-              -sys.maxsize - 1, np.array(-sys.maxsize - 1)]:
+    # Same as above, but check that values just under the threshold of overflow
+    # do work.
+    for n in [maxlong, np.array(maxlong),
+              -maxlong - 1, np.array(-maxlong - 1)]:
         ta.array(n, int)
 
-    # If tinyarray integers are longer than 32 bit, numbers around the maximal
-    # and minimal values cannot be represented exactly as double precision
-    # floating point numbers.  Check correct overflow detection also in this
-    # case.
-    n = sys.maxsize + 1
+    # Check correct overflow detection when floating point numbers are used to
+    # initialize integer tinyarrays.
+    #
+    # Correct overflow detection is tricky when tinyarray integers are 64 bit,
+    # since the distance between adjacent floating point numbers is larger than
+    # one for numbers corresponding to large integers.
+    #
+    # The following assumes that Python floats are common double-precision IEEE
+    # numbers.
+    n = maxlong + 1
     for dtype in [float, np.float64, np.float32]:
         # The following assumes that n can be represented exactly.  This should
         # be true for typical (all?) architectures.
@@ -313,7 +323,7 @@
     int_bits = (8 * ta.dtype_size[int]) - 1  # 8 bits per byte, minus 1 sign 
bit
     maxint = 2**(int_bits)
 
-    special = [float('nan'), float('inf'), float('-inf'),
+    special = [float('inf'), float('-inf'),
                0, -1, -1.0, -1 + 0j,
                303, -312424, -0.3, 1.7, 0.4j, -12.3j, 1 - 12.3j, 1.3 - 12.3j,
                (), (-1,), (2,),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tinyarray-1.2.3/tinyarray.egg-info/PKG-INFO 
new/tinyarray-1.2.4/tinyarray.egg-info/PKG-INFO
--- old/tinyarray-1.2.3/tinyarray.egg-info/PKG-INFO     2020-09-17 
14:23:07.000000000 +0200
+++ new/tinyarray-1.2.4/tinyarray.egg-info/PKG-INFO     2021-12-17 
14:55:14.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tinyarray
-Version: 1.2.3
+Version: 1.2.4
 Summary: Arrays of numbers for Python, optimized for small sizes
 Home-page: https://gitlab.kwant-project.org/kwant/tinyarray
 Author: Christoph Groth (CEA) and others
@@ -18,7 +18,9 @@
         Unlike Python's built-in tuples, Tinyarrays support mathematical
         operations like element-wise addition and matrix multiplication.  
Unlike
         Numpy arrays, Tinyarrays can be used as dictionary keys because they 
are
-        hashable and immutable.
+        hashable and immutable.  What is more, tinyarrays are equivalent to
+        tuples with regard to hashing and comparisons: a dictionary or set with
+        tinyarray keys may by transparently indexed by tuples.
         
         The module's interface is a subset of that of NumPy and thus should be
         familiar to many.  Whenever an operation is missing from Tinyarray,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tinyarray-1.2.3/version new/tinyarray-1.2.4/version
--- old/tinyarray-1.2.3/version 2020-09-17 14:23:07.000000000 +0200
+++ new/tinyarray-1.2.4/version 2021-12-17 14:55:14.562119000 +0100
@@ -1,2 +1,2 @@
 # This file has been generated by setup.py.
-1.2.3
+1.2.4

Reply via email to