def hos_from_ecis(vac_corr): """ Calculate heat of solution from eci """ ecis = Ecis.parse_ecitxt('eci.txt') try: null = ecis[0] except KeyError: null = 0 try: points = ecis[1] except KeyError: points = 0 corr = Fraction(vac_corr) if corr == 0: print(points) else: print(points - null / corr)
def print_ecis(idx_list, to_quiver): """ print ecis """ ecis = Ecis.parse_ecitxt('eci.txt') lines = '' if idx_list: keys = [int(x) for x in idx_list.split()] else: keys = sorted(ecis.keys()) for i in keys: try: lines += '{0}\t{1}\n'.format(i, ecis[i]) except KeyError: lines += '{0}\t{1}\n'.format(i, 0) if to_quiver: values = [x.split()[1] for x in lines.split('\n')[:-1]] lines = '|'.join(values) print(lines)