Skip to content

Enhancement/reduce verbosity#524

Merged
timtreis merged 10 commits intoscverse:mainfrom
MeyerBender:enhancement/reduce_verbosity
Mar 2, 2026
Merged

Enhancement/reduce verbosity#524
timtreis merged 10 commits intoscverse:mainfrom
MeyerBender:enhancement/reduce_verbosity

Conversation

@MeyerBender
Copy link
Contributor

Set the default logging level to WARNINGS instead of INFO to avoid printing walls of text when everything is working correctly.

Example usage:

import spatialdata_plot
from spatialdata.datasets import blobs

blob = blobs()

# this used to trigger printing of an info message
# now it just outputs the plot
blob.pl.render_shapes("blobs_circles", method='datashader').pl.show()

# to get the old, more verbose behavior
spatialdata_plot.set_verbosity(True)
blob.pl.render_shapes("blobs_circles", method='datashader').pl.show()

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.97%. Comparing base (2b10a49) to head (8837374).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata_plot/_logging.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #524      +/-   ##
==========================================
+ Coverage   83.75%   83.97%   +0.21%     
==========================================
  Files           8        9       +1     
  Lines        2555     2590      +35     
==========================================
+ Hits         2140     2175      +35     
  Misses        415      415              
Files with missing lines Coverage Δ
src/spatialdata_plot/__init__.py 100.00% <100.00%> (ø)
src/spatialdata_plot/_settings.py 100.00% <100.00%> (ø)
src/spatialdata_plot/_logging.py 94.73% <93.33%> (+3.07%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Replace bool-based verbosity with a Verbosity IntEnum (error/warning/info/debug)
that accepts enum, int, or string input. This aligns with scanpy's established
pattern across the scverse ecosystem and allows finer-grained control.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@timtreis
Copy link
Member

timtreis commented Feb 28, 2026

Hey @MeyerBender

thanks for the PR! Agree that it's very noisy. I've pushed a minor refactor that replaces the bool-based set_verbosity(True/False) with a Verbosity IntEnum mirroring scanpy's convention (error/warning/info/debug).

It'd now be

import spatialdata_plot
from spatialdata.datasets import blobs

blob = blobs()

# this used to trigger printing of an info message
# now it just outputs the plot
blob.pl.render_shapes("blobs_circles", method='datashader').pl.show()

# to get the old, more verbose behavior
spatialdata_plot.set_verbosity("info")
blob.pl.render_shapes("blobs_circles", method='datashader').pl.show()

The default is still warning, preserving your original intent. Could you test if that is the UX you hoped for?

Copy link
Contributor Author

@MeyerBender MeyerBender left a comment

Choose a reason for hiding this comment

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

Hi @timtreis, thanks a lot, LGTM!

@timtreis timtreis self-requested a review March 2, 2026 16:25
Copy link
Member

@timtreis timtreis left a comment

Choose a reason for hiding this comment

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

lgtm

@timtreis timtreis merged commit f2b9996 into scverse:main Mar 2, 2026
4 checks passed
@timtreis timtreis linked an issue Mar 2, 2026 that may be closed by this pull request
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.

Reduce default verbosity of the package

3 participants