from operator import is_none
from typing import Any
from toolz.dicttoolz import valfilter
mapping = {'cmap': 'image.cmap',
'fontsize': 'font.size',
'font': 'font.sans-serif',
'linewidth': 'lines.linewidth',
'figsize': 'figure.figsize'}
def is_not_none(item: Any) -> bool: # Python 3.14 adds this to operator
return not is_none(item)
# Explicit args take priority over any other
args_dict = valfilter(is_not_none, vars(user_args))
explicit_args = {
mapping[key]: args_dict[key]
for key in (args_dict.keys() & mapping.keys())
}
Let's note that for another PR
Originally posted by @ajjackson in #481 (comment)
Let's note that for another PR
Originally posted by @ajjackson in #481 (comment)