Esempio n. 1
0
def test_immigrant_additional(fresh_aiida_env, potcar_family, phonondb_run,
                              localhost, mock_vasp, aiida_runner):
    """Provide process class and inputs for importing a AiiDA-external VASP run."""
    from aiida_vasp.calcs.vasp import VaspCalculation
    create_authinfo(localhost, store=True)
    potcar_spec = {'family': POTCAR_FAMILY_NAME, 'map': POTCAR_MAP}
    proc, builder = VaspCalculation.immigrant(code=mock_vasp,
                                              remote_path=phonondb_run,
                                              potcar_spec=potcar_spec,
                                              use_chgcar=True,
                                              use_wavecar=True)
    expected_inputs = {
        'parameters', 'structure', 'kpoints', 'potential', 'charge_density',
        'wavefunctions'
    }
    for input_link in expected_inputs:
        assert builder.get(
            input_link,
            None) is not None, 'input link "{}" was not set!'.format(
                input_link)

    result = aiida_runner.run(proc, **builder)

    expected_files = {'INCAR', 'POSCAR', 'KPOINTS', 'CHGCAR', 'WAVECAR'}
    banned_files = {'POTCAR'}

    calc = result['retrieved'].get_inputs()[0]

    assert 'raw_input' in calc.folder.get_content_list()
    input_folder = calc.folder.get_subfolder('raw_input')

    input_files = set(input_folder.get_content_list())
    assert expected_files.issubset(input_files)
    assert banned_files.isdisjoint(input_files)
Esempio n. 2
0
def test_immigrant_additional(fresh_aiida_env, potcar_family, phonondb_run,
                              localhost, mock_vasp):
    """Provide process class and inputs for importing a AiiDA-external VASP run."""
    from aiida_vasp.calcs.vasp import VaspCalculation
    create_authinfo(localhost, store=True)
    proc, builder = VaspCalculation.immigrant(
        code=mock_vasp,
        remote_path=phonondb_run,
        potential_family=POTCAR_FAMILY_NAME,
        potential_mapping=POTCAR_MAP,
        use_chgcar=True,
        use_wavecar=True)
    expected_inputs = {
        'parameters', 'structure', 'kpoints', 'potential', 'charge_density',
        'wavefunctions'
    }
    for input_link in expected_inputs:
        assert builder.get(
            input_link,
            None) is not None, 'input link "{}" was not set!'.format(
                input_link)

    result, node = run.get_node(proc, **builder)
    assert node.exit_status == 0

    # We should not have any POTCAR here
    expected_files = ['CONTCAR', 'DOSCAR', 'EIGENVAL', 'OUTCAR', 'vasprun.xml']
    retrieved_files = result['retrieved'].list_object_names()
    assert set(expected_files) == set(retrieved_files)
Esempio n. 3
0
def immigrant_with_builder(fresh_aiida_env, potcar_family, phonondb_run,
                           localhost, mock_vasp):
    """Provide process class and inputs for importing a AiiDA-external VASP run."""
    from aiida_vasp.calcs.vasp import VaspCalculation
    create_authinfo(localhost, store=True)
    potcar_spec = {'family': POTCAR_FAMILY_NAME, 'map': POTCAR_MAP}
    proc, builder = VaspCalculation.immigrant(code=mock_vasp,
                                              remote_path=phonondb_run,
                                              potcar_spec=potcar_spec)
    expected_inputs = {'parameters', 'structure', 'kpoints', 'potential'}
    for input_link in expected_inputs:
        assert builder.get(input_link, None) is not None
    return proc, builder
Esempio n. 4
0
def immigrant_with_builder(fresh_aiida_env, potcar_family, phonondb_run,
                           localhost, mock_vasp):
    """Provide process class and inputs for importing a AiiDA-external VASP run."""
    from aiida_vasp.calcs.vasp import VaspCalculation

    create_authinfo(localhost, store=True)
    potential_family = POTCAR_FAMILY_NAME
    potential_mapping = POTCAR_MAP
    proc, builder = VaspCalculation.immigrant(
        code=mock_vasp,
        remote_path=phonondb_run,
        potential_family=potential_family,
        potential_mapping=potential_mapping)
    # Make sure clean_workdir is not done for the immigrant (we do not want to remove the imported data)
    expected_inputs = {'parameters', 'structure', 'kpoints', 'potential'}
    for input_link in expected_inputs:
        assert builder.get(input_link, None) is not None
    return proc, builder