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

[MAINT] make proximal_operator a private module #4153

Merged
merged 3 commits into from
Dec 13, 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
5 changes: 3 additions & 2 deletions doc/changes/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Enhancements
- :bdg-dark:`Code` :meth:`~maskers.NiftiLabelsMasker.generate_report` now uses appropriate cut coordinates when functional image is provided (:gh:`4099` by `Yasmin Mzayek`_ and `Nicolas Gensollen`_).
- :bdg-info:`Plotting` When plotting thresholded statistical maps with a colorbar, the threshold value(s) will now be displayed as tick labels on the colorbar (:gh:`#2833` by `Nicolas Gensollen`_).
- :bdg-success:`API` :class:`~maskers.NiftiSpheresMasker` now has ``generate_report`` method (:gh:`3102` by `Yasmin Mzayek`_ and `Nicolas Gensollen`_).
- :bdg-primary:`Doc` Mention the classification type (all-vs-one) in :ref:`sphx_glr_auto_examples_02_decoding_plot_haxby_glm_decoding.py` (:gh:`4122` by `Tamer Gezici`_).
- :bdg-primary:`Doc` Specify full form of LSS in :ref:`sphx_glr_auto_examples_07_advanced_plot_beta_series.py` (:gh:`4141` by `Tamer Gezici`_).
- :bdg-primary:`Doc` Mention the classification type (all-vs-one) in :ref:`sphx_glr_auto_examples_02_decoding_plot_haxby_glm_decoding.py` (:gh:`4122` by `Tamer Gezici`_).
Copy link
Member

Choose a reason for hiding this comment

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

This stuff is unrelated

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah: side effect of using pre-commit locally, in this case it cleaned up trailing white spaces when acting on this staged file

- :bdg-primary:`Doc` Specify full form of LSS in :ref:`sphx_glr_auto_examples_07_advanced_plot_beta_series.py` (:gh:`4141` by `Tamer Gezici`_).
- :bdg-primary:`Doc` Don't fetch tmaps in examples if tmaps aren't used in the example. (:gh:`4136` by `Christina Roßmanith`_).

Changes
Expand All @@ -42,3 +42,4 @@ Changes
- :bdg-dark:`Code` Private utility context manager ``write_tmp_imgs`` is refactored into function ``write_imgs_to_path`` (:gh:`4094` by `Yasmin Mzayek`_).
- :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-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`_).
2 changes: 1 addition & 1 deletion nilearn/_utils/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_number_public_functions():
If this is intentional, then the number should be updated in the test.
Otherwise it means that the public API of nilearn has changed by mistake.
"""
assert len({_[0] for _ in all_functions()}) == 215
assert len({_[0] for _ in all_functions()}) == 211


def test_number_public_classes():
Expand Down
4 changes: 2 additions & 2 deletions nilearn/decoding/space_net_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
squared_loss,
squared_loss_grad,
)
from .fista import mfista
from .proximal_operators import (
from ._proximal_operators import (
prox_l1,
prox_l1_with_intercept,
prox_tvl1,
prox_tvl1_with_intercept,
)
from .fista import mfista


def _squared_loss_and_spatial_grad(X, y, w, mask, grad_weight):
Expand Down
2 changes: 1 addition & 1 deletion nilearn/decoding/tests/test_fista.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
squared_loss,
squared_loss_grad,
)
from nilearn.decoding._proximal_operators import prox_l1
from nilearn.decoding.fista import _check_lipschitz_continuous, mfista
from nilearn.decoding.proximal_operators import prox_l1


@pytest.mark.parametrize("scaling", list(np.logspace(-3, 3, num=7)))
Expand Down
2 changes: 1 addition & 1 deletion nilearn/decoding/tests/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from numpy.testing import assert_almost_equal

from nilearn.decoding.proximal_operators import prox_l1, prox_tvl1
from nilearn.decoding._proximal_operators import prox_l1, prox_tvl1


def test_prox_l1_nonexpansiveness(rng, n_features=10):
Expand Down