Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
structure.cell[2, 2] = mini + maxi
structure.cell[2, 2] *= 1.1
if all(abs(structure.cell[:, 1] - [0, 500.0, 0.0]) < 1e-8):
mini = abs(min([a.pos[1] for a in structure]))
maxi = abs(max([a.pos[1] for a in structure]))
structure.cell[1, 1] = mini + maxi
structure.cell[1, 1] *= 1.1
if all(abs(structure.cell[:, 0] - [500.0, 0.0, 0.0]) < 1e-8):
mini = abs(min([a.pos[0] for a in structure]))
maxi = abs(max([a.pos[0] for a in structure]))
structure.cell[0, 0] = mini + maxi
structure.cell[0, 0] *= 1.1
Jmol(structure)