Skip to content

Commit f6261c5

Browse files
committed
sty: ruff format [ignore-rev]
Follow-up with ruff check --select ISC001 --fix
1 parent d2210a8 commit f6261c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+4261
-4674
lines changed

docker/fetch_templates.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ def fetch_MNI2009():
1919
tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_desc-fMRIPrep_boldref.nii.gz
2020
tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-01_label-brain_probseg.nii.gz
2121
"""
22-
template = "MNI152NLin2009cAsym"
22+
template = 'MNI152NLin2009cAsym'
2323

24-
tf.get(template, resolution=2, desc="brain", suffix="mask")
25-
tf.get(template, resolution=2, desc="fMRIPrep", suffix="boldref")
26-
tf.get(template, resolution=1, label="brain", suffix="probseg")
24+
tf.get(template, resolution=2, desc='brain', suffix='mask')
25+
tf.get(template, resolution=2, desc='fMRIPrep', suffix='boldref')
26+
tf.get(template, resolution=1, label='brain', suffix='probseg')
2727

2828

2929
def fetch_MNI152Lin():
@@ -33,10 +33,10 @@ def fetch_MNI152Lin():
3333
tpl-MNI152Lin/tpl-MNI152Lin_res-02_T1w.nii.gz
3434
tpl-MNI152Lin/tpl-MNI152Lin_res-02_desc-brain_mask.nii.gz
3535
"""
36-
template = "MNI152Lin"
36+
template = 'MNI152Lin'
3737

38-
tf.get(template, resolution=2, desc=None, suffix="T1w")
39-
tf.get(template, resolution=2, desc="brain", suffix="mask")
38+
tf.get(template, resolution=2, desc=None, suffix='T1w')
39+
tf.get(template, resolution=2, desc='brain', suffix='mask')
4040

4141

4242
def fetch_OASIS():
@@ -50,13 +50,13 @@ def fetch_OASIS():
5050
tpl-OASIS30ANTs/tpl-OASIS30ANTs_res-01_desc-brain_mask.nii.gz
5151
tpl-OASIS30ANTs/tpl-OASIS30ANTs_res-01_desc-BrainCerebellumExtraction_mask.nii.gz
5252
"""
53-
template = "OASIS30ANTs"
53+
template = 'OASIS30ANTs'
5454

55-
tf.get(template, resolution=1, desc="4", suffix="dseg")
56-
tf.get(template, resolution=1, desc=None, suffix="T1w")
57-
tf.get(template, resolution=1, label="brain", suffix="mask")
58-
tf.get(template, resolution=1, desc="BrainCerebellumExtraction", suffix="mask")
59-
tf.get(template, resolution=1, label="brain", suffix="probseg")
55+
tf.get(template, resolution=1, desc='4', suffix='dseg')
56+
tf.get(template, resolution=1, desc=None, suffix='T1w')
57+
tf.get(template, resolution=1, label='brain', suffix='mask')
58+
tf.get(template, resolution=1, desc='BrainCerebellumExtraction', suffix='mask')
59+
tf.get(template, resolution=1, label='brain', suffix='probseg')
6060

6161

6262
def fetch_fsaverage():
@@ -70,10 +70,10 @@ def fetch_fsaverage():
7070
tpl-fsaverage/tpl-fsaverage_hemi-L_den-164k_midthickness.surf.gii
7171
tpl-fsaverage/tpl-fsaverage_hemi-R_den-164k_midthickness.surf.gii
7272
"""
73-
template = "fsaverage"
73+
template = 'fsaverage'
7474

75-
tf.get(template, density="164k", desc="std", suffix="sphere")
76-
tf.get(template, density="164k", suffix="midthickness")
75+
tf.get(template, density='164k', desc='std', suffix='sphere')
76+
tf.get(template, density='164k', suffix='midthickness')
7777

7878

7979
def fetch_fsLR():
@@ -89,7 +89,7 @@ def fetch_fsLR():
8989
tpl-fsLR/tpl-fsLR_space-fsaverage_hemi-L_den-32k_sphere.surf.gii
9090
tpl-fsLR/tpl-fsLR_space-fsaverage_hemi-R_den-32k_sphere.surf.gii
9191
"""
92-
tf.get("fsLR", density="32k")
92+
tf.get('fsLR', density='32k')
9393

9494

9595
def fetch_all():
@@ -100,21 +100,21 @@ def fetch_all():
100100
fetch_fsLR()
101101

102102

103-
if __name__ == "__main__":
103+
if __name__ == '__main__':
104104
parser = argparse.ArgumentParser(
105-
description="Helper script for pre-caching required templates to run fMRIPrep",
105+
description='Helper script for pre-caching required templates to run fMRIPrep',
106106
)
107107
parser.add_argument(
108-
"--tf-dir",
108+
'--tf-dir',
109109
type=os.path.abspath,
110-
help="Directory to save templates in. If not provided, templates will be saved to"
111-
" `${HOME}/.cache/templateflow`.",
110+
help='Directory to save templates in. If not provided, templates will be saved to'
111+
' `${HOME}/.cache/templateflow`.',
112112
)
113113
opts = parser.parse_args()
114114

115115
# set envvar (if necessary) prior to templateflow import
116116
if opts.tf_dir is not None:
117-
os.environ["TEMPLATEFLOW_HOME"] = opts.tf_dir
117+
os.environ['TEMPLATEFLOW_HOME'] = opts.tf_dir
118118

119119
import templateflow.api as tf
120120

docs/conf.py

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
# Prevent etelemetry from loading at all
2222
# Could set NO_ET environment variable, but why?
2323
MOCKS = [
24-
"etelemetry",
25-
"matplotlib",
26-
"matplotlib.pyplot",
27-
"matplotlib.cm",
28-
"matplotlib.colors",
29-
"matplotlib.colorbar",
24+
'etelemetry',
25+
'matplotlib',
26+
'matplotlib.pyplot',
27+
'matplotlib.cm',
28+
'matplotlib.colors',
29+
'matplotlib.colorbar',
3030
]
3131
sys.modules.update({mod: mock.Mock() for mod in MOCKS})
3232

@@ -38,12 +38,12 @@
3838

3939
from niworkflows import __version__, __copyright__, __packagename__
4040

41-
sys.path.append(os.path.abspath("sphinxext"))
41+
sys.path.append(os.path.abspath('sphinxext'))
4242

4343
# -- Project information -----------------------------------------------------
4444
project = __packagename__
4545
copyright = __copyright__
46-
author = "The NiPreps Developers"
46+
author = 'The NiPreps Developers'
4747

4848
# The short X.Y version
4949
version = Version(__version__).base_version
@@ -53,30 +53,30 @@
5353

5454
# -- General configuration ---------------------------------------------------
5555
extensions = [
56-
"sphinx.ext.autodoc",
57-
"sphinx.ext.coverage",
58-
"sphinx.ext.doctest",
59-
"sphinx.ext.githubpages",
60-
"sphinx.ext.ifconfig",
61-
"sphinx.ext.intersphinx",
62-
"sphinx.ext.mathjax",
63-
"sphinx.ext.viewcode",
64-
"sphinxcontrib.apidoc",
65-
"nipype.sphinxext.apidoc",
66-
"nipype.sphinxext.plot_workflow",
56+
'sphinx.ext.autodoc',
57+
'sphinx.ext.coverage',
58+
'sphinx.ext.doctest',
59+
'sphinx.ext.githubpages',
60+
'sphinx.ext.ifconfig',
61+
'sphinx.ext.intersphinx',
62+
'sphinx.ext.mathjax',
63+
'sphinx.ext.viewcode',
64+
'sphinxcontrib.apidoc',
65+
'nipype.sphinxext.apidoc',
66+
'nipype.sphinxext.plot_workflow',
6767
]
6868

6969
autodoc_mock_imports = [
70-
"nilearn",
71-
"nitime",
72-
"numpy",
73-
"pandas",
74-
"seaborn",
75-
"skimage",
76-
"svgutils",
77-
"templateflow",
78-
"transforms3d",
79-
"yaml",
70+
'nilearn',
71+
'nitime',
72+
'numpy',
73+
'pandas',
74+
'seaborn',
75+
'skimage',
76+
'svgutils',
77+
'templateflow',
78+
'transforms3d',
79+
'yaml',
8080
]
8181

8282
# Accept custom section names to be parsed for numpy-style docstrings
@@ -85,24 +85,24 @@
8585
# https://github.com/sphinx-contrib/napoleon/pull/10 is merged.
8686
napoleon_use_param = False
8787
napoleon_custom_sections = [
88-
("Inputs", "Parameters"),
89-
("Outputs", "Parameters"),
90-
("Attributes", "Parameters"),
91-
("Mandatory Inputs", "Parameters"),
92-
("Optional Inputs", "Parameters"),
88+
('Inputs', 'Parameters'),
89+
('Outputs', 'Parameters'),
90+
('Attributes', 'Parameters'),
91+
('Mandatory Inputs', 'Parameters'),
92+
('Optional Inputs', 'Parameters'),
9393
]
9494

9595
# Add any paths that contain templates here, relative to this directory.
96-
templates_path = ["_templates"]
96+
templates_path = ['_templates']
9797

9898
# The suffix(es) of source filenames.
9999
# You can specify multiple suffix as a list of string:
100100
#
101101
# source_suffix = ['.rst', '.md']
102-
source_suffix = ".rst"
102+
source_suffix = '.rst'
103103

104104
# The master toctree document.
105-
master_doc = "index"
105+
master_doc = 'index'
106106

107107
# The language for content autogenerated by Sphinx. Refer to documentation
108108
# for a list of supported languages.
@@ -115,11 +115,11 @@
115115
# directories to ignore when looking for source files.
116116
# This pattern also affects html_static_path and html_extra_path.
117117
exclude_patterns = [
118-
"_build",
119-
"Thumbs.db",
120-
".DS_Store",
121-
"api/modules.rst",
122-
"api/niworkflows.rst",
118+
'_build',
119+
'Thumbs.db',
120+
'.DS_Store',
121+
'api/modules.rst',
122+
'api/niworkflows.rst',
123123
]
124124

125125
# The name of the Pygments (syntax highlighting) style to use.
@@ -131,7 +131,7 @@
131131
# The theme to use for HTML and HTML Help pages. See the documentation for
132132
# a list of builtin themes.
133133
#
134-
html_theme = "furo"
134+
html_theme = 'furo'
135135

136136
# Theme options are theme-specific and customize the look and feel of a theme
137137
# further. For a list of options available for each theme, see the
@@ -142,12 +142,12 @@
142142
# Add any paths that contain custom static files (such as style sheets) here,
143143
# relative to this directory. They are copied after the builtin static files,
144144
# so a file named "default.css" will overwrite the builtin "default.css".
145-
html_static_path = ["_static"]
145+
html_static_path = ['_static']
146146
html_js_files = [
147-
"js/version-switch.js",
147+
'js/version-switch.js',
148148
]
149149
html_css_files = [
150-
"css/version-switch.css",
150+
'css/version-switch.css',
151151
]
152152

153153
# Custom sidebar templates, must be a dictionary that maps document names
@@ -164,7 +164,7 @@
164164
# -- Options for HTMLHelp output ---------------------------------------------
165165

166166
# Output file base name for HTML help builder.
167-
htmlhelp_basename = "niworkflowsdoc"
167+
htmlhelp_basename = 'niworkflowsdoc'
168168

169169

170170
# -- Options for LaTeX output ------------------------------------------------
@@ -190,10 +190,10 @@
190190
latex_documents = [
191191
(
192192
master_doc,
193-
"niworkflows.tex",
194-
"NiWorkflows Documentation",
195-
"The NiPreps Developers",
196-
"manual",
193+
'niworkflows.tex',
194+
'NiWorkflows Documentation',
195+
'The NiPreps Developers',
196+
'manual',
197197
),
198198
]
199199

@@ -202,7 +202,7 @@
202202

203203
# One entry per manual page. List of tuples
204204
# (source start file, name, description, authors, manual section).
205-
man_pages = [(master_doc, "niworkflows", "NiWorkflows Documentation", [author], 1)]
205+
man_pages = [(master_doc, 'niworkflows', 'NiWorkflows Documentation', [author], 1)]
206206

207207

208208
# -- Options for Texinfo output ----------------------------------------------
@@ -213,12 +213,12 @@
213213
texinfo_documents = [
214214
(
215215
master_doc,
216-
"niworkflows",
217-
"NiWorkflows Documentation",
216+
'niworkflows',
217+
'NiWorkflows Documentation',
218218
author,
219-
"NiWorkflows",
220-
"One line description of project.",
221-
"Miscellaneous",
219+
'NiWorkflows',
220+
'One line description of project.',
221+
'Miscellaneous',
222222
),
223223
]
224224

@@ -238,32 +238,32 @@
238238
# epub_uid = ''
239239

240240
# A list of files that should not be packed into the epub file.
241-
epub_exclude_files = ["search.html"]
241+
epub_exclude_files = ['search.html']
242242

243243

244244
# -- Extension configuration -------------------------------------------------
245245

246-
apidoc_module_dir = "../niworkflows"
247-
apidoc_output_dir = "api"
248-
apidoc_excluded_paths = ["conftest.py", "*/tests/*", "tests/*", "testing.py"]
246+
apidoc_module_dir = '../niworkflows'
247+
apidoc_output_dir = 'api'
248+
apidoc_excluded_paths = ['conftest.py', '*/tests/*', 'tests/*', 'testing.py']
249249
apidoc_separate_modules = True
250-
apidoc_extra_args = ["--module-first", "-d 1", "-T"]
250+
apidoc_extra_args = ['--module-first', '-d 1', '-T']
251251

252252
# -- Options for intersphinx extension ---------------------------------------
253253

254254
# Example configuration for intersphinx: refer to the Python standard library.
255255
intersphinx_mapping = {
256-
"bids": ("https://bids-standard.github.io/pybids/", None),
257-
"matplotlib": ("https://matplotlib.org/stable", None),
258-
"nibabel": ("https://nipy.org/nibabel/", None),
259-
"nipype": ("https://nipype.readthedocs.io/en/latest/", None),
260-
"numpy": ("https://numpy.org/doc/stable/", None),
261-
"pandas": ("https://pandas.pydata.org/pandas-docs/dev", None),
262-
"python": ("https://docs.python.org/3/", None),
263-
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
264-
"smriprep": ("https://www.nipreps.org/smriprep/", None),
265-
"surfplot": ("https://surfplot.readthedocs.io/en/latest/", None),
266-
"templateflow": ("https://www.templateflow.org/python-client", None),
256+
'bids': ('https://bids-standard.github.io/pybids/', None),
257+
'matplotlib': ('https://matplotlib.org/stable', None),
258+
'nibabel': ('https://nipy.org/nibabel/', None),
259+
'nipype': ('https://nipype.readthedocs.io/en/latest/', None),
260+
'numpy': ('https://numpy.org/doc/stable/', None),
261+
'pandas': ('https://pandas.pydata.org/pandas-docs/dev', None),
262+
'python': ('https://docs.python.org/3/', None),
263+
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
264+
'smriprep': ('https://www.nipreps.org/smriprep/', None),
265+
'surfplot': ('https://surfplot.readthedocs.io/en/latest/', None),
266+
'templateflow': ('https://www.templateflow.org/python-client', None),
267267
}
268268

269269
# -- Options for versioning extension ----------------------------------------

0 commit comments

Comments
 (0)