Skip to content

Fix matplotlib deprecation warning and adds some minor improvements#721

Open
amenezes wants to merge 1 commit into
amueller:mainfrom
amenezes:master
Open

Fix matplotlib deprecation warning and adds some minor improvements#721
amenezes wants to merge 1 commit into
amueller:mainfrom
amenezes:master

Conversation

@amenezes

Copy link
Copy Markdown
  • Fix deprecated matplotlib function
test/test_wordcloud.py: 46 warnings
  wordcloud/wordcloud.py:106: MatplotlibDeprecationWarning: The get_cmap function was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use ``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap(obj)`` instead.
    self.colormap = plt.cm.get_cmap(colormap)
  • Added metadata classifiers
  • Improve regex performance using re.compile

Comment thread wordcloud/wordcloud.py
else 0)
pattern = r"\w[\w']*" if self.min_word_length <= 1 else r"\w[\w']+"
regexp = self.regexp if self.regexp is not None else pattern
if self.regexp is not None:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
This call to compile actually doesn't change anything, as the object is only used once, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amueller,

Really sorry for the long delay. Yes there's no change on the workflow. The ideia is to simplify.

All the tests have passed locally, do you think it's useful to include any more?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, I'm only very sporadically on this project these days. How does this change about the re simplify, the code gets longer, right?

@QuLogic

QuLogic commented Apr 24, 2024

Copy link
Copy Markdown

Just a friendly ping here; Matplotlib 3.9 will be out soon and this deprecation will be a hard error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants