def _test_analysis(self): """ analysi """ dirc = os.path.join(self.PATH, "Fe-Ni_02") four_sub = [0, 1, 3, 27, 28] energies = os.path.join(dirc, "energies.txt") inc, exc = parse_atat.get_ids_from_energies(energies, four_sub) print(exc) dirc = os.path.join(self.PATH, "Fe-Ni_02") analysis = parse_atat.Analysis.from_dirc(dirc) path = os.path.join(dirc, "reproduce_energy.txt") analysis.set_cvm_enthalpy(path) pre = r""" \documentclass[12pt,a4paper]{report} \usepackage[dvipdfmx]{graphicx} \usepackage{longtable} %\usepackage{amsmath} \begin{document} { \begin{center} \small \begin{longtable}{cccc|c} \caption{Arrangement of elements and formation enthalpy.}\\ Formula & Space Grope & lattice & sites & $\Delta H$ \\ & & parameters & & ($\Delta H_{CVM}$)\\ \hline\hline \endhead """[ 1: ] end = r""" \hline \end{longtable} \end{center} \end{document} """[ 1: ] lines = pre lines += analysis.to_tex_form(form_key=["Fe", "Ni"].index, id_order=inc) lines += end with open(os.path.join(dirc, "inc.tex"), "w") as wfile: wfile.write(lines) lines = pre lines = analysis.to_tex_form(form_key=["Fe", "Ni"].index, id_order=exc) lines += end with open(os.path.join(dirc, "exc.tex"), "w") as wfile: wfile.write(lines)
def test_get_volume(self): """ 体積と磁気モーメントの情報も読み取りたい """ dirc = os.path.join(self.PATH, 'Fe-Ni_02') four_sub = [0, 1, 3, 27, 28] energies = os.path.join(dirc, 'energies.txt') inc, exc = parse_atat.get_ids_from_energies(energies, four_sub) print(exc) dirc = os.path.join(self.PATH, 'Fe-Ni_02') analysis = parse_atat.Analysis.from_dirc(dirc)
def _test_get_volume(self): """ 体積と磁気モーメントの情報も読み取りたい """ dirc = os.path.join(self.PATH, "Fe-Ni_02") four_sub = [0, 1, 3, 27, 28] energies = os.path.join(dirc, "energies.txt") inc, exc = parse_atat.get_ids_from_energies(energies, four_sub) # 160427 out = [ 0, 1, 3, 27, 28, 2, 4, 5, 7, 8, 9, 11, 13, 14, 16, 17, 18, 19, 20, 22, 23, 25, 26, 34, 36, 39, 42, 43, 44, 46, 48, 52, 67, 74, 75, 76, 78, 79, 80, 83, 84, 87, 88, 89, 96, 97, 99, 101, 102, 103, 104, 114, 137, 142, 144, 180, 183, 184, 187, 188, 192, 196, 199, 211, 212, 229, 235, 274, 284, 293, 303, 306, 315, 319, 324, 326, 330, 331, 335, 336, 346, 349, 354, 435, 438, 440, 454, 455, 456, 457, 459, 461, 468, 469, 472, 476, 480, 485, 490, 495, 501, 502, 518, 542, 545, 546, 690, 851, 868, 910, 912, 1134, ] assert inc == out out = [ 21, 24, 50, 51, 129, 153, 195, 209, 216, 219, 256, 314, 470, 475, 486, 489, 499, 549, 568, 608, 616, 619, 970, 977, ] assert exc == out dirc = os.path.join(self.PATH, "Fe-Ni_02") analysis = parse_atat.Analysis.from_dirc(dirc)