Skip to content

Commit

Permalink
Robocrys client update
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed May 11, 2021
1 parent ee0d297 commit c8a2f93
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/mp_api/routes/robocrys/client.py
Expand Up @@ -5,4 +5,25 @@
class RobocrysRester(BaseRester):

suffix = "robocrys"
document_model = RobocrysDoc
document_model = RobocrysDoc # type: ignore

def search_robocrys_text(self, keywords: list[str]):
"""
Search text generated from Robocrystallographer.
Arguments:
keywords (List[str]): List of search keywords
Returns:
robocrys_docs (List[RobocrysDoc]): List of robocrystallographer documents
"""

keyword_string = ",".join(keywords)

results = self._query_resource(
criteria={"keywords": keyword_string},
suburl="text_search",
use_document_model=True,
)

return results
1 change: 1 addition & 0 deletions src/mp_api/routes/robocrys/client.pyi
Expand Up @@ -3,6 +3,7 @@ from mp_api.routes.robocrys.models import RobocrysDoc


class RobocrysRester:

def query_by_task_id(
self, task_id, fields: Optional[List[str]] = None, monty_decode: bool = True
) -> RobocrysDoc:
Expand Down

0 comments on commit c8a2f93

Please sign in to comment.