How to use the hickle.loaders.load_numpy.check_is_numpy_array function in hickle

To help you get started, we’ve selected a few hickle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github telegraphic / hickle / tests / test_hickle_helpers.py View on Github external
def test_check_is_numpy_array():
    assert check_is_numpy_array(np.array([1,2,3])) is True
    assert check_is_numpy_array(np.ma.array([1,2,3])) is True
    assert check_is_numpy_array([1,2]) is False
github telegraphic / hickle / tests / test_hickle_helpers.py View on Github external
def test_check_is_numpy_array():
    assert check_is_numpy_array(np.array([1,2,3])) is True
    assert check_is_numpy_array(np.ma.array([1,2,3])) is True
    assert check_is_numpy_array([1,2]) is False
github telegraphic / hickle / tests / test_hickle_helpers.py View on Github external
def test_check_is_numpy_array():
    assert check_is_numpy_array(np.array([1,2,3])) is True
    assert check_is_numpy_array(np.ma.array([1,2,3])) is True
    assert check_is_numpy_array([1,2]) is False
github telegraphic / hickle / hickle / lookup.py View on Github external
types_dict.update(py_types_dict)
hkl_types_dict.update(py_hkl_types_dict)

# Add loaders for numpy types
from .loaders.load_numpy import  types_dict as np_types_dict
from .loaders.load_numpy import  hkl_types_dict as np_hkl_types_dict
from .loaders.load_numpy import check_is_numpy_array
types_dict.update(np_types_dict)
hkl_types_dict.update(np_hkl_types_dict)

#######################
## ND-ARRAY checking ##
#######################

ndarray_like_check_fns = [
    check_is_numpy_array
]

def check_is_ndarray_like(py_obj):
    is_ndarray_like = False
    for ii, check_fn in enumerate(ndarray_like_check_fns):
        is_ndarray_like = check_fn(py_obj)
        if is_ndarray_like:
            break
    return is_ndarray_like




#######################
## loading optional  ##
#######################