PythonPredictions / cobra

A Python package to build predictive linear and logistic regression models focused on performance and interpretation
https://pythonpredictions.github.io/cobra.io
MIT License
30 stars 6 forks source link

Matplotlib styles bug fix #184

Open patrickleonardy opened 10 months ago

patrickleonardy commented 10 months ago

Bug

The seaborn-ticks and seaborn-whitegrid matplotlib styles which were available in matplotlib 3.4. are not available since matplotlib 3.6., and have been substituted with seaborn-v0_8-ticks and seaborn-v0_8-whitegrid respectively.

The problem is that cobra requirements.txt asks for matplotlib>=3.4.3, which can create the issue if the matplotlib version installed is actually greater than 3.5.* (last version supporting the seaborn-ticks plot style).

Task Description

You can check yourselves in the style files that are linked here below from the matplotlib GitHub repo:

v2.2.* and v3.5.* versus v3.6.* and v3.8.* (latest)

Regarding Cobra, the files where these styles are used are:

Solution:

Found where they mention the change in the Matplotlib changelog: https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.6.0.html#seaborn-styles-renamed

matplotlib's team advise is to take the style directly from the seaborn package. Therefore, the solution for the long run should probably not be neither 2 nor 3, although I proposed them haha.

JanBenisek commented 10 months ago

Hi, bit of a random message, somehow I got a notification on this PR. Anyway, as one of the early Cobra devs, I just wanted to say that it is cool to see that Cobra is still alive and actively maintained. Great job!