From d48dd6208e8856da719500a850729b9c5b90cbc2 Mon Sep 17 00:00:00 2001 From: NiPreps Bot Date: Wed, 17 Apr 2024 19:53:40 +0000 Subject: [PATCH] docs(master): Update docs of development line --- .../niworkflows/interfaces/confounds.html | 15 ++++++++------- .../niworkflows/interfaces/header.html | 2 +- .../niworkflows/interfaces/images.html | 2 +- .../niworkflows/interfaces/plotting.html | 4 ++-- .../interfaces/reportlets/segmentation.html | 4 ++-- .../niworkflows/interfaces/utility.html | 4 ++-- .../niworkflows/interfaces/workbench.html | 4 ++-- .../niworkflows/utils/connections.html | 2 +- master/_modules/niworkflows/viz/plots.html | 11 ++++++----- master/api/niworkflows-anat-ants-1.pdf | Bin 20450 -> 20450 bytes master/api/niworkflows-anat-ants-2.pdf | Bin 16179 -> 16179 bytes master/api/niworkflows-anat-ants-3.pdf | Bin 11748 -> 11748 bytes .../api/niworkflows-anat-coregistration-1.pdf | Bin 10523 -> 10523 bytes master/api/niworkflows-anat-freesurfer-1.pdf | Bin 13597 -> 13597 bytes master/api/niworkflows-anat-skullstrip-1.pdf | Bin 12656 -> 12656 bytes master/api/niworkflows-func-util-1.pdf | Bin 10183 -> 10183 bytes master/api/niworkflows-func-util-2.pdf | Bin 15599 -> 15599 bytes master/api/niworkflows-func-util-3.pdf | Bin 12276 -> 12276 bytes .../niworkflows-workflows-epi-refmap-1.pdf | Bin 9669 -> 9669 bytes 19 files changed, 25 insertions(+), 23 deletions(-) diff --git a/master/_modules/niworkflows/interfaces/confounds.html b/master/_modules/niworkflows/interfaces/confounds.html index d0e8c8b5556..11a9e61d3e6 100644 --- a/master/_modules/niworkflows/interfaces/confounds.html +++ b/master/_modules/niworkflows/interfaces/confounds.html @@ -311,6 +311,7 @@

Source code for niworkflows.interfaces.confounds

import os import re import numpy as np +import operator import pandas as pd from functools import reduce from collections import deque, OrderedDict @@ -447,7 +448,7 @@

Source code for niworkflows.interfaces.confounds

dvars_thresh = traits.Float( 1.5, usedefault=True, - desc="Minimum standardised DVARS threshold for flagging a frame as " "a spike.", + desc="Minimum standardised DVARS threshold for flagging a frame as a spike.", ) header_prefix = traits.Str( "motion_outlier", @@ -458,7 +459,7 @@

Source code for niworkflows.interfaces.confounds

traits.Int, value=[0], usedefault=True, - desc="Relative indices of lagging frames to flag for " "each flagged frame", + desc="Relative indices of lagging frames to flag for each flagged frame", ) minimum_contiguous = traits.Either( None, @@ -593,7 +594,7 @@

Source code for niworkflows.interfaces.confounds

mask[metric] = set(np.where(data[metric] < threshold)[0]) elif criterion == ">": mask[metric] = set(np.where(data[metric] > threshold)[0]) - mask = reduce((lambda x, y: x | y), mask.values()) + mask = reduce(operator.or_, mask.values()) for lag in lags: mask = set([m + lag for m in mask]) | mask @@ -663,7 +664,7 @@

Source code for niworkflows.interfaces.confounds

variables_deriv[o] = ["{}_derivative{}".format(v, o) for v in variables] data_deriv[o] = np.tile(np.nan, data[variables].shape) data_deriv[o][o:, :] = np.diff(data[variables], n=o, axis=0) - variables_deriv = reduce((lambda x, y: x + y), variables_deriv.values()) + variables_deriv = reduce(operator.add, variables_deriv.values()) data_deriv = pd.DataFrame( columns=variables_deriv, data=np.concatenate([*data_deriv.values()], axis=1) ) @@ -708,7 +709,7 @@

Source code for niworkflows.interfaces.confounds

for o in order: variables_exp[o] = ["{}_power{}".format(v, o) for v in variables] data_exp[o] = data[variables] ** o - variables_exp = reduce((lambda x, y: x + y), variables_exp.values()) + variables_exp = reduce(operator.add, variables_exp.values()) data_exp = pd.DataFrame( columns=variables_exp, data=np.concatenate([*data_exp.values()], axis=1) ) @@ -878,7 +879,7 @@

Source code for niworkflows.interfaces.confounds

var[col].appendleft(c) else: var[col].append(c) - unscrambled = reduce((lambda x, y: x + y), var.values()) + unscrambled = reduce(operator.add, var.values()) return data[[*unscrambled]] @@ -959,7 +960,7 @@

Source code for niworkflows.interfaces.confounds

(variables[expression], data[expression]) = parse_expression( expression, parent_data ) - variables = list(set(reduce((lambda x, y: x + y), variables.values()))) + variables = list(set(reduce(operator.add, variables.values()))) data = pd.concat((data.values()), axis=1) if unscramble: diff --git a/master/_modules/niworkflows/interfaces/header.html b/master/_modules/niworkflows/interfaces/header.html index ef0f6abb89a..ff56f04ab90 100644 --- a/master/_modules/niworkflows/interfaces/header.html +++ b/master/_modules/niworkflows/interfaces/header.html @@ -681,7 +681,7 @@

Source code for niworkflows.interfaces.header

max_32bit = traits.Bool( False, usedefault=True, - desc="cast data to float32 if higher " "precision is encountered", + desc="cast data to float32 if higher precision is encountered", ) diff --git a/master/_modules/niworkflows/interfaces/images.html b/master/_modules/niworkflows/interfaces/images.html index 4886956fe1c..9a3fddfc41d 100644 --- a/master/_modules/niworkflows/interfaces/images.html +++ b/master/_modules/niworkflows/interfaces/images.html @@ -980,7 +980,7 @@

Source code for niworkflows.interfaces.images

"signals.tsv", usedefault=True, exists=False, - desc="The name of the file to output to. " "signals.tsv by default", + desc="The name of the file to output to. signals.tsv by default", ) diff --git a/master/_modules/niworkflows/interfaces/plotting.html b/master/_modules/niworkflows/interfaces/plotting.html index ca5fa2e97fe..994a8a62695 100644 --- a/master/_modules/niworkflows/interfaces/plotting.html +++ b/master/_modules/niworkflows/interfaces/plotting.html @@ -410,7 +410,7 @@

