Skip to content

Commit 1a05bcc

Browse files
authored
fix: root logger was used instead of mplhep logger (#646)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 1e38f42 commit 1a05bcc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ extend-select = [
176176
"SLOT", # flake8-slots
177177
"T10", # flake8-debugger
178178
"TC", # flake8-type-checking
179+
"LOG", # flake8-logging
179180
]
180181
ignore = [
181182
"PLR09", # Too many <...>
@@ -191,7 +192,7 @@ ignore = [
191192

192193
[tool.ruff.lint.per-file-ignores]
193194
"tests/**" = ["T20", "RUF059"]
194-
"docs/conf.py" = ["T20"]
195+
"docs/source/conf.py" = ["T20", "LOG015"]
195196
"src/mplhep/_dev.py" = ["T20"]
196197
"test_*.py" = ["T20"]
197198
"src/mplhep/styles/*.py" = ["FLY002"]

src/mplhep/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def yscale_legend(
167167
msg = f"Could not fit legend after {N} scaling iterations (overlap: {final_overlap}). Try increasing otol, N, or using soft_fail=True."
168168
raise RuntimeError(msg)
169169
if final_overlap > otol:
170-
logging.warning(
170+
logger.warning(
171171
f"Legend still overlaps after {N} scaling iterations (overlap: {final_overlap})"
172172
)
173173

@@ -246,7 +246,7 @@ def yscale_anchored_text(
246246
msg = f"Could not fit AnchoredText after {N} scaling iterations (overlap: {final_overlap}). Try increasing otol, N, or using soft_fail=True."
247247
raise RuntimeError(msg)
248248
if final_overlap > otol:
249-
logging.warning(
249+
logger.warning(
250250
f"AnchoredText still overlaps after {N} scaling iterations (overlap: {final_overlap})"
251251
)
252252

0 commit comments

Comments
 (0)