How to use the hickle.H5FileWrapper 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_track_times():
    """ Verify that track_times = False produces identical files """
    hashes = []
    for obj, filename, mode, kwargs in DUMP_CACHE:
        if isinstance(filename, hickle.H5FileWrapper):
            filename = str(filename.file_name)
        kwargs['track_times'] = False
        caching_dump(obj, filename, mode, **kwargs)
        hashes.append(md5sum(filename))
        os.remove(filename)

    time.sleep(1)

    for hash1, (obj, filename, mode, kwargs) in zip(hashes, DUMP_CACHE):
        if isinstance(filename, hickle.H5FileWrapper):
            filename = str(filename.file_name)
        caching_dump(obj, filename, mode, **kwargs)
        hash2 = md5sum(filename)
        print(hash1, hash2)
        try:
            assert hash1 == hash2
            os.remove(filename)
        except AssertionError:
            os.remove(filename)
            raise
github telegraphic / hickle / tests / test_hickle.py View on Github external
def test_track_times():
    """ Verify that track_times = False produces identical files """
    hashes = []
    for obj, filename, mode, kwargs in DUMP_CACHE:
        if isinstance(filename, hickle.H5FileWrapper):
            filename = str(filename.file_name)
        kwargs['track_times'] = False
        caching_dump(obj, filename, mode, **kwargs)
        hashes.append(md5sum(filename))
        os.remove(filename)

    time.sleep(1)

    for hash1, (obj, filename, mode, kwargs) in zip(hashes, DUMP_CACHE):
        if isinstance(filename, hickle.H5FileWrapper):
            filename = str(filename.file_name)
        caching_dump(obj, filename, mode, **kwargs)
        hash2 = md5sum(filename)
        print(hash1, hash2)
        try:
            assert hash1 == hash2
github telegraphic / hickle / tests / test_hickle.py View on Github external
def test_track_times():
    """ Verify that track_times = False produces identical files """
    hashes = []
    for obj, filename, mode, kwargs in DUMP_CACHE:
        if isinstance(filename, hickle.H5FileWrapper):
            filename = str(filename.file_name)
        kwargs['track_times'] = False
        caching_dump(obj, filename, mode, **kwargs)
        hashes.append(md5sum(filename))

    time.sleep(1)

    for hash1, (obj, filename, mode, kwargs) in zip(hashes, DUMP_CACHE):
        if isinstance(filename, hickle.H5FileWrapper):
            filename = str(filename.file_name)
        caching_dump(obj, filename, mode, **kwargs)
        hash2 = md5sum(filename)
        print(hash1, hash2)
        assert hash1 == hash2
github telegraphic / hickle / tests / test_hickle.py View on Github external
def test_track_times():
    """ Verify that track_times = False produces identical files """
    hashes = []
    for obj, filename, mode, kwargs in DUMP_CACHE:
        if isinstance(filename, hickle.H5FileWrapper):
            filename = str(filename.file_name)
        kwargs['track_times'] = False
        caching_dump(obj, filename, mode, **kwargs)
        hashes.append(md5sum(filename))

    time.sleep(1)

    for hash1, (obj, filename, mode, kwargs) in zip(hashes, DUMP_CACHE):
        if isinstance(filename, hickle.H5FileWrapper):
            filename = str(filename.file_name)
        caching_dump(obj, filename, mode, **kwargs)
        hash2 = md5sum(filename)
        print(hash1, hash2)
        assert hash1 == hash2