@@ -29,7 +29,26 @@ def search(
2929 """Query for optical absorption spectra data.
3030
3131 Arguments:
32- material_ids (str, List[str]): Search for optical absorption data associated with the specified Material IDs
32+ material_ids (str, List[str]):
33+ Search for optical absorption data associated with the
34+ specified Material ID(s)
35+ num_sites (int, tuple[int, int]):
36+ Search with a single number or a range of number of sites
37+ in the structure.
38+ num_elements (int, tuple[int, int]):
39+ Search with a single number or a range of number of distinct
40+ elements in the structure.
41+ volume (float, tuple[float, float]):
42+ Search with a single number or a range of structural
43+ (lattice) volumes in ų.
44+ If a single number, an uncertainty of ±0.01 is automatically used.
45+ density (float, tuple[float, float]):
46+ Search with a single number or a range of structural
47+ (lattice) densities, in g/cm³.
48+ If a single number, an uncertainty of ±0.01 is automatically used.
49+ band_gap (float, tuple[float, float]):
50+ Search with a single number or a range of band gaps in eV.
51+ If a single number, an uncertainty of ±0.01 is automatically used.
3352 num_chunks (int): Maximum number of chunks of data to yield. None will yield all possible.
3453 chunk_size (int): Number of data entries per chunk.
3554 all_fields (bool): Whether to return all fields in the document. Defaults to True.
@@ -46,11 +65,13 @@ def search(
4665 "band_gap" : "bandgap" ,
4766 }
4867 user_query = locals ()
49- for k in ("num_sites" ,"num_elements" ,"volume" ,"density" ,"band_gap" ):
68+ for k in ("num_sites" , "num_elements" , "volume" , "density" , "band_gap" ):
5069 if (value := user_query .get (k )) is not None :
51- if k in ("num_sites" ,"num_elements" ) and isinstance (value , int ):
70+ if k in ("num_sites" , "num_elements" ) and isinstance (value , int ):
5271 value = (value , value )
53- elif k in ("volume" ,"density" ,"band_gap" ) and isinstance (value ,int | float ):
72+ elif k in ("volume" , "density" , "band_gap" ) and isinstance (
73+ value , int | float
74+ ):
5475 value = (value - 1e-2 , value + 1e-2 )
5576
5677 query_params .update (
0 commit comments