def data_install_msgs(): # Check whether we have data packages from nibabel.data import datasource_or_bomber DATA_PKGS = INFO_VARS['DATA_PKGS'] templates = datasource_or_bomber(DATA_PKGS['nipy-templates']) example_data = datasource_or_bomber(DATA_PKGS['nipy-data']) for dpkg in (templates, example_data): if hasattr(dpkg, 'msg'): # a bomber object, warn log.warn('%s\n%s' % ('_' * 80, dpkg.msg))
def data_install_msgs(): # Check whether we have data packages from nibabel.data import datasource_or_bomber DATA_PKGS = INFO_VARS['DATA_PKGS'] templates = datasource_or_bomber(DATA_PKGS['nipy-templates']) example_data = datasource_or_bomber(DATA_PKGS['nipy-data']) for dpkg in (templates, example_data): if hasattr(dpkg, 'msg'): # a bomber object, warn log.warn('%s\n%s' % ('_'*80, dpkg.msg))
def data_install_msgs(): # Check whether we have data packages try: # Allow setup.py to run without nibabel from nibabel.data import datasource_or_bomber except ImportError: log.warn('Cannot check for optional data packages: see: ' 'http://nipy.org/nipy/users/install_data.html') return DATA_PKGS = INFO_VARS['DATA_PKGS'] templates = datasource_or_bomber(DATA_PKGS['nipy-templates']) example_data = datasource_or_bomber(DATA_PKGS['nipy-data']) for dpkg in (templates, example_data): if hasattr(dpkg, 'msg'): # a bomber object, warn log.warn('%s\n%s' % ('_'*80, dpkg.msg))
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ General utilities for code support. These are modules that we (broadly-speaking) wrote; packages that other people wrote, that we ship, go in the nipy.externals tree. """ from nibabel.data import make_datasource, DataError, datasource_or_bomber # Module level datasource instances for convenience from ..info import DATA_PKGS templates = datasource_or_bomber(DATA_PKGS['nipy-templates']) example_data = datasource_or_bomber(DATA_PKGS['nipy-data']) try: example_data.get_filename() except DataError: HAVE_EXAMPLE_DATA = False else: HAVE_EXAMPLE_DATA = True try: templates.get_filename() except DataError: HAVE_TEMPLATES = False else: HAVE_TEMPLATES = True from nipy.testing import Tester
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Package containing both generic configuration and testing stuff as well as general purpose functions that are useful to a broader community and not restricted to the neuroimaging community. This package may contain third-party software included here for convenience. """ from onetime import OneTimeProperty, setattr_on_read from tmpdirs import TemporaryDirectory, InTemporaryDirectory from nibabel.data import make_datasource, DataError, datasource_or_bomber # Module level datasource instances for convenience from ..info import DATA_PKGS templates = datasource_or_bomber(DATA_PKGS["nipy-templates"]) example_data = datasource_or_bomber(DATA_PKGS["nipy-data"]) from nipy.testing import Tester test = Tester().test bench = Tester().bench