Source code for niworkflows.interfaces.plotting

< metadata_files = traits.List( File(exists=True), mandatory=True, - desc="List of files containing component " "metadata", + desc="List of files containing component metadata", ) metadata_sources = traits.List( traits.Str, @@ -423,7 +423,7 @@

Source code for niworkflows.interfaces.plotting

< traits.Float(0.7), traits.Float(0.9), usedefault=True, - desc="Levels of explained variance to include in " "plot", + desc="Levels of explained variance to include in plot", ) out_file = traits.Either( None, File, value=None, usedefault=True, desc="Path to save plot" diff --git a/master/_modules/niworkflows/interfaces/reportlets/segmentation.html b/master/_modules/niworkflows/interfaces/reportlets/segmentation.html index b49dd0a8fc5..689dfd1e291 100644 --- a/master/_modules/niworkflows/interfaces/reportlets/segmentation.html +++ b/master/_modules/niworkflows/interfaces/reportlets/segmentation.html @@ -406,7 +406,7 @@

Source code for niworkflows.interfaces.reportlets.segmentation

out_report = File( "melodic_reportlet.svg", usedefault=True, - desc="Filename for the visual" " report generated " "by Nipype.", + desc="Filename for the visual report generated by Nipype.", ) report_mask = File( desc="Mask used to draw the outline on the reportlet. " @@ -493,7 +493,7 @@

Source code for niworkflows.interfaces.reportlets.segmentation

out_report = File( "ica_aroma_reportlet.svg", usedefault=True, - desc="Filename for the visual" " report generated " "by Nipype.", + desc="Filename for the visual report generated by Nipype.", ) report_mask = File( desc="Mask used to draw the outline on the reportlet. " diff --git a/master/_modules/niworkflows/interfaces/utility.html b/master/_modules/niworkflows/interfaces/utility.html index fb913de66d6..7b03deb9c6c 100644 --- a/master/_modules/niworkflows/interfaces/utility.html +++ b/master/_modules/niworkflows/interfaces/utility.html @@ -744,12 +744,12 @@

Source code for niworkflows.interfaces.utility

None, traits.List(), usedefault=True, - desc="List of columns in the TSV to be " "dropped from the JSON.", + desc="List of columns in the TSV to be dropped from the JSON.", ) enforce_case = traits.Bool( True, usedefault=True, - desc="Enforce snake case for top-level keys " "and camel case for nested keys", + desc="Enforce snake case for top-level keys and camel case for nested keys", ) diff --git a/master/_modules/niworkflows/interfaces/workbench.html b/master/_modules/niworkflows/interfaces/workbench.html index d6678f540d9..e3319693c8e 100644 --- a/master/_modules/niworkflows/interfaces/workbench.html +++ b/master/_modules/niworkflows/interfaces/workbench.html @@ -580,7 +580,7 @@

Source code for niworkflows.interfaces.workbench

if opt in ["current_area", "new_area"]: if not self.inputs.area_surfs and not self.inputs.area_metrics: raise ValueError( - "{} was set but neither area_surfs or" " area_metrics were set".format(opt) + "{} was set but neither area_surfs or area_metrics were set".format(opt) ) if opt == "method": if ( @@ -588,7 +588,7 @@

Source code for niworkflows.interfaces.workbench

and not self.inputs.area_surfs and not self.inputs.area_metrics ): - raise ValueError("Exactly one of area_surfs or area_metrics" " must be specified") + raise ValueError("Exactly one of area_surfs or area_metrics must be specified") if opt == "valid_roi_out" and val: # generate a filename and add it to argstr roi_out = self._gen_filename(self.inputs.in_file, suffix="_roi") diff --git a/master/_modules/niworkflows/utils/connections.html b/master/_modules/niworkflows/utils/connections.html index a1bd639bb3f..a969e62900b 100644 --- a/master/_modules/niworkflows/utils/connections.html +++ b/master/_modules/niworkflows/utils/connections.html @@ -363,7 +363,7 @@

Source code for niworkflows.utils.connections

""" from pathlib import Path from nipype.interfaces.base import isdefined - if not isdefined(value) or isinstance(value, type(None)): + if not isdefined(value) or value is None: return value if isinstance(value, (str, bytes, Path)): return [str(value)] diff --git a/master/_modules/niworkflows/viz/plots.html b/master/_modules/niworkflows/viz/plots.html index db1c4a6e2bb..755a2b763c3 100644 --- a/master/_modules/niworkflows/viz/plots.html +++ b/master/_modules/niworkflows/viz/plots.html @@ -314,6 +314,7 @@

Source code for niworkflows.viz.plots

 import pandas as pd
 
 import matplotlib.pyplot as plt
+from matplotlib import colormaps
 from matplotlib import gridspec as mgs
 import matplotlib.cm as cm
 from matplotlib.colors import Normalize
@@ -495,9 +496,9 @@ 

Source code for niworkflows.viz.plots

         legend = False
 
     if cmap is None:
-        colors = cm.get_cmap("tab10").colors
+        colors = colormaps["tab10"].colors
     elif cmap == "paired":
-        colors = list(cm.get_cmap("Paired").colors)
+        colors = list(colormaps["Paired"].colors)
         colors[0], colors[1] = colors[1], colors[0]
         colors[2], colors[7] = colors[7], colors[2]
 
@@ -695,7 +696,7 @@ 

Source code for niworkflows.viz.plots

     ntsteps = ts_z.shape[1]
 
     # Load a colormap
-    my_cmap = cm.get_cmap(cmap)
+    my_cmap = colormaps[cmap]
     norm = Normalize(vmin=0, vmax=float(nslices - 1))
     colors = [my_cmap(norm(sl)) for sl in range(nslices)]
 
@@ -826,7 +827,7 @@ 

Source code for niworkflows.viz.plots

     cax = fig.add_axes(position)
     cb = ColorbarBase(
         cax,
-        cmap=cm.get_cmap(cmap),
+        cmap=colormaps[cmap],
         spacing="proportional",
         orientation="horizontal",
         drawedges=False,
@@ -995,7 +996,7 @@ 

Source code for niworkflows.viz.plots

     if cutoff is None:
         cutoff = []
 
-    for i, thr in enumerate(cutoff):
+    for thr in cutoff:
         ax_ts.plot((0, ntsteps - 1), [thr] * 2, linewidth=0.2, color="dimgray")
 
         ax_ts.annotate(
diff --git a/master/api/niworkflows-anat-ants-1.pdf b/master/api/niworkflows-anat-ants-1.pdf
index e522729b2406a13caad3d23d2d537f1110d8c244..872b59db669893c6eaf9a071c58408a3e00bc686 100644
GIT binary patch
delta 19
bcmaDfpYhRr#tjR7Sxk)$O*Sv}wPgYTRRjlE

delta 19
bcmaDfpYhRr#tjR7S&U7M4K^?JwPgYTRQLy0

diff --git a/master/api/niworkflows-anat-ants-2.pdf b/master/api/niworkflows-anat-ants-2.pdf
index 7f1ce4c1c24e8b5cb2ac4b35e06743e9eb3d7d75..d5e9ef2a3eb25bdea83ce945152718e968efda20 100644
GIT binary patch
delta 17
Ycmdm7x4CY^CmR-1V?)!;-)wA|07}XSHvj+t

delta 17
Ycmdm7x4CY^CmR-HQ)9!;-)wA|07||GH2?qr

diff --git a/master/api/niworkflows-anat-ants-3.pdf b/master/api/niworkflows-anat-ants-3.pdf
index f5c5131caaac3f7de9f1bf3fcc4d7bb2ae6e4424..f2a3f82447edd7ea00e2a4af5b4171b837e1758e 100644
GIT binary patch
delta 17
YcmaD7{UmzBVr>>vV?(pe%e8Hp07m!*lmGw#

delta 17
YcmaD7{UmzBVr>>n+a