@@ -51,125 +51,46 @@ def reset_warnings(gallery_conf, fname):
51
51
)
52
52
# internal warnings
53
53
warnings .filterwarnings ("default" , module = "sphinx" )
54
- # allow these warnings, but don't show them
54
+ # don't error on joblib warning during parallel doc build otherwise we get a
55
+ # cryptic deadlock instead of a nice traceback
56
+ warnings .filterwarnings (
57
+ "always" ,
58
+ "A worker stopped while some jobs were given to the executor.*" ,
59
+ category = UserWarning ,
60
+ )
61
+ # ignore (DeprecationWarning)
55
62
for key in (
56
- "invalid version and will not be supported" , # pyxdf
57
- "distutils Version classes are deprecated" , # seaborn and neo
58
- "is_categorical_dtype is deprecated" , # seaborn
59
- "`np.object` is a deprecated alias for the builtin `object`" , # pyxdf
60
- # nilearn, should be fixed in > 0.9.1
61
- "In future, it will be an error for 'np.bool_' scalars to" ,
62
- # sklearn hasn't updated to SciPy's sym_pos dep
63
- "The 'sym_pos' keyword is deprecated" ,
64
- # numba
65
- "`np.MachAr` is deprecated" ,
66
- # joblib hasn't updated to avoid distutils
67
- "distutils package is deprecated" ,
68
- # jupyter
69
- "Jupyter is migrating its paths to use standard" ,
70
- r"Widget\..* is deprecated\." ,
71
- # PyQt6
72
- "Enum value .* is marked as deprecated" ,
73
- # matplotlib PDF output
74
- "The py23 module has been deprecated" ,
75
- # pkg_resources
76
- "Implementing implicit namespace packages" ,
77
- "Deprecated call to `pkg_resources" ,
78
- # nilearn
79
- "pkg_resources is deprecated as an API" ,
80
- r"The .* was deprecated in Matplotlib 3\.7" ,
81
- # Matplotlib->tz
82
- r"datetime\.datetime\.utcfromtimestamp" ,
83
- # joblib
84
- r"ast\.Num is deprecated" ,
85
- r"Attribute n is deprecated and will be removed in Python 3\.14" ,
86
- # numpydoc
87
- r"ast\.NameConstant is deprecated and will be removed in Python 3\.14" ,
88
- # pooch
89
- r"Python 3\.14 will, by default, filter extracted tar archives.*" ,
90
- # seaborn
91
- r"DataFrameGroupBy\.apply operated on the grouping columns.*" ,
92
- # pandas
93
- r"\nPyarrow will become a required dependency of pandas.*" ,
94
- # latexcodec
95
- r"open_text is deprecated\. Use files.*" ,
96
- # python-quantities, via neo
97
- r"numpy\.core is deprecated and has been renamed to numpy\._core" ,
98
- # matplotlib
99
- "__array_wrap__ must accept context and return_scalar.*" ,
100
63
# nibabel
101
64
"__array__ implementation doesn't accept.*" ,
65
+ # pybtex (from sphinxcontrib-bibtex)
66
+ "pkg_resources is deprecated as an API.*" ,
67
+ "\n Implementing implicit namespace packages" ,
68
+ # latexcodec
69
+ r"open_text is deprecated\. Use files" ,
102
70
):
103
71
warnings .filterwarnings ( # deal with other modules having bad imports
104
72
"ignore" , message = f".*{ key } .*" , category = DeprecationWarning
105
73
)
106
- warnings .filterwarnings (
107
- "ignore" ,
108
- message = "Matplotlib is currently using agg, which is a non-GUI backend.*" ,
109
- )
110
- warnings .filterwarnings (
111
- "ignore" ,
112
- message = ".*is non-interactive, and thus cannot.*" ,
113
- )
114
- # seaborn
115
- warnings .filterwarnings (
116
- "ignore" ,
117
- message = "The figure layout has changed to tight" ,
118
- category = UserWarning ,
119
- )
120
- # xarray/netcdf4
121
- warnings .filterwarnings (
122
- "ignore" ,
123
- message = r"numpy\.ndarray size changed, may indicate.*" ,
124
- category = RuntimeWarning ,
125
- )
126
- # qdarkstyle
127
- warnings .filterwarnings (
128
- "ignore" ,
129
- message = r".*Setting theme=.*6 in qdarkstyle.*" ,
130
- category = RuntimeWarning ,
131
- )
132
- # pandas, via seaborn (examples/time_frequency/time_frequency_erds.py)
74
+ # ignore (UserWarning)
133
75
for message in (
134
- "use_inf_as_na option is deprecated.*" ,
135
- r"iteritems is deprecated.*Use \.items instead\." ,
136
- "is_categorical_dtype is deprecated.*" ,
137
- "The default of observed=False.*" ,
138
- "When grouping with a length-1 list-like.*" ,
76
+ # Matplotlib
77
+ ".*is non-interactive, and thus cannot.*" ,
139
78
):
140
79
warnings .filterwarnings (
141
80
"ignore" ,
142
81
message = message ,
143
- category = FutureWarning ,
82
+ category = UserWarning ,
83
+ )
84
+ # ignore (RuntimeWarning)
85
+ for message in (
86
+ # mne-python config file "corruption" due to doc build parallelization
87
+ ".*The MNE-Python config file.*valid JSON.*" ,
88
+ ):
89
+ warnings .filterwarnings (
90
+ "ignore" ,
91
+ message = message ,
92
+ category = RuntimeWarning ,
144
93
)
145
- # pandas in 50_epochs_to_data_frame.py
146
- warnings .filterwarnings (
147
- "ignore" , message = r"invalid value encountered in cast" , category = RuntimeWarning
148
- )
149
- # xarray _SixMetaPathImporter (?)
150
- warnings .filterwarnings (
151
- "ignore" , message = r"falling back to find_module" , category = ImportWarning
152
- )
153
- # Sphinx deps
154
- warnings .filterwarnings (
155
- "ignore" , message = "The str interface for _CascadingStyleSheet.*"
156
- )
157
- # mne-qt-browser until > 0.5.2 released
158
- warnings .filterwarnings (
159
- "ignore" ,
160
- r"mne\.io\.pick.channel_indices_by_type is deprecated.*" ,
161
- )
162
- # parallel building
163
- warnings .filterwarnings (
164
- "ignore" ,
165
- "A worker stopped while some jobs were given to the executor.*" ,
166
- category = UserWarning ,
167
- )
168
- # neo
169
- warnings .filterwarnings (
170
- "ignore" ,
171
- "The 'copy' argument in Quantity is deprecated.*" ,
172
- )
173
94
174
95
# In case we use np.set_printoptions in any tutorials, we only
175
96
# want it to affect those:
0 commit comments