How to use the hickle.hickle 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.py View on Github external
def test_file_open_close():
    """ https://github.com/telegraphic/hickle/issues/20 """
    try:
        import h5py
        f = h5py.File('test.hdf', 'w')
        a = np.arange(5)
    
        dump(a, 'test.hkl')
        dump(a, 'test.hkl')
    
        dump(a, f, mode='w')
        try:
            dump(a, f, mode='w')
        except hickle.hickle.ClosedFileError:
            print("Tests: Closed file exception caught")
        
    finally:
        os.remove('test.hdf')
        os.remove('test.hkl')
github telegraphic / hickle / tests / test_hickle.py View on Github external
def test_file_open_close():
    """ https://github.com/telegraphic/hickle/issues/20 """
    import h5py
    f = h5py.File('test.hdf', 'w')
    a = np.arange(5)

    dump(a, 'test.hkl')
    dump(a, 'test.hkl')

    dump(a, f, mode='w')
    f.close()
    try:
        dump(a, f, mode='w')
    except hickle.hickle.ClosedFileError:
        print("Tests: Closed file exception caught")