Repository: nilearn/nilearn

Issue:
[Maint] Removing deprecations in html_connectome
There are a few deprecations which need to be removed in [`nilearn.plotting.html_connectome`](https://github.com/nilearn/nilearn/blob/master/nilearn/plotting/html_connectome.py)

https://github.com/nilearn/nilearn/blob/7fd55bad75a087ac591edf4c00c85a5806a1c461/nilearn/plotting/html_connectome.py#L102-L110
https://github.com/nilearn/nilearn/blob/7fd55bad75a087ac591edf4c00c85a5806a1c461/nilearn/plotting/html_connectome.py#L202-L207

These two were added 10 months ago and released with 0.5.1 .

If anyone thinks we need to give users more time and defer the removal, mention it immediately. I will file a PR today and will merge it soon, probably tomorrow.


Discussion:
@emdupre @GaelVaroquaux 

Resolving patch:
diff --git a/examples/03_connectivity/plot_probabilistic_atlas_extraction.py b/examples/03_connectivity/plot_probabilistic_atlas_extraction.py
--- a/examples/03_connectivity/plot_probabilistic_atlas_extraction.py
+++ b/examples/03_connectivity/plot_probabilistic_atlas_extraction.py
@@ -86,7 +86,7 @@
 # for more details.
 
 
-view = plotting.view_connectome(correlation_matrix, coords, threshold='80%')
+view = plotting.view_connectome(correlation_matrix, coords, edge_threshold='80%')
 
 # In a Jupyter notebook, if ``view`` is the output of a cell, it will
 # be displayed below the cell
diff --git a/nilearn/plotting/html_connectome.py b/nilearn/plotting/html_connectome.py
--- a/nilearn/plotting/html_connectome.py
+++ b/nilearn/plotting/html_connectome.py
@@ -86,23 +86,6 @@ def _make_connectome_html(connectome_info, embed_js=True):
     return ConnectomeView(as_html)
 
 
-def _replacement_params_view_connectome():
-    """ Returns a dict containing deprecated & replacement parameters
-        as key-value pair for view_connectome().
-        Avoids cluttering the global namespace.
-    """
-    return {
-        'coords': 'node_coords',
-        'threshold': 'edge_threshold',
-        'cmap': 'edge_cmap',
-        'marker_size': 'node_size',
-    }
-
-
-@rename_parameters(replacement_params=_replacement_params_view_connectome(),
-                   end_version='0.6.0',
-                   lib_name='Nilearn'
-                   )
 def view_connectome(adjacency_matrix, node_coords, edge_threshold=None,
                     edge_cmap=cm.bwr, symmetric_cmap=True,
                     linewidth=6., node_size=3., colorbar=True,
@@ -189,20 +172,6 @@ def view_connectome(adjacency_matrix, node_coords, edge_threshold=None,
     return _make_connectome_html(connectome_info)
 
 
-def _replacement_params_view_markers():
-    """ Returns a dict containing deprecated & replacement parameters
-        as key-value pair for view_markers().
-        Avoids cluttering the global namespace.
-    """
-    return {'coords': 'marker_coords',
-            'colors': 'marker_color',
-            }
-
-
-@rename_parameters(replacement_params=_replacement_params_view_markers(),
-                   end_version='0.6.0',
-                   lib_name='Nilearn',
-                   )
 def view_markers(marker_coords, marker_color=None, marker_size=5.,
                  title=None, title_fontsize=25):
     """


Test patch:
diff --git a/nilearn/plotting/tests/test_html_connectome.py b/nilearn/plotting/tests/test_html_connectome.py
--- a/nilearn/plotting/tests/test_html_connectome.py
+++ b/nilearn/plotting/tests/test_html_connectome.py
@@ -66,78 +66,10 @@ def test_view_connectome():
                                            linewidth=8.5, node_size=4.2)
     check_html(html, False, 'connectome-plot')
     html = html_connectome.view_connectome(
-        adj, coord, '85.3%', linewidth=8.5, marker_size=np.arange(len(coord)))
+        adj, coord, '85.3%', linewidth=8.5, node_size=np.arange(len(coord)))
     check_html(html, False, 'connectome-plot')
 
 
-def test_params_deprecation_view_connectome():
-    deprecated_params = {'coords': 'node_coords',
-                         'threshold': 'edge_threshold',
-                         'cmap': 'edge_cmap',
-                         'marker_size': 'node_size',
-                         }
-    deprecation_msg = (
-        'The parameter "{}" will be removed in 0.6.0 release of Nilearn. '
-        'Please use the parameter "{}" instead.'
-    )
-    warning_msgs = {old_: deprecation_msg.format(old_, new_)
-                    for old_, new_ in deprecated_params.items()
-                    }
-
-    adj, coord = _make_connectome()
-    with warnings.catch_warnings(record=True) as raised_warnings:
-        html_connectome.view_connectome(adjacency_matrix=adj,
-                                        coords=coord,
-                                        edge_threshold='85.3%',
-                                        edge_cmap=cm.cyan_orange,
-                                        linewidth=8.5, node_size=4.2,
-                                        )
-
-        html_connectome.view_connectome(adjacency_matrix=adj,
-                                        node_coords=coord,
-                                        threshold='85.3%',
-                                        edge_cmap=cm.cyan_orange,
-                                        linewidth=8.5,
-                                        node_size=4.2,
-                                        )
-
-        html_connectome.view_connectome(adjacency_matrix=adj,
-                                        node_coords=coord,
-                                        edge_threshold='85.3%',
-                                        cmap=cm.cyan_orange,
-                                        linewidth=8.5,
-                                        node_size=4.2,
-                                        )
-
-        html_connectome.view_connectome(adjacency_matrix=adj,
-                                        node_coords=coord,
-                                        edge_threshold='85.3%',
-                                        edge_cmap=cm.cyan_orange,
-                                        linewidth=8.5,
-                                        marker_size=4.2,
-                                        )
-
-        html_connectome.view_connectome(adjacency_matrix=adj,
-                                        node_coords=coord,
-                                        edge_threshold='85.3%',
-                                        edge_cmap=cm.cyan_orange,
-                                        linewidth=8.5,
-                                        node_size=4.2,
-                                        )
-
-        html_connectome.view_connectome(adj,
-                                        coord,
-                                        '85.3%',
-                                        cm.cyan_orange,
-                                        8.5,
-                                        4.2,
-                                        )
-    old_params = ['coords', 'threshold', 'cmap', 'marker_size']
-    for old_param_, raised_warning_ in zip(old_params, raised_warnings):
-        assert warning_msgs[old_param_] == str(raised_warning_.message)
-        assert raised_warning_.category is FutureWarning
-
-
 def test_get_markers():
     coords = np.arange(12).reshape((4, 3))
     colors = ['r', 'g', 'black', 'white']
@@ -165,38 +97,3 @@ def test_view_markers():
         coords, marker_size=list(range(len(coords))))
     check_html(html, False, 'connectome-plot')
 
-
-def test_params_deprecation_view_markers():
-    """ Tests whether use of deprecated keyword parameters of view_markers
-    raise corrrect warnings.
-    """
-    deprecated_params = {'coords': 'marker_coords',
-                         'colors': 'marker_color',
-                         }
-    deprecation_msg = (
-        'The parameter "{}" will be removed in 0.6.0 release of Nilearn. '
-        'Please use the parameter "{}" instead.'
-    )
-    warning_msgs = {old_: deprecation_msg.format(old_, new_)
-                    for old_, new_ in deprecated_params.items()
-                    }
-    coords = np.arange(12).reshape((4, 3))
-    colors = ['r', 'g', 'black', 'white']
-    with warnings.catch_warnings(record=True) as raised_warnings:
-        html_connectome.view_markers(coords=coords,
-                                     marker_color=colors,
-                                     )
-        html_connectome.view_markers(marker_coords=coords,
-                                     colors=colors,
-                                     )
-        html_connectome.view_markers(marker_coords=coords,
-                                     marker_color=colors,
-                                     )
-        html_connectome.view_markers(coords,
-                                     colors,
-                                     )
-    old_params = ['coords', 'colors']
-    assert len(raised_warnings) == 2
-    for old_param_, raised_warning_ in zip(old_params, raised_warnings):
-        assert warning_msgs[old_param_] == str(raised_warning_.message)
-        assert raised_warning_.category is FutureWarning