コード例 #1
0
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'])
コード例 #2
0
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"])
コード例 #3
0
def test_unsafe_loading(get_library):
    get_library.pickle_library('file_01.pickle')
    loaded_library = load_VectorLibrary('file_01.pickle')