PySCeS / pysces

The official PySCeS project source code repository.
https://pysces.github.io
Other
34 stars 10 forks source link

Ignore case of matplotlib backends #60

Closed jonrkarr closed 2 years ago

jonrkarr commented 3 years ago

I don't think there's a clear convention for the case of matplotlib backends. The documentation uses upper case characters, but I think the software converts backend codes to lower case. To support all possible variants, it would be helpful to match backends ignoring case.

bgoli commented 3 years ago

Thanks. In general I want to look at backend support for current versions of matplotlib so have put this on the todo list.

jonrkarr commented 3 years ago

More seamless integration with matplotlib settings would be simpler.

I was imagining a very simple change.

At https://github.com/PySCeS/pysces/blob/a751a2c042baaf93738c6d2b3bae4d60562eb5a1/pysces/PyscesPlot2.py#L831 and https://github.com/PySCeS/pysces/blob/a751a2c042baaf93738c6d2b3bae4d60562eb5a1/pysces/PyscesPlot2.py#L841

replace

if backend in self.__INTERACTIVE_BACKENDS__:
elif backend == 'native':

with

if backend.lower() in self.__INTERACTIVE_BACKENDS__:
elif backend.lower() == 'native':