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

[ENH]: Remove decorator from glm/regression #3921

Merged
merged 7 commits into from
Aug 23, 2023
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
3 changes: 2 additions & 1 deletion doc/changes/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ Changes
- Refactor error raising tests using context managers (:gh:`3854` BY `François Paugam`_)
- Added warning to deprecate `darkness` in ``surf_plotting._compute_facecolors_matplotlib`` and ``html_surface._get_vertexcolor`` (:gh`3855` by `Alisha Kodibagkar`_)
- :bdg-secondary:`Doc` Replace skipped doctests with default code-blocks (:gh:`3681` in by `Patrick Sadil`_)
- Move the `~nilearn.plotting.html_surface._mix_colormaps` to `cm.py` in :mod:`~nilearn.plotting` (:gh:`3919` by `Ahmad Chamma`_)
- Move the `~nilearn.plotting.html_surface._mix_colormaps` to `cm.py` in :mod:`~nilearn.plotting` (:gh:`3919` by `Ahmad Chamma`_)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be part of the change, but that's truly minor.

- Remove deprecation decorator from `~nilearn.glm.regression` (:gh:`3921` by `Ahmad Chamma`_)
24 changes: 0 additions & 24 deletions nilearn/glm/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

__docformat__ = "restructuredtext en"

import functools
import warnings

import numpy as np
import scipy.linalg as spl
Expand All @@ -29,28 +27,6 @@
from nilearn.glm.model import LikelihoodModelResults


def _deprecation_warning(
old_param, new_param, start_version, end_version="future"
):
def _warned_func(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
warnings.warn(
category=FutureWarning,
message=(
f"'{old_param}' has been deprecated "
f"in version {start_version} "
f"and will be removed in version {end_version}.\n"
f"Please use '{new_param}' instead."
),
)
return func(*args, **kwargs)

return wrapper

return _warned_func


class OLSModel:
"""A simple ordinary least squares model.

Expand Down