From 97dc6a2abafa06481d1e76d06a882540a5ff118f Mon Sep 17 00:00:00 2001 From: Eugene Kwan Date: Fri, 11 Nov 2022 22:58:42 -0500 Subject: [PATCH] fixed bug where multiple titles were improperly checked --- cctk/gaussian_file.py | 2 +- docs/recipe_07.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cctk/gaussian_file.py b/cctk/gaussian_file.py index 68fb938..5940a30 100644 --- a/cctk/gaussian_file.py +++ b/cctk/gaussian_file.py @@ -657,7 +657,7 @@ def write_ensemble_to_file(cls, filename, ensemble, route_card, link0={"mem": "3 assert len(title) == n_geometries, f"expected {n_geometries} route cards but got {len(title)}" for card in title: assert isinstance(card, str), "expected title to be a str" - assert len(title.strip()) > 0, "zero-length titles are not allowed" + assert len(card.strip()) > 0, "zero-length titles are not allowed" else: raise ValueError(f"unexpected type for title: {str(type(title))}") diff --git a/docs/recipe_07.rst b/docs/recipe_07.rst index 1543151..6457742 100644 --- a/docs/recipe_07.rst +++ b/docs/recipe_07.rst @@ -33,7 +33,7 @@ XYZ Files molecule = file.get_molecule() # if the file contains multiple molecules - for title, molecule in zip(ensemble.molecule_list(), file.titles): + for molecule, title in zip(ensemble.molecule_list(), file.titles): print(title) print(molecule) break