fix(search): SMILES auto-detection and citations search button#803
Open
vcnainala wants to merge 2 commits into
Open
fix(search): SMILES auto-detection and citations search button#803vcnainala wants to merge 2 commits into
vcnainala wants to merge 2 commits into
Conversation
Align the citations tab search button with Enter key handling and the backend tag handler by using tagType=citations and activeTab=citations.
Ring-closure SMILES such as C1CCCCC1 were misclassified as molecular formulas because the element-token regex matched before the SMILES check. Reject consecutive same-element tokens so these queries use RDKit search.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #803 +/- ##
================================================
+ Coverage 6.14% 6.39% +0.24%
- Complexity 1736 1741 +5
================================================
Files 227 227
Lines 8945 8973 +28
================================================
+ Hits 550 574 +24
- Misses 8395 8399 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tagType=citationwhile Enter, example links, andSearchMoleculeexpecttagType=citations.C1CCCCC1): queries were misclassified as molecular formulas and returned no results becausemolecular_formula = 'C1CCCCC1'never matches real data.looksLikeMolecularFormula()to reject SMILES-like chains where the same element appears in consecutive tokens, while still accepting condensed formulas such asC6H12andC6H12O6.Test plan
./vendor/bin/phpunit tests/Unit/SearchMoleculeQueryTypeTest.php./vendor/bin/pint --teston changed PHP files/search?q=C1CCCCC1and confirm cyclohexane (and substructure matches) are returned/search?q=C6H12still performs molecular formula searchResolves
Closes #754