Esempio n. 1
0
def test_abinit_input():
    """
    Test (pychemia.code.abinit) [input]                         :
    """
    from pychemia.code.abinit import AbiFiles, AbinitInput

    filename = "tests/data/abinit_01/abinit.files"
    abf = AbiFiles(filename)
    inp = AbinitInput(abf.get_input_filename())
    print(inp)
    print(len(inp))
    assert len(inp) == 31
    assert inp.get_value('ecut') == 10
    assert len(inp.get_dtsets_keys()) == 12
    assert inp.get_value('ntime', 41) == 10
    assert inp.get_value('acell', 41)[0] == 14
def test_abinit_input():
    """
    Tests (pychemia.code.abinit) [input]                         :
    """
    from pychemia.code.abinit import AbiFiles, AbinitInput

    filename = "tests/data/abinit_01/abinit.files"
    abf = AbiFiles(filename)
    inp = AbinitInput(abf.get_input_filename())
    print(inp)
    print(len(inp))
    assert len(inp) == 31
    assert inp.get_value('ecut') == 10
    assert len(inp.get_dtsets_keys()) == 12
    assert inp.get_value('ntime', 41) == 10
    assert inp.get_value('acell', 41)[0] == 14
Esempio n. 3
0
if __name__ == '__main__':

    narg = len(sys.argv) - 1

    list_abifile = []
    list_idtset = []
    dtsetall = False
    for i in range(narg):
        filename = sys.argv[i + 1]
        if ':' in filename:
            idtset = filename.split(':')[1]
            if idtset == 'all':
                dtsetall = True
            else:
                list_idtset.append(idtset)
            filename = filename.split(':')[0]

        abifile = AbiFiles(filename)
        if dtsetall:
            av = AbinitInput(abifile.get_input_filename())
            keys = av.get_dtsets_keys()
            #            print(keys)
            for j in keys:
                list_abifile.append(abifile)
                list_idtset.append(str(j))

        else:
            list_abifile.append(abifile)

    plot_bonds(list_abifile, list_idtset)
if __name__ == '__main__':

    narg = len(sys.argv) - 1

    list_abifile = []
    list_idtset = []
    dtsetall = False
    for i in range(narg):
        filename = sys.argv[i + 1]
        if ':' in filename:
            idtset = filename.split(':')[1]
            if idtset == 'all':
                dtsetall = True
            else:
                list_idtset.append(idtset)
            filename = filename.split(':')[0]

        abifile = AbiFiles(filename)
        if dtsetall:
            av = AbinitInput(abifile.get_input_filename())
            keys = av.get_dtsets_keys()
#            print(keys)
            for j in keys:
                list_abifile.append(abifile)
                list_idtset.append(str(j))

        else:
            list_abifile.append(abifile)

    plot_bonds(list_abifile, list_idtset)