def test_library_io(get_library): get_library.pickle_library('file_01.pickle') loaded_library = load_VectorLibrary('file_01.pickle', safety=True) os.remove('file_01.pickle') # we can't check that the entire libraries are the same as the memory # location of the 'Sim' changes np.testing.assert_allclose(get_library['Phase']['measurements'], loaded_library['Phase']['measurements']) np.testing.assert_allclose(get_library['Phase']['indices'], loaded_library['Phase']['indices'])
def test_library_io(get_library): get_library.pickle_library("file_01.pickle") loaded_library = load_VectorLibrary("file_01.pickle", safety=True) os.remove("file_01.pickle") # we can't check that the entire libraries are the same as the memory # location of the 'Sim' changes np.testing.assert_allclose(get_library["Phase"]["measurements"], loaded_library["Phase"]["measurements"]) np.testing.assert_allclose(get_library["Phase"]["indices"], loaded_library["Phase"]["indices"])
def test_unsafe_loading(get_library): get_library.pickle_library('file_01.pickle') loaded_library = load_VectorLibrary('file_01.pickle')