Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation fix mpl 3.10 and beyond #69

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cvanelteren
Copy link
Contributor

There are a lot of deprecation warnings from MPL and or Ultraplot existing in the current build. The majority of these fixes can be addressed by modifying the tests. Some of the deprecation warnings ensures keywords of usage to be compatible with mpl 3.10 which will result in errors in later versions.

There are a few errors I have not addressed that warrants some discussion.

  • The first one
    ultraplot/tests/test_1dplots.py::test_boxplot_vectors
    /home/casper/micromamba/envs/ultraplot-dev/lib/python3.11/site-packages/pytest_mpl/plugin.py:125: UltraPlotWarning: Passing lists to fillalpha was removed in v0.9. Please specify different opacities using the property cycle colors instead.
        store.return_value[test_name] = obj(*args, **kwargs)
  • The second one
    ultraplot/tests/test_subplots.py::test_axis_sharing[labels]
    /home/casper/micromamba/envs/ultraplot-dev/lib/python3.11/site-packages/pytest_mpl/plugin.py:125: UltraPlotWarning: Calling arbitrary axes methods from SubplotGrid was deprecated in v0.8 and will be removed in a future release. Please index the grid or loop over the grid instead.
    store.return_value[test_name] = obj(*args, **kwargs)

For both of these, I don't agree with the deprecation warning. The first issue indicates that we should move towards a cycler object. However, adjusting the subplot to match the target baseline cannot be readily achieved through the cycler object. It requires setting the patches to a different alpha and leaving the lines with alpha = 1. This would (I think) require an extension of what the cycler object can handle which is to set all potential properties of all the artists. I don't think it can currently do this.

The second error implies the removal of multi-axis formatting. Personally, I would be against removing this feature as it is one of the most powerful features of UltraPlot.

@cvanelteren cvanelteren marked this pull request as draft February 3, 2025 04:58
@cvanelteren
Copy link
Contributor Author

Making this a draft as we have not updated to 3.10 yet.

@cvanelteren
Copy link
Contributor Author

Note I had to rename the warning UltraplotWarning to UltraPlotWarning due to some weird pytest-xdist issue.

@cvanelteren cvanelteren added the TODO TODO label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO TODO
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant