Esempio n. 1
0
def test_input_creation(
    db_test_app,  # pylint: disable=unused-argument
    get_potential_data,
    calc_type,
    potential_type,
    file_regression,
):
    """
    Test the generation of the input file for lammps
    """
    pot_data = get_potential_data(potential_type)
    potential_data = DataFactory('lammps.potential')(
        potential_type=pot_data.type,
        data=pot_data.data,
    )
    parameter_data = get_calc_parameters(
        '17 Aug 2017',
        calc_type,
        potential_data.default_units,
        potential_type,
    )

    calc = CalculationFactory(calc_type)
    content = calc.create_main_input_content(
        parameter_data,
        potential_data,
        kind_symbols=['A', 'B'],
        structure_filename='input.data',
        trajectory_filename='output.traj',
        system_filename='sys_info.txt',
        restart_filename='calc.restart',
    )
    file_regression.check(content)
def test_input_creation(db_test_app, get_potential_data, calc_type,
                        potential_type, file_regression):
    pot_data = get_potential_data(potential_type)
    potential_data = DataFactory("lammps.potential")(type=pot_data.type,
                                                     data=pot_data.data)
    parameter_data = get_calc_parameters("17 Aug 2017", calc_type,
                                         potential_data.default_units,
                                         potential_type)

    calc = CalculationFactory(calc_type)
    content = calc.create_main_input_content(
        parameter_data,
        potential_data,
        kind_symbols=["A", "B"],
        structure_filename="input.data",
        trajectory_filename="output.traj",
        system_filename="sys_info.txt",
        restart_filename="calc.restart",
    )
    file_regression.check(content)