Skip to content

Commit

Permalink
Merge branch 'develop' into ver
Browse files Browse the repository at this point in the history
  • Loading branch information
RMeli authored Oct 14, 2023
2 parents 44a260c + 4c02adf commit 51b4fd7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
Date: XX/YY/ZZZZ
Contributors: @RMeli

### Improved

* Messages for `NotImplementedError` exceptions [PR #90 | @RMeli]

### Removed

* `versioneer` [PR #91 | @RMeli]
Expand Down
16 changes: 12 additions & 4 deletions spyrmsd/optional/rdkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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

Expand Down

0 comments on commit 51b4fd7

Please sign in to comment.