Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEP] deprecate bids_langloc fetcher #4219

Merged
merged 5 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Changes
- :bdg-dark:`Code` Move user facing function ``concat_niimgs`` out of private module ``nilearn._utils.niimg_conversions`` (:gh:`4167` by `Rémi Gau`_).
- :bdg-danger:`Deprecation` Rename the parameter ``contrast_type`` in :func:`~glm.compute_contrast` and attribute ``contrast_type`` in :class:`~glm.Contrast` to ``stat_type`` (:gh:`4191` by `Rémi Gau`_).
- :bdg-danger:`Deprecation` :func:`~plotting.plot_surf_roi` will raise a warning if ``roi_map`` contains negative or non-integer values; in version 0.13 this will be a ``ValueError`` (:gh:`4131` by `Michelle Wang`_).
- :bdg-danger:`Deprecation` ``nilearn.datasets.fetch_bids_langloc_dataset`` will be deprecated in release 0.13 as it returns data simuilar to :func:`~.datasets.fetch_language_localizer_demo_dataset` (:gh:`4219` by `Rémi Gau`_).
- :bdg-dark:`Code` Remove leading underscore from non private functions to align with PEP8 (:gh:`4086` by `Rémi Gau`_).
- :bdg-dark:`Code` Make ``decoding/proximal_operator`` explicitly private to align with PEP8 (:gh:`4153` by `Rémi Gau`_).
- :bdg-dark:`Code` Make private functions public when used outside of their module ``nilearn.interface`` to align with PEP8 (:gh:`4168` by `Rémi Gau`_).
1 change: 1 addition & 0 deletions nilearn/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def suppress_specific_warning():
"`legacy_format` will default to `False`.*|"
"In release 0.13, this fetcher will return a dictionary.*|"
"The default strategy for standardize.*|"
"The 'fetch_bids_langloc_dataset' function will be removed.*|"
)
warnings.filterwarnings(
"ignore",
Expand Down
23 changes: 19 additions & 4 deletions nilearn/datasets/func.py
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,15 @@
def fetch_bids_langloc_dataset(data_dir=None, verbose=1):
"""Download language localizer example :term:`bids<BIDS>` dataset.

.. deprecated:: 0.11.0

This fetcher function will be removed as it returns the same data
as :func:`nilearn.datasets.fetch_language_localizer_demo_dataset`.

Please use
:func:`nilearn.datasets.fetch_language_localizer_demo_dataset`
instead.

Parameters
----------
%(data_dir)s
Expand All @@ -2227,11 +2236,17 @@

downloaded_files : :obj:`list` of :obj:`str`
Absolute paths of downloaded files on disk.

description: :obj:`str`
data description

"""
warnings.warn(
(
"The 'fetch_bids_langloc_dataset' function will be removed "
"in version 0.13.0 as it returns the same data "
"as 'fetch_language_localizer_demo_dataset'.\n"
"Please use 'fetch_language_localizer_demo_dataset' instead.'"
),
DeprecationWarning,
stacklevel=2,
)
url = "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/5888d9a76c613b01fc6acc4e" # noqa: E501
dataset_name = "bids_langloc_example"
main_folder = "bids_langloc_dataset"
Expand Down Expand Up @@ -3013,9 +3028,9 @@
return data

# No. Download the data
data = _download_data_spm_multimodal(data_dir, subject_dir, subject_id)
data.description = description
return data

Check warning on line 3033 in nilearn/datasets/func.py

View check run for this annotation

Codecov / codecov/patch

nilearn/datasets/func.py#L3031-L3033

Added lines #L3031 - L3033 were not covered by tests


@fill_doc
Expand Down Expand Up @@ -3085,7 +3100,7 @@
# maybe data_dir already contains the data ?
data = _glob_fiac_data()
if data is not None:
data.description = description

Check warning on line 3103 in nilearn/datasets/func.py

View check run for this annotation

Codecov / codecov/patch

nilearn/datasets/func.py#L3103

Added line #L3103 was not covered by tests
return data

# No. Download the data
Expand All @@ -3098,9 +3113,9 @@
uncompress_file(archive_path)
except Exception:
print("Archive corrupted, trying to download it again.")
data = fetch_fiac_first_level(data_dir=data_dir)
data.description = description
return data

Check warning on line 3118 in nilearn/datasets/func.py

View check run for this annotation

Codecov / codecov/patch

nilearn/datasets/func.py#L3116-L3118

Added lines #L3116 - L3118 were not covered by tests

data = _glob_fiac_data()
data.description = description
Expand Down