pwtools.crys.Trajectory.check_set_attr

Trajectory.check_set_attr(attr)

Run try_set_attr() and return the result of is_set_attr(), i.e. True or False. Most important shortcut method.

Examples

def get_foo(self):
    if self.check_set_attr('bar'):
        return self.bar * 2
    else:
        return None

which is the same as

def get_foo(self):
    self.try_set_attr('bar):
    if self.is_set_attr('bar'):
        return self.bar * 2
    else:
        return None