Allow dictionary search to take multiple substrings #4629
Labels
difficulty: easy
A good issue for someone new. Can be done in a few hours
feature
priority: low
No existing plans to resolve
Description
Currently, the
search
method for dictionaries (inutil.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, thedifflib.get_close_matches
method does not allow for multiple strings to check.Additional context
No response
The text was updated successfully, but these errors were encountered: