Closed retostauffer closed 4 months ago
Sounds like a good idea!
But if we have to depend on matplotlib, it would be tolerable, I guess.
Fixed, make that dependent on the input and only import matplotlib
when needed.
Adjusted tests and the GitHub Action workflow, now does the following:
matplotlib
, imageio
, pandas
).@zeileis FYI
Testing the package on a 'naked' installation (Unix and Windows) and noticed that the one soft-dependency (suggested;
matplotlib
) is required for color vision deficiency simulation. To be precise:Minimal
... where
deutan()
callsCVD.check_hex_colors()
which importsmatplotlib.colors.to_hex
to allow for conversion for e.g.,"red"
,1
.Possible solution
I think this can be removed easily by only importing
matplotlib
if we do only get strings with valid hex colors by re-using the regex fromcolorlib.hex_to_sRGB
/def: validhex()
and only (try except) import matplotlib when needed.