From b37d20e04d41f334905b1ad0139992a94570cdc4 Mon Sep 17 00:00:00 2001 From: Greg Jones Date: Fri, 16 Feb 2024 12:58:14 -0500 Subject: [PATCH] Try something simpler for bohr coordinate input, akin to OpenMolcas --- pysisyphus/Geometry.py | 12 ++++++------ pysisyphus/helpers.py | 6 +----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pysisyphus/Geometry.py b/pysisyphus/Geometry.py index 9a0df0343e..79eff2daac 100644 --- a/pysisyphus/Geometry.py +++ b/pysisyphus/Geometry.py @@ -258,12 +258,12 @@ def __init__( ), f"'freeze_atoms' must all be >= 0 and < {len(self.atoms)}!" # Disallow any coord_kwargs with coord_type == 'cart' - # if (coord_type == "cart") and not (coord_kwargs is None or coord_kwargs == {}): - # print( - # "coord_type is set to 'cart' but coord_kwargs were given. " - # "This is probably not intended. Exiting!" - # ) - # sys.exit() + if (coord_type == "cart") and not (coord_kwargs is None or coord_kwargs == {}): + print( + "coord_type is set to 'cart' but coord_kwargs were given. " + "This is probably not intended. Exiting!" + ) + sys.exit() # Coordinate systems are handled below coord_class = self.coord_types[self.coord_type] diff --git a/pysisyphus/helpers.py b/pysisyphus/helpers.py index 2663018efa..35ec7f9967 100644 --- a/pysisyphus/helpers.py +++ b/pysisyphus/helpers.py @@ -51,11 +51,7 @@ def geom_from_xyz_file(xyz_fn, coord_type="cart", **coord_kwargs): kwargs.update(coord_kwargs) xyz_fn = str(xyz_fn) atoms, coords, comment = parse_xyz_file(xyz_fn, with_comment=True) - if 'bohr' in coord_kwargs: - bohr = coord_kwargs.pop('bohr') - if not bohr: - coords *= ANG2BOHR - else: + if 'bohr' not in comment.lower(): coords *= ANG2BOHR geom = Geometry( atoms,