aflow icon indicating copy to clipboard operation
aflow copied to clipboard

Error in querying data from aflowlib

Open Shibu778 opened this issue 1 year ago • 0 comments

After installing the aflow package and trying to use the standard query example given in the documentation, I am encountering following error. Is there a bug in the code?

In [2]: from aflow import *
   ...: 
   ...: result = search(batch_size=20
   ...:         ).select(K.agl_thermal_conductivity_300K
   ...:         ).filter(K.Egap > 6).orderby(K.agl_thermal_conductivity_300K, True)
   ...: 
   ...: # Now, you can just iterate over the results.
   ...: for entry in result:
   ...:     print(entry.Egap)
   ...: 
ERROR: http://aflowlib.duke.edu/search/API/?agl_thermal_conductivity_300K,Egap(6*),paging(-1,20)

DB Fail!null
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[2], line 8
      3 result = search(batch_size=20
      4         ).select(K.agl_thermal_conductivity_300K
      5         ).filter(K.Egap > 6).orderby(K.agl_thermal_conductivity_300K, True)
      7 # Now, you can just iterate over the results.
----> 8 for entry in result:
      9     print(entry.Egap)

File ~/anaconda3/envs/ml/lib/python3.9/site-packages/aflow/control.py:236, in Query.__next__(self)
    233 if self.reverse:
    234     n *= -1
--> 236 if n not in self.responses and self._iter < self.max_N:
    237     self._n = abs(n)
    238     self._request(self.n, self.k)

TypeError: '<' not supported between instances of 'int' and 'NoneType'

Shibu778 avatar Jan 20 '24 14:01 Shibu778