コード例 #1
0
def unravel_index(indices, dims):
    '''Converts a flat index (or array of them) into a tuple of coordinate arrays
    '''
    if isinstance(indices, (tuple, list)):
        indices = ndarray(buffer=indices)._jdataset()
    if not isinstance(indices, _ds):
        return tuple(_abstractds.getNDPositionFromShape(indices, dims))
    return tuple(_dsutils.calcPositionsFromIndexes(indices, dims))
コード例 #2
0
ファイル: jycore.py プロジェクト: flucke/scisoft-core
def unravel_index(indices, dims):
    '''Converts a flat index (or array of them) into a tuple of coordinate arrays
    '''
    if isinstance(indices, (tuple, list)):
        indices = ndarray(buffer=indices)._jdataset()
    if not isinstance(indices, _ds):
        return tuple(_abstractds.getNDPositionFromShape(indices, dims))
    return tuple(_dsutils.calcPositionsFromIndexes(indices, dims))
コード例 #3
0
def _getdtypefromobj(jobj):
    jdtype = _abstractds.getDTypeFromObject(jobj)
    if jdtype in __jdtype2jytype:
        return __jdtype2jytype[jdtype]
    raise ValueError, "Java dataset type unknown"
コード例 #4
0
ファイル: jycore.py プロジェクト: flucke/scisoft-core
def _getdtypefromobj(jobj):
    jdtype = _abstractds.getDTypeFromObject(jobj)
    if jdtype in __jdtype2jytype:
        return __jdtype2jytype[jdtype]
    raise ValueError, "Java dataset type unknown"