From aa20c517708371fceff017be687d812fca6786fc Mon Sep 17 00:00:00 2001 From: Haibao Tang Date: Thu, 23 Nov 2023 20:33:12 -0800 Subject: [PATCH] Set logging level from INFO to DEBUG to match old behavior --- jcvi/apps/base.py | 2 +- jcvi/graphics/base.py | 6 ++---- jcvi/graphics/synteny.py | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/jcvi/apps/base.py b/jcvi/apps/base.py index 100642c3..32ff24e3 100644 --- a/jcvi/apps/base.py +++ b/jcvi/apps/base.py @@ -61,7 +61,7 @@ def get_logger(name: str): logger.handlers.clear() logger.addHandler(RichHandler()) logger.propagate = False - logger.setLevel(logging.INFO) + logger.setLevel(logging.DEBUG) return logger diff --git a/jcvi/graphics/base.py b/jcvi/graphics/base.py index 5569a70a..7e9d0ef2 100644 --- a/jcvi/graphics/base.py +++ b/jcvi/graphics/base.py @@ -34,7 +34,6 @@ FancyArrowPatch, FancyBboxPatch, ) -from matplotlib.path import Path from typing import Optional from ..apps.base import datadir, glob, listify, logger, sample_N, which @@ -313,7 +312,6 @@ def savefig(figname, dpi=150, iopts=None, cleanup=True): format = "pdf" try: logger.debug("Matplotlib backend is: %s", mpl.get_backend()) - logger.debug("Attempting save as: %s", figname) plt.savefig(figname, dpi=dpi, format=format) except Exception as e: logger.error("savefig failed with message:\n%s", e) @@ -324,9 +322,9 @@ def savefig(figname, dpi=150, iopts=None, cleanup=True): remove(figname) sys.exit(1) - msg = "Figure saved to `{0}`".format(figname) + msg = f"Figure saved to `{figname}`" if iopts: - msg += " {0}".format(iopts) + msg += f" {iopts}" logger.debug(msg) if cleanup: diff --git a/jcvi/graphics/synteny.py b/jcvi/graphics/synteny.py index a344b039..671c757a 100644 --- a/jcvi/graphics/synteny.py +++ b/jcvi/graphics/synteny.py @@ -22,6 +22,7 @@ import numpy as np import matplotlib.transforms as transforms +from matplotlib.path import Path from ..apps.base import OptionParser, logger from ..compara.synteny import BlockFile @@ -31,7 +32,6 @@ markup, plt, savefig, - Path, PathPatch, AbstractLayout, )