Commit 9b9b72ab authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Suppress warnings in scripts

parent f85190c2
...@@ -15,12 +15,24 @@ import itertools as it ...@@ -15,12 +15,24 @@ import itertools as it
import sys import sys
import argparse import argparse
import textwrap import textwrap
import warnings
import logging import logging
import numpy as np import numpy as np
import fsl.data.atlases as fslatlases # if h5py <= 2.7.1 is installed,
import fsl.version as fslversion # it will be imported via nibabel,
import fsl.data.image as fslimage # and will cause a numpy warning
# to be emitted.
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=FutureWarning)
import fsl.data.image as fslimage
# If wx is not present, then fsl.utils.platform
# will complain that it is not present.
logging.getLogger('fsl.utils.platform').setLevel(logging.ERROR)
import fsl.data.atlases as fslatlases # noqa
import fsl.version as fslversion # noqa
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -16,9 +16,15 @@ from __future__ import print_function ...@@ -16,9 +16,15 @@ from __future__ import print_function
import os.path as op import os.path as op
import sys import sys
import warnings
import fsl.utils.path as fslpath import fsl.utils.path as fslpath
import fsl.utils.imcp as imcp
import fsl.data.image as fslimage # See atlasq.py for explanation
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=FutureWarning)
import fsl.utils.imcp as imcp
import fsl.data.image as fslimage
usage = """Usage: usage = """Usage:
......
...@@ -12,8 +12,13 @@ NIFTI/ANALYZE image files. ...@@ -12,8 +12,13 @@ NIFTI/ANALYZE image files.
from __future__ import print_function from __future__ import print_function
import sys import sys
import warnings
import fsl.utils.path as fslpath import fsl.utils.path as fslpath
import fsl.data.image as fslimage
# See atlasq.py for explanation
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=FutureWarning)
import fsl.data.image as fslimage
usage = """ usage = """
......
...@@ -17,9 +17,15 @@ from __future__ import print_function ...@@ -17,9 +17,15 @@ from __future__ import print_function
import os.path as op import os.path as op
import sys import sys
import warnings
import fsl.utils.path as fslpath import fsl.utils.path as fslpath
import fsl.utils.imcp as imcp
import fsl.data.image as fslimage # See atlasq.py for explanation
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=FutureWarning)
import fsl.utils.imcp as imcp
import fsl.data.image as fslimage
usage = """Usage: usage = """Usage:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment