def test_abinit_input(): """ Tests (pychemia.code.abinit) [input] : """ if pychemia.HAS_SCIPY and pychemia.HAS_SCIENTIFIC: from pychemia.code.abinit import AbiFiles, InputVariables filename = "pychemia/test/data/abinit_01/abinit.files" abf = AbiFiles(filename) inp = InputVariables(abf) 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] : """ if pychemia.HAS_SCIPY and pychemia.HAS_SCIENTIFIC: from pychemia.code.abinit import AbiFiles, InputVariables filename = "pychemia/test/data/abinit_01/abinit.files" abf = AbiFiles(filename) inp = InputVariables(abf) 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
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 = InputVariables(abifile.get_input_filename()) keys = av.get_dtsets_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)