Skip to content

Commit

Permalink
fix(plots): filter invalid adjustText warning if logger is available
Browse files Browse the repository at this point in the history
Signed-off-by: Cameron Smith <[email protected]>
  • Loading branch information
cameronraysmith committed Aug 29, 2024
1 parent 8986fc6 commit 508ee80
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/pyrovelocity/plots/_genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@
logger = configure_logging(__name__)


ajusttext_warn = adjustText.logger.warn
if hasattr(adjustText, "logger"):
ajusttext_warn = adjustText.logger.warn

def filter_adjusttext_matplotlib_warn(message, *args, **kwargs):
if "Looks like you are using an old matplotlib version" not in message:
ajusttext_warn(message, *args, **kwargs)

def filter_adjusttext_matplotlib_warn(message, *args, **kwargs):
if "Looks like you are using an old matplotlib version" not in message:
ajusttext_warn(message, *args, **kwargs)


adjustText.logger.warn = filter_adjusttext_matplotlib_warn
adjustText.logger.warn = filter_adjusttext_matplotlib_warn


@beartype
Expand Down

0 comments on commit 508ee80

Please sign in to comment.