Пример #1
0
def test_converter_more_files(_sdds_file, _test_file):
    rep = 2
    converter_entrypoint(files=[_sdds_file],
                         outputdir=os.path.dirname(_test_file),
                         realizations=rep)
    origin = handler.read_tbt(_sdds_file)
    for i in range(rep):
        new = handler.read_tbt(f'{_test_file}_r{i}.sdds')
        _compare_tbt(origin, new, False)
Пример #2
0
def test_converter_one_file_with_noise(_sdds_file, _test_file):
    np.random.seed(2019)
    noiselevel = 0.0005
    converter_entrypoint(files=[_sdds_file],
                         outputdir=os.path.dirname(_test_file),
                         noise_levels=[noiselevel])
    origin = handler.read_tbt(_sdds_file)
    new = handler.read_tbt(f'{_test_file}_n{noiselevel}.sdds')
    _compare_tbt(origin, new, True, noiselevel * 10)
Пример #3
0
def test_converter_more_files_with_noise(_sdds_file, _test_file):
    np.random.seed(2019)
    rep = 2
    noiselevel = 0.0005
    converter_entrypoint(files=[_sdds_file],
                         outputdir=os.path.dirname(_test_file),
                         realizations=rep,
                         noise_levels=[noiselevel])
    origin = handler.read_tbt(_sdds_file)
    for i in range(rep):
        new = handler.read_tbt(f'{_test_file}_n{noiselevel}_r{i}.sdds')
        _compare_tbt(origin, new, True, noiselevel * 10)
Пример #4
0
def test_tbt_write_read_sdds_binary(_sdds_file, _test_file):
    origin = handler.read_tbt(_sdds_file)
    handler.write_tbt(_test_file, origin)
    new = handler.read_tbt(f'{_test_file}.sdds')
    _compare_tbt(origin, new, False)
Пример #5
0
def test_tbt_write_read_ascii(_sdds_file, _test_file):
    origin = handler.read_tbt(_sdds_file)
    handler.write_lhc_ascii(_test_file, origin)
    new = handler.read_tbt(_test_file)
    _compare_tbt(origin, new, True)
Пример #6
0
def test_converter_one_file(_sdds_file, _test_file):
    converter_entrypoint(files=[_sdds_file],
                         outputdir=os.path.dirname(_test_file))
    origin = handler.read_tbt(_sdds_file)
    new = handler.read_tbt(f'{_test_file}.sdds')
    _compare_tbt(origin, new, False)