Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import ase.parallel as parallel
2from ase.visualize.external import viewers
5def view(atoms, data=None, viewer='ase', repeat=None, block=False):
6 if parallel.world.size > 1:
7 return
9 vwr = viewers[viewer.lower()]
10 handle = vwr.view(atoms, data=data, repeat=repeat)
12 if block and hasattr(handle, 'wait'):
13 status = handle.wait()
14 if status != 0:
15 raise RuntimeError(f'Viewer "{vwr.name}" failed with status '
16 '{status}')
18 return handle