Skip to content

Commit

Permalink
Fix materials hint scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed Nov 9, 2023
1 parent 2ab9412 commit d156c41
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions emmet-api/emmet/api/routes/materials/materials/hint_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ class MaterialsHintScheme(HintScheme):
"""

def generate_hints(self, query):
hints = {"count_hint": {"deprecated": 1, "builder_meta.license": 1}}

for param in query["criteria"]:
if "composition_reduced" in param:
return {"hint": {"composition_reduced.$**": 1}}
elif "nelements" in param:
return {"hint": {"nelements": 1}}
if "nelements" in param:
hints["count_hint"]= {"nelements": 1}

return {"hint": {}}
hints["agg_hint"] = hints["count_hint"]
return hints

0 comments on commit d156c41

Please sign in to comment.