Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow dictionary search to take multiple substrings #4629

Closed
brosaplanella opened this issue Nov 29, 2024 · 0 comments · Fixed by #4650
Closed

Allow dictionary search to take multiple substrings #4629

brosaplanella opened this issue Nov 29, 2024 · 0 comments · Fixed by #4650
Labels
difficulty: easy A good issue for someone new. Can be done in a few hours feature priority: low No existing plans to resolve

Comments

@brosaplanella
Copy link
Member

Description

Currently, the search method for dictionaries (in util.py) only takes a string. I would be useful to be able to provide a list of strings so it checks for all of them.

Motivation

It would allow for more specific searches. For example, let's say I want a given overpotential in the negative electrode but can't recall the name. I could search for "[V]" and "negative" to whittle down the list.

Possible Implementation

For the search method it would be fairly straightforward, we just need to iterate over the list and check all strings are in it.

For the get_best_matches (which is used if the search is unsuccesful) it is less obvious how to fix it as, from what I understand, the difflib.get_close_matches method does not allow for multiple strings to check.

Additional context

No response

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
difficulty: easy A good issue for someone new. Can be done in a few hours feature priority: low No existing plans to resolve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant