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

Flag peaks2maps for removal in 0.0.13/0.1.0 #616

Merged
merged 4 commits into from
Dec 16, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ changelog:
- title: 🎉 Exciting New Features
labels:
- enhancement
- title: 👎 Deprecations
labels:
- deprecation
- title: 🐛 Bug Fixes
labels:
- bug
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions examples/02_meta-analyses/09_peaks2maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion nimare/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions nimare/extract/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions nimare/meta/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import logging
import os
import warnings
from hashlib import md5

import nibabel as nib
Expand Down Expand Up @@ -438,6 +439,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
Expand All @@ -450,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 = []
Expand Down
9 changes: 9 additions & 0 deletions nimare/meta/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand Down Expand Up @@ -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

"""
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion nimare/workflows/peaks2maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down