Skip to content

Commit

Permalink
[ENH] Update to NiPreps-style config file (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcieslak authored May 10, 2024
1 parent 36b93fe commit 934bb0c
Show file tree
Hide file tree
Showing 63 changed files with 3,973 additions and 3,955 deletions.
8 changes: 4 additions & 4 deletions .circleci/get_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,10 @@ get_bids_data() {
# Get Multi Shell outputs
if [[ ${DS} = multishell_output ]]; then
${WGET} \
-O multishell_output.tar.gz \
"https://upenn.box.com/shared/static/nwxdn4ale8dkebvpjmxbx99dqjzwvlmh.gz"
tar xvfz multishell_output.tar.gz -C ${WORKDIR}/data/
rm multishell_output.tar.gz
-O multishell_output.tar.xz \
"https://upenn.box.com/shared/static/hr7xnxicbx9iqndv1yl35bhtd61fpalp.xz"
tar xvfJ multishell_output.tar.xz -C ${WORKDIR}/data/
rm multishell_output.tar.xz
fi

# Get Single Shell outputs
Expand Down
21 changes: 0 additions & 21 deletions qsiprep/__about__.py

This file was deleted.

31 changes: 25 additions & 6 deletions qsiprep/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
#
# Copyright The NiPreps Developers <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# We support and encourage derived works from this project, please read
# about our expectations at
#
# https://www.nipreps.org/community/licensing/
#
"""Top-module metadata."""

"""
try:
from ._version import __version__
except ImportError:
__version__ = "0+unknown"

import warnings

from .__about__ import __copyright__, __credits__, __packagename__, __version__ # noqa

# cmp is not used by qsiprep, so ignore nipype-generated warnings
warnings.simplefilter("ignore")
warnings.filterwarnings("ignore", r"cmp not installed")
Expand Down
48 changes: 48 additions & 0 deletions qsiprep/_warnings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copied without change from fMRIPrep
#
# Copyright The NiPreps Developers <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# We support and encourage derived works from this project, please read
# about our expectations at
#
# https://www.nipreps.org/community/licensing/
#
"""Manipulate Python warnings."""

import logging
import warnings

_wlog = logging.getLogger("py.warnings")
_wlog.addHandler(logging.NullHandler())


def _warn(message, category=None, stacklevel=1, source=None):
"""Redefine the warning function."""
if category is not None:
category = type(category).__name__
category = category.replace("type", "WARNING")

logging.getLogger("py.warnings").warning(f"{category or 'WARNING'}: {message}")


def _showwarning(message, category, filename, lineno, file=None, line=None):
_warn(message, category=category)


warnings.warn = _warn
warnings.showwarning = _showwarning
Loading

0 comments on commit 934bb0c

Please sign in to comment.