From 911e9769394b1c48be831083843971fbca43ddd2 Mon Sep 17 00:00:00 2001 From: Corin Wagen Date: Mon, 1 Jan 2024 15:29:55 -0500 Subject: [PATCH] move fast and break things... --- cctk/molecule.py | 2 +- setup.py | 4 ++-- test/test_molecule.py | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cctk/molecule.py b/cctk/molecule.py index 968d1bc..0db733c 100644 --- a/cctk/molecule.py +++ b/cctk/molecule.py @@ -1580,7 +1580,7 @@ def new_from_smiles(cls, smiles, max_num_atoms=None): raise ValueError(f"Molecule could not be generated from SMILES ``{smiles}`` -- invalid chemistry!\n{e}") rdkm = Chem.AddHs(rdkm) - if (max_num_atoms is not None) and (rdkm.GetNumAtoms(rdkm) > max_num_atoms): + if (max_num_atoms is not None) and (rdkm.GetNumAtoms() > max_num_atoms): raise ValueError(f"Number of atoms exceeds user-defined threshold ``{max_num_atoms}``") # https://github.com/rdkit/rdkit/issues/1433 diff --git a/setup.py b/setup.py index a2fa69e..4ddb669 100644 --- a/setup.py +++ b/setup.py @@ -11,13 +11,13 @@ packages=["cctk", "cctk.data", "cctk.groups"], # include_package_data=True, package_data={"cctk.data": ["*"], "cctk.groups": ["*"],}, - version="v0.2.20", + version="v0.2.21", license="Apache 2.0", description="computational chemistry toolkit", author="Corin Wagen and Eugene Kwan", author_email="corin.wagen@gmail.com", url="https://github.com/ekwan/cctk", - download_url="https://github.com/ekwan/cctk/archive/v0.2.20.tar.gz", + download_url="https://github.com/ekwan/cctk/archive/v0.2.21.tar.gz", install_requires=["numpy", "networkx", "importlib_resources", "scipy", "pyahocorasick", "basis_set_exchange", "pyyaml"], long_description=long_description, long_description_content_type='text/markdown', diff --git a/test/test_molecule.py b/test/test_molecule.py index e5098ad..2fcc104 100644 --- a/test/test_molecule.py +++ b/test/test_molecule.py @@ -205,6 +205,9 @@ def test_rdkit(self): mol = cctk.Molecule.new_from_name("acetic acid") self.assertEqual(len(mol.atomic_numbers), 8) + with self.assertRaises(ValueError): + mol = cctk.Molecule.new_from_smiles("CCCCCCCCCCCCCCCCCCCC", max_num_atoms=10) + def test_fragment(self): m = cctk.GaussianFile.read_file("test/static/periodic.gjf").get_molecule() m = m.assign_connectivity(periodic_boundary_conditions=np.array([20, 20, 20]))