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

TypeError: unhashable type: 'OptimizationRecord' when ds.status called on newly created dataset #619

Closed trevorgokey closed 1 year ago

trevorgokey commented 4 years ago

Describe the bug After creating a dataset, I call ds.status("default") and receive the following:

In [1]: import qcfractal.interface as ptl

In [3]: client = ptl.FractalClient("localhost:7777",verify=False)

In [4]: ds = client.get_collection("optimizationdataset", "OpenFF Sandbox CHO PhAlkEthOH v1.0")

In [5]: ds.status()
Out[5]: 
Empty DataFrame
Columns: []
Index: [C(C(O)O)O-1, C-1, C(C(O)O)(O)O-1, C(CCO)CCO-1, OC[C@@H](O)CC(O)O-1, ...]

[2666 rows x 0 columns]

In [6]: ds.status("default")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-f6c7cba9ae0c> in <module>
----> 1 ds.status("default")

~/.local/miniconda3/envs/oFF/lib/python3.7/site-packages/qcfractal/interface/collections/collection.py in status(self, specs, collapse, status, detail)
    594 
    595             # apply status by column then by row
--> 596             df = self.df[list_specs].apply(lambda col: col.apply(get_status))
    597 
    598             if status:

~/.local/miniconda3/envs/oFF/lib/python3.7/site-packages/pandas/core/frame.py in __getitem__(self, key)
   2906             if is_iterator(key):
   2907                 key = list(key)
-> 2908             indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
   2909 
   2910         # take() does not accept boolean indexers

~/.local/miniconda3/envs/oFF/lib/python3.7/site-packages/pandas/core/indexing.py in _get_listlike_indexer(self, key, axis, raise_missing)
   1247 
   1248         if ax.is_unique and not getattr(ax, "is_overlapping", False):
-> 1249             indexer = ax.get_indexer_for(keyarr)
   1250             keyarr = ax.reindex(keyarr)[0]
   1251         else:

~/.local/miniconda3/envs/oFF/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_indexer_for(self, target, **kwargs)
   4707         """
   4708         if self.is_unique:
-> 4709             return self.get_indexer(target, **kwargs)
   4710         indexer, _ = self.get_indexer_non_unique(target, **kwargs)
   4711         return indexer

~/.local/miniconda3/envs/oFF/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_indexer(self, target, method, limit, tolerance)
   3000                 )
   3001 
-> 3002             indexer = self._engine.get_indexer(target._get_engine_target())
   3003 
   3004         return ensure_platform_int(indexer)

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_indexer()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.lookup()

TypeError: unhashable type: 'OptimizationRecord'

In [7]: ds.status()
Out[7]: 
            default
INCOMPLETE     2666

The error seems to always occur upon the first call of ds.status, but succeeds thereafter. Reaccessing the dataset with a new client.get_collection call reproduces the error.

To Reproduce

  1. Create a new OptimizationDataset
  2. Submit entries and specifications
  3. Call ds.status on the specification

Additional context

(oFF) Sun 13:38 834: smi ✗master» conda list | grep qc
qcelemental               0.16.0                     py_0    conda-forge
qcengine                  0.16.0                     py_0    conda-forge
qcfractal                 0.13.1           py37hc8dfbb8_0    conda-forge
qcfractal-core            0.13.1           py37hc8dfbb8_0    conda-forge
qcportal                  0.13.1                     py_0    conda-forge
bennybp commented 4 years ago

I tried to reproduce this but couldn't. Do you have a self-contained script that can show this?

bennybp commented 1 year ago

No longer applicable with v0.50