Ticket #11334: trac_11334-dtype_object.patch

File trac_11334-dtype_object.patch, 2.1 KB (added by fbissey, 7 years ago)

correct dtype output for objects

  • sage/rings/complex_number.pyx

    # HG changeset patch
    # User Francois Bissey <francois.bissey@canterbury.ac.nz>
    # Date 1363832880 -46800
    # Node ID 227a05dfbaa8d94762ebe43c5a5c740f161b01a7
    # Parent  d5f2dfc014530707f8a3744f4867c0073e08c0b9
    deal with change to dtype output
    
    diff --git a/sage/rings/complex_number.pyx b/sage/rings/complex_number.pyx
    a b  
    246246                sage: numpy.array([1.0, 2.5j]).dtype
    247247                dtype('complex128')
    248248                sage: numpy.array([1.000000000000000000000000000000000000j]).dtype
    249                 dtype('object')
     249                dtype('O')
    250250            """
    251251            if self._prec <= 57: # max size of repr(float)
    252252                return numpy_complex_interface
  • sage/rings/integer.pyx

    diff --git a/sage/rings/integer.pyx b/sage/rings/integer.pyx
    a b  
    49244924                sage: numpy.array(2**40).dtype
    49254925                dtype('int64')
    49264926                sage: numpy.array(2**400).dtype
    4927                 dtype('object')
     4927                dtype('O')
    49284928               
    49294929                sage: numpy.array([1,2,3,0.1]).dtype
    49304930                dtype('float64')
  • sage/rings/rational.pyx

    diff --git a/sage/rings/rational.pyx b/sage/rings/rational.pyx
    a b  
    715715                sage: numpy.array(QQ(2**40)).dtype
    716716                dtype('int64')
    717717                sage: numpy.array(QQ(2**400)).dtype
    718                 dtype('object')
     718                dtype('O')
    719719
    720720                sage: numpy.array([1, 1/2, 3/4])
    721721                array([ 1.  ,  0.5 ,  0.75])
  • sage/rings/real_mpfr.pyx

    diff --git a/sage/rings/real_mpfr.pyx b/sage/rings/real_mpfr.pyx
    a b  
    13241324                sage: numpy.array([1.0, 1.1, 1.2]).dtype
    13251325                dtype('float64')
    13261326                sage: numpy.array([1.000000000000000000000000000000000000]).dtype
    1327                 dtype('object')
     1327                dtype('O')
    13281328            """
    13291329            if (<RealField_class>self._parent).__prec <= 57: # max size of repr(float)
    13301330                return numpy_double_interface