pybing/pybing_helpers.py
def _arrptr_to_np(c_arrptr, shape, arr_t, dtype):
    """
    Casts an array pointer from C to numpy
    Input:
        c_arrpt - an array pointer returned from C
        shape   - shape of that array pointer
        arr_t   - the ctypes datatype of c_arrptr
    Avi's code
    """
    arr_t_size = C.POINTER(C.c_char * dtype().itemsize)           # size of each item
    c_arr = C.cast(c_arrptr.astype(int), arr_t_size)              # cast to ctypes
    np_arr = np.ctypeslib.as_array(c_arr, shape)                  # cast to numpy
    np_arr.dtype = dtype                                          # fix numpy dtype
    np_arr = np.require(np_arr, dtype=dtype, requirements=['O'])  # prevent memory leaks
    return np_arr

    Casts an array pointer from C to numpy
    Input:
        c_arrpt - an array pointer returned from C
        shape   - shape of that array pointer
        arr_t   - the ctypes datatype of c_arrptr
    Avi's code
    
Casts an array pointer from C to numpy
Input:
c_arrpt - an array pointer returned from C
shape   - shape of that array pointer
arr_t   - the ctypes datatype of c_arrptr
Avi's code
Casts an array pointer from C to numpy Input : c_arrpt - an array pointer returned from C shape - shape of that array pointer arr_t - the ctypes datatype of c_arrptr Avi ' s code
def _arrptr_to_np(c_arrptr, shape, arr_t, dtype):
    arr_t_size = C.POINTER(C.c_char * dtype().itemsize)           
    c_arr = C.cast(c_arrptr.astype(int), arr_t_size)              
    np_arr = np.ctypeslib.as_array(c_arr, shape)                  
    np_arr.dtype = dtype                                          
    np_arr = np.require(np_arr, dtype=dtype, requirements=['O'])  
    return np_arr
def _arrptr_to_np ( c_arrptr , shape , arr_t , dtype ) : arr_t_size = C . POINTER ( C . c_char * dtype ( ) . itemsize ) c_arr = C . cast ( c_arrptr . astype ( int ) , arr_t_size ) np_arr = np . ctypeslib . as_array ( c_arr , shape ) np_arr . dtype = dtype np_arr = np . require ( np_arr , dtype = dtype , requirements = [ 'O' ] ) return np_arr
Casts an array pointer from C to numpy
Input:
c_arrpt - an array pointer returned from C
shape   - shape of that array pointer
arr_t   - the ctypes datatype of c_arrptr
Avi's code
Casts an array pointer from C to numpy Input : c_arrpt - an array pointer returned from C shape - shape of that array pointer arr_t - the ctypes datatype of c_arrptr Avi ' s code
"""
    Casts an array pointer from C to numpy
    Input:
        c_arrpt - an array pointer returned from C
        shape   - shape of that array pointer
        arr_t   - the ctypes datatype of c_arrptr
    Avi's code
    """ # size of each item # cast to ctypes # cast to numpy # fix numpy dtype # prevent memory leaks
c_arrptr
shape
arr_t
dtype