Пример #1
0
def ref_retrieved_nscf():
    """Fixture: retrieved directory from an NSCF vasp run"""
    from aiida.orm import DataFactory
    from aiida_vasp.backendtests.common import subpath
    retrieved = DataFactory('folder')()
    for fname in os.listdir(subpath('data', 'retrieved_nscf', 'path')):
        retrieved.add_path(subpath('data', 'retrieved_nscf', 'path', fname),
                           '')
    return retrieved
Пример #2
0
def vasp_wavecar(aiida_env):
    """WAVECAR node and reference fixture"""
    from aiida.orm import DataFactory
    from aiida_vasp.backendtests.common import subpath
    wavecar_path = subpath('data', 'WAVECAR')
    wavecar = DataFactory('vasp.wavefun')(file=wavecar_path)
    with open(wavecar_path, 'r') as ref_wavecar_fo:
        ref_wavecar = ref_wavecar_fo.read()
    return wavecar, ref_wavecar
Пример #3
0
def vasp_chgcar(aiida_env):
    """CHGCAR node and reference fixture"""
    from aiida.orm import DataFactory
    from aiida_vasp.backendtests.common import subpath
    chgcar_path = subpath('data', 'CHGCAR')
    chgcar = DataFactory('vasp.chargedensity')(file=chgcar_path)
    with open(chgcar_path, 'r') as ref_chgcar_fo:
        ref_chgcar = ref_chgcar_fo.read()
    return chgcar, ref_chgcar
Пример #4
0
def vasp_structure(request, aiida_env):
    """Fixture: StructureData or CifData"""
    from aiida_vasp.backendtests.common import subpath
    from aiida.orm import DataFactory
    if request.param == 'cif':
        cif_path = subpath('data', 'EntryWithCollCode43360.cif')
        structure = DataFactory('cif').get_or_create(cif_path)[0]
    elif request.param == 'str':
        larray = numpy.array([[0, .5, .5], [.5, 0, .5], [.5, .5, 0]])
        alat = 6.058
        structure = DataFactory('structure')(cell=larray * alat)
        structure.append_atom(position=[0, 0, 0], symbols='In')
        structure.append_atom(position=[.25, .25, .25], symbols='As')
        structure.append_atom(position=[.25, .33, .34], symbols='As')
        structure.append_atom(position=[.5, .5, .5], symbols='In', name='In_d')
        structure.append_atom(position=[.7896, .6234, .5],
                              symbols='In',
                              name='In_d')
        structure.append_atom(position=[.75, .75, .75], symbols='As')
    elif request.param == 'str-Al':
        larray = numpy.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
        alat = 4.04
        structure = DataFactory('structure')(cell=larray * alat)
        structure.append_atom(position=numpy.array([0, 0, 0]) * alat,
                              symbols='Al')
        structure.append_atom(position=numpy.array([0, .5, .5]) * alat,
                              symbols='Al')
        structure.append_atom(position=numpy.array([.5, 0, .5]) * alat,
                              symbols='Al')
        structure.append_atom(position=numpy.array([.5, .5, 0]) * alat,
                              symbols='Al')
    elif request.param == 'str-InAs':
        structure_cls = DataFactory('structure')
        structure = structure_cls(
            cell=numpy.array([[0, .5, .5], [.5, 0, .5], [.5, .5, 0]]) * 6.058)
        structure.append_atom(position=(0, 0, 0),
                              symbols='In',
                              name='Hamburger')
        structure.append_atom(position=(0.25, 0.25, 0.25),
                              symbols='As',
                              name='Pizza')
    return structure
Пример #5
0
def _ref_kp_mesh():
    from aiida_vasp.backendtests.common import subpath
    with open(subpath('data', 'KPOINTS.mesh'), 'r') as reference_kpoints_fo:
        ref_kp_list = reference_kpoints_fo.read()
    return ref_kp_list
Пример #6
0
def ref_incar():
    from aiida_vasp.backendtests.common import subpath
    with open(subpath('data', 'INCAR'), 'r') as reference_incar_fo:
        yield reference_incar_fo.read().strip()