-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes the problem of weird synthesis search results when querying for…
… a range (#324) * Add new synthesis recipes schema. * [WIP] add models to synthesis recipes and implement query classes * [WIP] add query class for synthesis-type, experimental operations, and paragraph keywords (half-completed). * [WIP] add script to convert dataset from the public repo to MP database. * Change synthesis type and operations into enum type. * Add experimental conditions query class. * Only keep one API endpoint for all recipe calls. * Fix ellipsis function for removing heading characters. * Remove debugging print statement. * Return total number of hits. * Add adaptor that converts synpro collections. * Allow min/max value to be set as None. * handle cases when aggregate returns zero docs * Let mongodb return all highlights and handle char limits by ourselves * Use str for targets_formula/precursors_formula * Fix mypy and comment ensure_index calls * Add docstrings and comments to data adaptors. * Fix synthesis query dict that returns weird range query results * Add test for synthesis recipes adaptor * Add tests for synthesis recipes rester.
- Loading branch information
Showing
12 changed files
with
1,128 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
from typing import List, Optional | ||
from mp_api.routes.synthesis.models import SynthesisSearchResultModel | ||
|
||
from mp_api.routes.synthesis.models import ( | ||
SynthesisTypeEnum, OperationTypeEnum, SynthesisSearchResultModel | ||
) | ||
|
||
|
||
class SynthesisRester: | ||
|
||
def get_document_by_id( | ||
self, | ||
document_id: str, | ||
fields: Optional[List[str]] = None, | ||
monty_decode: bool = True, | ||
def search_synthesis_text( | ||
self, | ||
keywords: Optional[List[str]] = None, | ||
synthesis_type: Optional[List[SynthesisTypeEnum]] = None, | ||
target_formula: Optional[str] = None, | ||
precursor_formula: Optional[str] = None, | ||
operations: Optional[List[OperationTypeEnum]] = None, | ||
condition_heating_temperature_min: Optional[float] = None, | ||
condition_heating_temperature_max: Optional[float] = None, | ||
condition_heating_time_min: Optional[float] = None, | ||
condition_heating_time_max: Optional[float] = None, | ||
condition_heating_atmosphere: Optional[List[str]] = None, | ||
condition_mixing_device: Optional[List[str]] = None, | ||
condition_mixing_media: Optional[List[str]] = None, | ||
) -> SynthesisSearchResultModel: ... |
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
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
Oops, something went wrong.