Source code for schrodinger.structutils.pbc_tools
"""
Glean PBC from a Structure
"""
from schrodinger.infra import structure as infrastructure
[docs]def get_pbc(st1, st2, honor_pbc=None):
"""
If the structures are the same, and have a PBC, then return it. Otherwise,
return None.
:type st1: schrodinger.structure.Structure object
:type st2: schrodinger.structure.Structure object
:type honor_pbc: bool
:param honor_pbc: Should a PBC be discovered from the Structure objects?
:rtype: NoneType or schrodinger.infra.structure.PBC
"""
if honor_pbc and (st1 == st2 or st2 is None):
return infrastructure.PBC.get_pbc(st1)
return None