Skip to content

Commit

Permalink
[DOC] remove single occurence from docs.py (#3834)
Browse files Browse the repository at this point in the history
* bg_on_data

* rm single occurence from docs.py
  • Loading branch information
Remi-Gau committed Jul 9, 2023
1 parent 34613ab commit 27fadc1
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 51 deletions.
39 changes: 1 addition & 38 deletions nilearn/_utils/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def custom_function(vertices):

# bg_on_data
docdict['bg_on_data'] = r"""
bg_on_data : :obj:`bool`, optional
bg_on_data : :obj:`bool`, default=False
If `True` and a `bg_map` is specified,
the `surf_data` data is multiplied by the background image,
so that e.g. sulcal depth is jointly visible with `surf_data`.
Expand All @@ -84,18 +84,6 @@ def custom_function(vertices):
"""

# bg_vmax
docdict['bg_vmax'] = """
bg_vmin : :obj:`float`, optional
vmax for `bg_img`.
"""

# bg_vmin
docdict['bg_vmin'] = """
bg_vmin : :obj:`float`, optional
vmin for `bg_img`.
"""

# black_bg
docdict['black_bg'] = """
black_bg : :obj:`bool`, or "auto", optional
Expand Down Expand Up @@ -290,13 +278,6 @@ def custom_function(vertices):
to indicate the cut position.
"""

# ensure_finite
docdict['ensure_finite'] = """
ensure_finite : :obj:`bool`, optional
If `True`, the non-finite values (NANs and infs) found in the data
will be replaced by zeros.
"""

# extractor / extract_type
docdict['extractor'] = """
extractor : {"local_regions", "connected_components"}, default="local_regions"
Expand Down Expand Up @@ -368,12 +349,6 @@ def custom_function(vertices):
Hemisphere to display.
"""

# hemispheres
docdict['hemispheres'] = """
hemispheres : :obj:`list` of :obj:`str`, default=["left", "right"]
Hemispheres to display.
"""

# high_pass
docdict['high_pass'] = """
high_pass : :obj:`float`, default=None
Expand Down Expand Up @@ -471,12 +446,6 @@ def custom_function(vertices):
Lower fraction of the histogram to be discarded.
"""

# mask_img
docdict['mask_img'] = """
mask_img : Niimg-like object
Object used for masking the data.
"""

# mask_strategy
docdict["mask_strategy"] = """
mask_strategy : {"background", "epi", "whole-brain-template",\
Expand Down Expand Up @@ -594,12 +563,6 @@ def custom_function(vertices):
docdict['n_jobs'] = n_jobs.format("1")
docdict['n_jobs_all'] = n_jobs.format("-1")

# n_parcels
docdict['n_parcels'] = """
n_parcels : :obj:`int`, default=50
Number of parcels to divide the data into.
"""

# opening
docdict['opening'] = """
opening : :obj:`bool` or :obj:`int`, optional
Expand Down
2 changes: 0 additions & 2 deletions nilearn/plotting/html_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5',
white background. Default=False.
%(bg_on_data)s
Default=False.
%(darkness)s
Default=1.
Expand Down Expand Up @@ -346,7 +345,6 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None,
Default=None.
%(bg_on_data)s
Default=False.
%(darkness)s
Default=1.
Expand Down
9 changes: 7 additions & 2 deletions nilearn/plotting/img_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,13 @@ def _plot_img_with_bg(img, bg_img=None, cut_coords=None,
----------
%(img)s
Image to plot.
%(bg_vmin)s
%(bg_vmax)s
bg_vmin : :obj:`float`, optional
vmin for `bg_img`.
bg_vmax : :obj:`float`, optional
vmax for `bg_img`.
interpolation : string, optional
Passed to the add_overlay calls.
Default='nearest'.
Expand Down
7 changes: 2 additions & 5 deletions nilearn/plotting/surf_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,6 @@ def plot_surf(surf_mesh, surf_map=None, bg_map=None,
``matplotlib`` engine.
%(bg_on_data)s
Default=False.
%(darkness)s
Default=1.
Expand Down Expand Up @@ -1065,7 +1064,6 @@ def plot_surf_stat_map(surf_mesh, stat_map, bg_map=None,
%(symmetric_cbar)s
Default='auto'.
%(bg_on_data)s
Default=False.
%(darkness)s
Default=1.
Expand Down Expand Up @@ -1291,9 +1289,9 @@ def plot_img_on_surf(stat_map, surf_mesh='fsaverage5', mask_img=None,
If ``None``, don't apply any mask.
%(bg_on_data)s
Default=False.
%(hemispheres)s
hemispheres : :obj:`list` of :obj:`str`, default=["left", "right"]
Hemispheres to display.
inflate : bool, optional
If True, display images in inflated brain.
Expand Down Expand Up @@ -1506,7 +1504,6 @@ def plot_surf_roi(surf_mesh, roi_map, bg_map=None,
``matplotlib`` engine.
%(bg_on_data)s
Default=False.
%(darkness)s
Default=1.
Expand Down
5 changes: 4 additions & 1 deletion nilearn/regions/parcellations.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ class Parcellations(_MultiPCA):
ward and rena are the best options. Ward will give higher quality
parcels, but with increased computation time. ReNA is most useful as a
fast data-reduction step, typically dividing the signal size by ten.
%(n_parcels)s
n_parcels : :obj:`int`, default=50
Number of parcels to divide the data into.
%(random_state)s
Default=0.
Expand Down
4 changes: 3 additions & 1 deletion nilearn/regions/rena_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,9 @@ class ReNA(BaseEstimator, ClusterMixin, TransformerMixin):
Parameters
----------
%(mask_img)s
mask_img : Niimg-like object
Object used for masking the data.
n_clusters : :obj:`int`, optional
The number of clusters to find. Default=2.
Expand Down
6 changes: 4 additions & 2 deletions nilearn/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,10 @@ def clean(
Default="zscore".
%(standardize_confounds)s
%(ensure_finite)s
Default=False.
ensure_finite : :obj:`bool`, default=False
If `True`, the non-finite values (NANs and infs) found in the data
will be replaced by zeros.
kwargs : dict
Keyword arguments to be passed to functions called within ``clean``.
Expand Down

0 comments on commit 27fadc1

Please sign in to comment.