Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/july/rcmod.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# july/rcmod.py
import warnings
import matplotlib as mpl

Expand Down Expand Up @@ -50,6 +51,9 @@ def update_rcparams(
rcmod["ytick.major.size"] = ytickmajorsize
rcmod["figure.dpi"] = dpi
rcmod.update(rc_params_dict)
with warnings.catch_warnings():
warnings.simplefilter("ignore", mpl.cbook.MatplotlibDeprecationWarning)
mpl.rcParams.update(rcmod)

# Use a more generic form of warning filtering that works across multiple versions
try:
warnings.simplefilter("ignore", category=mpl.MatplotlibDeprecationWarning) # For older versions
except AttributeError:
warnings.simplefilter("ignore", category=DeprecationWarning) # For newer versions, or if the above fails