Coverage for /builds/kinetik161/ase/ase/gui/pipe.py: 17.39%
23 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-12-10 11:04 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-12-10 11:04 +0000
1import pickle
2import sys
5def main():
6 import matplotlib.pyplot as plt
7 task, data = pickle.load(sys.stdin.buffer)
8 if task == 'eos':
9 from ase.eos import plot
10 plot(*data)
11 elif task == 'neb':
12 forcefit = data
13 forcefit.plot()
14 elif task == 'reciprocal':
15 # data is a bandpath object
16 data.plot()
17 elif task == 'graph':
18 from ase.gui.graphs import make_plot
19 make_plot(show=False, *data)
20 else:
21 print(f'Invalid task {task}')
22 sys.exit(17)
24 # Magic string to tell GUI that things went okay:
25 print('GUI:OK')
26 sys.stdout.close()
28 plt.show()
31if __name__ == '__main__':
32 main()