RFC/DEPR: deprecate yt.funcs.levenshtein_distance in favor of difflib.get_close_matches#5193
Open
neutrinoceros wants to merge 1 commit intoyt-project:mainfrom
Open
RFC/DEPR: deprecate yt.funcs.levenshtein_distance in favor of difflib.get_close_matches#5193neutrinoceros wants to merge 1 commit intoyt-project:mainfrom
neutrinoceros wants to merge 1 commit intoyt-project:mainfrom
Conversation
9581b01 to
1571b9b
Compare
cphyc
requested changes
Jun 30, 2025
Member
cphyc
left a comment
There was a problem hiding this comment.
We are loosing some relevant suggestions (when there are more than 3 possible matches, try e.g. querying ad["index", "d"] (it should suggest x,y,z,dx,dy,dz at least. With the current PR, it only suggests the last three.
With the changes, I get more irrelevant (but also more relevant ones) suggestions:
ds = yt.load_sample("output_00080")
ad = ds.all_data()
ad["gas", "densty"]
Previously:
YTFieldNotFound: Could not find field ('gas', 'densty') in info_00080.
Did you mean:
('gas', 'density')
This PR:
YTFieldNotFound: Could not find field ('gas', 'densty') in info_00080.
Did you mean:
('gas', 'density')
('gas', 'dy')
('ramses', 'Density')
04710d5 to
d5a152f
Compare
cphyc
previously approved these changes
Jun 30, 2025
….get_close_matches
d5a152f to
d5789dc
Compare
Member
Author
|
rebased to resolve merge conflicts |
Contributor
|
@cphyc does your prior approval on this still stand? I think it was dismissed just from a merge. I'll try to give this a second review soon. |
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.
PR Summary
I just learned about
difflib.get_close_matches, and it seems like a nice way to remove a custom function of ours.PR Checklist