Skip to content

Commit 714d757

Browse files
authored
Merge pull request #1310 from joshuacwnewton/jn/1309-filter-numpy-warning-longdouble-wsl
Filter upstream warning raised by `np.finfo(np.longdouble)` on WSL1
2 parents 0e925ab + 2978ee8 commit 714d757

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.zenodo.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@
391391
},
392392
{
393393
"name": "freec84"
394+
},
395+
{
396+
"affiliation": "Polytechnique Montréal, Montréal, CA",
397+
"name": "Newton, Joshua",
398+
"orcid": "0009-0005-6963-3812"
394399
}
395400
],
396401
"keywords": [

nibabel/casting.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,13 @@ def type_info(np_type):
274274
nexp=None,
275275
width=width,
276276
)
277-
info = np.finfo(dt)
277+
# Mitigate warning from WSL1 when checking `np.longdouble` (#1309)
278+
with warnings.catch_warnings():
279+
warnings.filterwarnings(
280+
action='ignore', category=UserWarning, message='Signature.*numpy.longdouble'
281+
)
282+
info = np.finfo(dt)
283+
278284
# Trust the standard IEEE types
279285
nmant, nexp = info.nmant, info.nexp
280286
ret = dict(

0 commit comments

Comments
 (0)