Skip to content

Commit

Permalink
Similarity: re-key to material_id
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhorton committed Jul 24, 2021
1 parent ab5f536 commit 8b252c5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
similarity_store = MongoURIStore(
uri=f"mongodb+srv://{db_uri}",
database="mp_core",
key="task_id",
key="material_id",
collection_name="similarity",
)

Expand Down
2 changes: 1 addition & 1 deletion src/mp_api/routes/similarity/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ class SimilarityRester(BaseRester):

suffix = "similarity"
document_model = SimilarityDoc # type: ignore
primary_key = "task_id"
primary_key = "material_id"
2 changes: 1 addition & 1 deletion src/mp_api/routes/similarity/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SimilarityDoc(BaseModel):
description="List containing similar structure data for a given material.",
)

task_id: str = Field(
material_id: str = Field(
None,
description="The Materials Project ID for the material. This comes in the form: mp-******",
)
2 changes: 1 addition & 1 deletion src/mp_api/routes/similarity/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def similarity_resource(similarity_store):
SimilarityDoc,
query_operators=[
PaginationQuery(),
SparseFieldsQuery(SimilarityDoc, default_fields=["task_id"]),
SparseFieldsQuery(SimilarityDoc, default_fields=["material_id"]),
],
tags=["Similarity"],
enable_default_search=False,
Expand Down

0 comments on commit 8b252c5

Please sign in to comment.