[ase-users] How to check if a POSCAR file has constraints?

Duy Le ttduyle at gmail.com
Wed Jan 31 16:45:48 CET 2018


There maybe better way but you can simply use
len(atoms.constraints)

0: no constraint

On Wed, Jan 31, 2018 at 9:55 AM, fabian via ase-users <
ase-users at listserv.fysik.dtu.dk> wrote:

> Dear all,
>
> I want to check if a certain POSCAR file has constraints or not.
>
> I tried it like this:
>
> atoms=read(FILENAME)
>
> if atoms.constraints is None:
>
>     pass
>
> else:
>
>      do something
>
> but this does not work it seems. Even if no constraints are present i
> still come out of the else statement.
>
> On a side not...what library is ASE using to display the ase gui ? I have
> no menu entrys and the gui is broken
> under ubuntu artfull.
>
> All the best
>
> fabian
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20180131/61a06194/attachment.html>


More information about the ase-users mailing list