Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 393679 | Differences between
and this patch

Collapse All | Expand All

(-)tests/run/numpy_test.pyx (-39 lines)
Lines 211-239 Link Here
211
    
211
    
212
"""
212
"""
213
213
214
    if np.__version__ >= '1.6':
215
        __doc__ += u"""
216
        The following expose bugs in Numpy (versions prior to 2011-04-02):
217
        
218
        >>> print(test_partially_packed_align(np.zeros((1,), dtype=np.dtype([('a', 'b'), ('b', 'i'), ('sub', np.dtype('b,i')), ('c', 'i')], align=True))))
219
        array([(22, 23, (24, 25), 26)], 
220
              dtype=[('a', '|i1'), ('', '|V3'), ('b', '!i4'), ('sub', [('f0', '|i1'), ('f1', '!i4')]), ('', '|V3'), ('c', '!i4')])
221
    
222
        >>> print(test_partially_packed_align_2(np.zeros((1,), dtype=np.dtype([('a', 'b'), ('b', 'i'), ('c', 'b'), ('sub', np.dtype('b,i', align=True))]))))
223
        array([(22, 23, 24, (27, 28))], 
224
              dtype=[('a', '|i1'), ('b', '!i4'), ('c', '|i1'), ('sub', [('f0', '|i1'), ('', '|V3'), ('f1', '!i4')])])
225
    
226
        >>> print(test_partially_packed_align(np.zeros((1,), dtype=np.dtype([('a', 'b'), ('b', 'i'), ('sub', np.dtype('b,i')), ('c', 'i')], align=False)))) #doctest: +ELLIPSIS
227
        Traceback (most recent call last):
228
            ...
229
        ValueError: ...
230
    
231
        >>> print(test_partially_packed_align_2(np.zeros((1,), dtype=np.dtype([('a', 'b'), ('b', 'i'), ('c', 'b'), ('sub', np.dtype('b,i', align=False))])))) #doctest: +ELLIPSIS
232
        Traceback (most recent call last):
233
            ...
234
        ValueError: ...
235
        """
236
237
except:
214
except:
238
    __doc__ = u""
215
    __doc__ = u""
239
216
Lines 448-469 Link Here
448
    arr[0].b = 23    
425
    arr[0].b = 23    
449
    return repr(arr).replace('<', '!').replace('>', '!')
426
    return repr(arr).replace('<', '!').replace('>', '!')
450
427
451
def test_partially_packed_align(np.ndarray[PartiallyPackedStruct] arr):
452
    arr[0].a = 22
453
    arr[0].b = 23
454
    arr[0].sub.a = 24
455
    arr[0].sub.b = 25
456
    arr[0].c = 26
457
    return repr(arr).replace('<', '!').replace('>', '!')
458
459
def test_partially_packed_align_2(np.ndarray[PartiallyPackedStruct2] arr):
460
    arr[0].a = 22
461
    arr[0].b = 23
462
    arr[0].c = 24
463
    arr[0].sub.a = 27
464
    arr[0].sub.b = 28
465
    return repr(arr).replace('<', '!').replace('>', '!')
466
467
def test_complextypes():
428
def test_complextypes():
468
    cdef np.complex64_t x64 = 1, y64 = 1j
429
    cdef np.complex64_t x64 = 1, y64 = 1j
469
    cdef np.complex128_t x128 = 1, y128 = 1j
430
    cdef np.complex128_t x128 = 1, y128 = 1j

Return to bug 393679