-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provenance endpoint and test bug fixes (#346)
* Initial commit of prevenance endpoint * Provenance client suffix fix * Disable validation on provenance endpoint * xas, and oxi test fixes * Remove phonon_img endpoint from tests * Fix provenance client stub * Get references method added to MPRester * Mark appropriate provenance test xfail
- Loading branch information
Jason Munro
authored
Jul 28, 2021
1 parent
1047518
commit 6b5f2b1
Showing
10 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from mp_api.core.client import BaseRester | ||
from emmet.core.provenance import ProvenanceDoc | ||
|
||
|
||
class ProvenanceRester(BaseRester): | ||
|
||
suffix = "provenance" | ||
document_model = ProvenanceDoc # type: ignore | ||
primary_key = "material_id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from typing import List, Optional | ||
from emmet.core.provenance import ProvenanceDoc | ||
|
||
|
||
class ProvenanceRester: | ||
|
||
def get_document_by_id( | ||
self, | ||
document_id: str, | ||
fields: Optional[List[str]] = None, | ||
monty_decode: bool = True, | ||
) -> ProvenanceDoc: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from maggma.api.resource import ReadOnlyResource | ||
from maggma.api.query_operator import PaginationQuery | ||
|
||
from emmet.core.provenance import ProvenanceDoc | ||
|
||
|
||
def provenance_resource(provenance_store): | ||
resource = ReadOnlyResource( | ||
provenance_store, | ||
ProvenanceDoc, | ||
query_operators=[PaginationQuery()], | ||
tags=["Provenance"], | ||
disable_validation=True, | ||
enable_default_search=False, | ||
) | ||
|
||
return resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters