From 61048c606a116969f9f7ab66747d11215092ccb1 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 10 Dec 2021 09:58:39 -0500 Subject: [PATCH 1/4] Add deprecated directive to relevant docstrings. --- nimare/extract/extract.py | 3 +++ nimare/meta/kernel.py | 3 +++ nimare/meta/utils.py | 9 +++++++++ nimare/workflows/peaks2maps.py | 7 ++++++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/nimare/extract/extract.py b/nimare/extract/extract.py index c1d426b68..7449c4cea 100644 --- a/nimare/extract/extract.py +++ b/nimare/extract/extract.py @@ -522,6 +522,9 @@ def download_abstracts(dataset, email): def download_peaks2maps_model(data_dir=None, overwrite=False): """Download the trained Peaks2Maps model from OHBM 2018. + .. deprecated:: 0.0.11 + `download_peaks2maps_model` will be removed in NiMARE 0.0.13. + .. versionadded:: 0.0.2 Parameters diff --git a/nimare/meta/kernel.py b/nimare/meta/kernel.py index 1e95df2f9..5a9467d65 100644 --- a/nimare/meta/kernel.py +++ b/nimare/meta/kernel.py @@ -438,6 +438,9 @@ class MKDAKernel(KDAKernel): class Peaks2MapsKernel(KernelTransformer): """Generate peaks2maps modeled activation images from coordinates. + .. deprecated:: 0.0.11 + `Peaks2MapsKernel` will be removed in NiMARE 0.0.13. + Parameters ---------- model_dir : :obj:`str`, optional diff --git a/nimare/meta/utils.py b/nimare/meta/utils.py index ab9236615..f46153585 100755 --- a/nimare/meta/utils.py +++ b/nimare/meta/utils.py @@ -19,6 +19,9 @@ def model_fn(features, labels, mode, params): """Run model function used internally by peaks2maps. + .. deprecated:: 0.0.11 + `model_fn` will be removed in NiMARE 0.0.13. + .. versionadded:: 0.0.4 """ @@ -163,6 +166,9 @@ def pad_and_conv(input, out_channels, conv_args): def _get_resize_arg(target_shape): """Get resizing arguments, as used by peaks2maps. + .. deprecated:: 0.0.11 + `_get_resize_arg` will be removed in NiMARE 0.0.13. + .. versionadded:: 0.0.1 """ @@ -208,6 +214,9 @@ def compute_p2m_ma( ): """Generate modeled activation (MA) maps using deep ConvNet model peaks2maps. + .. deprecated:: 0.0.11 + `compute_p2m_ma` will be removed in NiMARE 0.0.13. + Parameters ---------- contrasts_coordinates : list of lists that are len == 3 diff --git a/nimare/workflows/peaks2maps.py b/nimare/workflows/peaks2maps.py index 183d26edd..5616c48ac 100644 --- a/nimare/workflows/peaks2maps.py +++ b/nimare/workflows/peaks2maps.py @@ -16,7 +16,12 @@ def peaks2maps_workflow(sleuth_file, output_dir=None, prefix=None, n_iters=10000): - """Run the peaks2maps workflow.""" + """Run the peaks2maps workflow. + + .. deprecated:: 0.0.11 + `peaks2maps_workflow` will be removed in NiMARE 0.0.13. + + """ LGR.info("Loading coordinates...") dset = convert_sleuth_to_dataset(sleuth_file) From debb009c81401881ec08b176b6b25143fd7134d3 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 10 Dec 2021 09:58:54 -0500 Subject: [PATCH 2/4] Add associated warnings. --- examples/02_meta-analyses/09_peaks2maps.py | 3 +++ nimare/cli.py | 4 +++- nimare/meta/kernel.py | 10 ++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/examples/02_meta-analyses/09_peaks2maps.py b/examples/02_meta-analyses/09_peaks2maps.py index 74a3a0019..209462c49 100644 --- a/examples/02_meta-analyses/09_peaks2maps.py +++ b/examples/02_meta-analyses/09_peaks2maps.py @@ -7,6 +7,9 @@ ================================ Generate MA maps with peaks2maps ================================ + +.. warning:: + peaks2maps has been deprecated within NiMARE and will be removed in version 0.0.13. """ ############################################################################### # Start with the necessary imports diff --git a/nimare/cli.py b/nimare/cli.py index 03baa34a7..cc89ffd5d 100644 --- a/nimare/cli.py +++ b/nimare/cli.py @@ -148,7 +148,9 @@ def _get_parser(): "unthresholded maps from peak coordinates. The reconstructed " "maps are evaluated for statistical significance using a " "permutation-based approach with Family Wise Error multiple " - "comparison correction." + "comparison correction. " + "WARNING: " + "The peaks2maps workflow is deprecated and will be removed in NiMARE version 0.0.13." ), ) peaks2maps_parser.set_defaults(func=peaks2maps_workflow) diff --git a/nimare/meta/kernel.py b/nimare/meta/kernel.py index 5a9467d65..0d042ed02 100644 --- a/nimare/meta/kernel.py +++ b/nimare/meta/kernel.py @@ -8,6 +8,7 @@ import logging import os +import warnings from hashlib import md5 import nibabel as nib @@ -453,13 +454,14 @@ class Peaks2MapsKernel(KernelTransformer): """ def __init__(self, model_dir="auto"): + warnings.warn( + "Peaks2MapsKernel is deprecated, and will be removed in NiMARE version 0.0.13.", + DeprecationWarning, + ) + # Use private attribute to hide value from get_params. # get_params will find model_dir=None, which is *very important* when a path is provided. self._model_dir = model_dir - LGR.warning( - "The Peaks2Maps kernel transformer is not intended for serious research. " - "We strongly recommend against using it for any meaningful analyses." - ) def _transform(self, mask, coordinates): transformed = [] From 38835b47e07a7d0dccad2eaddf542ddaf0dffbba Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 10 Dec 2021 09:59:25 -0500 Subject: [PATCH 3/4] Remove peaks2maps subgroup from installation instructions. I'll remove the actual group when we remove Peaks2MapsKernel. --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index d0fac5909..97ecb109e 100755 --- a/README.md +++ b/README.md @@ -26,11 +26,7 @@ pip install nimare ### Local installation (development version) ``` -pip install git+https://github.com/neurostuff/NiMARE.git#egg=nimare[peaks2maps-cpu] -``` -If you have [TensorFlow configured to take advantage of your local GPU](https://www.tensorflow.org/install/) use -``` -pip install git+https://github.com/neurostuff/NiMARE.git#egg=nimare[peaks2maps-gpu] +pip install git+https://github.com/neurostuff/NiMARE.git ``` ## Contributing From 1669c5c66180c236fb30824343390c0425cfe880 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Tue, 14 Dec 2021 11:31:17 -0500 Subject: [PATCH 4/4] Add deprecation section to release notes template. --- .github/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/release.yml b/.github/release.yml index e62b0805c..0c8fee8e8 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -9,6 +9,9 @@ changelog: - title: 🎉 Exciting New Features labels: - enhancement + - title: 👎 Deprecations + labels: + - deprecation - title: 🐛 Bug Fixes labels: - bug