Improves search to handle smaller search terms. - #4735
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4735 +/- ##
========================================
Coverage 98.70% 98.70%
========================================
Files 303 303
Lines 23335 23353 +18
========================================
+ Hits 23032 23050 +18
Misses 303 303 ☔ View full report in Codecov by Sentry. |
|
Could I get a review on this one? |
|
@medha-14 Sorry, there is a bit of a backlog due to the upcoming release and everyone coming back from vacation. Don't worry, we will review this shortly |
|
Thank you for the update! I just thought you missed this one. |
agriyakhetarpal
left a comment
There was a problem hiding this comment.
Thanks! I think min_similarity could be slightly higher here because the threshold here is too low and can lead to false positives in the search. But, at the same time, being able to resolve potential typos in the search query would require a lower threshold. This makes me feel that we could expose it with a sensible default, but I don't yet know what a sensible default would be. It should be higher than the current 40%, though. In-line comment about this below:
Sorry for the delayed response. I think it's important to clarify that |
agriyakhetarpal
left a comment
There was a problem hiding this comment.
Thanks, @medha-14! Let's go ahead with this for now, I feel your explanation adds the necessary context. I'm happy to approve this once we resolve https://github.com/pybamm-team/PyBaMM/pull/4735/files#r1905523299, as min_similarity is defined in two different locations, and if we have to do that, I think making it an argument that's passed to _find_matches() makes sense, along with documenting it.
I’ve made |
|
Actually, could you please add a test where |
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
|
I have added appropriate tests that cover cases where we give different values to |
|
Requesting @agriyakhetarpal's review on this. |
|
This is good to merge from my side. I'm mostly waiting on @Saransh-cpp's review as he self-requested one. |
Saransh-cpp
left a comment
There was a problem hiding this comment.
Woops, sorry for holding this back
|
Thanks a lot everyone! |
Description
Fixes #4734
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ pre-commit run(or$ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python -m pytest(or$ nox -s tests)$ python -m pytest --doctest-plus src(or$ nox -s doctests)You can run integration tests, unit tests, and doctests together at once, using
$ nox -s quick.Further checks: