wildcard_match#
- jdaviz.utils.wildcard_match(obj, value, choices=None)[source]#
Wrapper that handles both single string and list/tuple of strings as inputs for
value.Returns a list of strings from
obj.choicesthat match the wildcard pattern(s) invalue. If no matches are found, returns a list containingvalueitself.Note
fnmatchprovides support for all Unix style wildcards including*,?. We do not check for ‘[seq]`` and ‘[!seq]’ because image extensions as we handle them contain brackets.- Parameters:
- objobject
An object with attributes
choicesand potentiallymultiselect.- valuestr or list or tuple
A string or list/tuple of strings to match against choices. Each string may contain Unix shell-style wildcards.
- choiceslist of str, optional
A list of strings to match against. If not provided,
obj.choiceswill be used.
- Returns:
- list of str
A list of matched strings or
value/[value]if no matches found.