MolSSI / QCFractal

A distributed compute and database platform for quantum chemistry.
https://molssi.github.io/QCFractal/
BSD 3-Clause "New" or "Revised" License
148 stars 48 forks source link

Wrong error when adding keywords #587

Closed jthorton closed 4 years ago

jthorton commented 4 years ago

Describe the bug

When adding keywords to a collection with the same alias and program I think the wrong error is raised this should be a KeyError but an AttributeError is raised.

To Reproduce

client = FractalClient()
ds = client.get_collection('Dataset','OpenFF Discrepancy Benchmark 1')
# get the keywords
kw = ds.get_keywords('default', 'psi4')
# try and add them again to the collection
ds.add_keywords(alias='default', program='psi4', keyword=kw, default=False)

Expected behavior

Should raise the KeyError defined here https://github.com/MolSSI/QCFractal/blob/331f91c2361e6ef797061b597902271c78438e11/qcfractal/interface/collections/dataset.py#L1315 Additional context

bennybp commented 4 years ago

Should be a simple fix. I think keyword.program should be replaced by just program in that exception

bennybp commented 4 years ago

Fixed in PR #638