diff --git a/CHANGELOG.md b/CHANGELOG.md index d3243d9..13c946a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ Date: XX/YY/ZZZZ Contributors: @RMeli +### Improved + +* Messages for `NotImplementedError` exceptions [PR #90 | @RMeli] + ### Removed * `versioneer` [PR #91 | @RMeli] diff --git a/spyrmsd/optional/rdkit.py b/spyrmsd/optional/rdkit.py index 4d0ee9b..25bbf71 100644 --- a/spyrmsd/optional/rdkit.py +++ b/spyrmsd/optional/rdkit.py @@ -64,7 +64,9 @@ def load(fname: str): else: rdmol = _load_block_gzipped(Chem.MolFromPDBBlock, fname) else: - raise NotImplementedError + raise NotImplementedError( + f"Format '{fmt}' is currently not supported with RDKit." + ) return rdmol @@ -87,7 +89,11 @@ def loadall(fname: str): fmt = utils.molformat(fname) if fmt == "mol2": - raise NotImplementedError # See RDKit Issue #415 + error = ( + "Multiple molecules in MOL2 files are not supported. " + "See RDKit#415 (https://github.com/rdkit/rdkit/pull/415)." + ) + raise NotImplementedError(error) # See RDKit Issue #415 elif fmt == "sdf": if not gzipped: rdmols = Chem.SDMolSupplier(fname, removeHs=False) @@ -100,9 +106,11 @@ def loadall(fname: str): mols = [rdmol for rdmol in rdmols] elif fmt == "pdb": # TODO: Implement - raise NotImplementedError + raise NotImplementedError("Multiple molecules in PDB files are not supported.") else: - raise NotImplementedError + raise NotImplementedError( + f"Format '{fmt}' is currently not supported with RDKit." + ) return mols