Skip to content

Commit f76a38a

Browse files
committed
docs: revise docstrings, add changes [docs versions]
1 parent 651b606 commit f76a38a

File tree

6 files changed

+51
-18
lines changed

6 files changed

+51
-18
lines changed

docs/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ Contents
1010
:maxdepth: 3
1111

1212
api/templateflow
13+
14+
What's new
15+
----------
16+
.. include:: ../CHANGES.rst

templateflow/__about__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
3-
"""
4-
Templateflow
5-
"""
3+
"""Versioning and other metadata about TemplateFlow."""
64
from ._version import get_versions
75
__version__ = get_versions()['version']
86
del get_versions

templateflow/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
3-
"""
4-
The Zone of Templates
5-
=====================
6-
"""
3+
"""TemplateFlow is the Zone of Templates."""
74
from .__about__ import __version__, __copyright__, __credits__
85

96
__packagename__ = 'templateflow'

templateflow/api.py

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,26 @@
88

99
def get(template, **kwargs):
1010
"""
11-
Fetch one file from one template
12-
11+
Fetch one file from one particular template.
12+
13+
Parameters
14+
----------
15+
template : str
16+
A template identifier (e.g., ``MNI152NLin2009cAsym``).
17+
18+
Keyword Arguments
19+
-----------------
20+
resolution: int or None
21+
Index to an specific spatial resolution of the template.
22+
suffix : str or None
23+
BIDS suffix
24+
atlas : str
25+
Name of a particular atlas
26+
desc : str
27+
Description field
28+
29+
Examples
30+
--------
1331
>>> str(get('MNI152Lin', resolution=1, suffix='T1w')) # doctest: +ELLIPSIS
1432
'.../tpl-MNI152Lin/tpl-MNI152Lin_res-01_T1w.nii.gz'
1533
@@ -66,8 +84,21 @@ def get(template, **kwargs):
6684

6785
def templates(**kwargs):
6886
"""
69-
Returns a list of available templates
70-
87+
Returns a list of available templates.
88+
89+
Keyword Arguments
90+
-----------------
91+
resolution: int or None
92+
Index to an specific spatial resolution of the template.
93+
suffix : str or None
94+
BIDS suffix
95+
atlas : str
96+
Name of a particular atlas
97+
desc : str
98+
Description field
99+
100+
Examples
101+
--------
71102
>>> base = ['MNI152Lin', 'MNI152NLin2009cAsym', 'NKI', 'OASIS30ANTs']
72103
>>> tpls = templates()
73104
>>> all([t in tpls for t in base])
@@ -82,8 +113,15 @@ def templates(**kwargs):
82113

83114
def get_metadata(template):
84115
"""
85-
Fetch one file from one template
116+
Fetch one file from one template.
117+
118+
Parameters
119+
----------
120+
template : str
121+
A template identifier (e.g., ``MNI152NLin2009cAsym``).
86122
123+
Examples
124+
--------
87125
>>> get_metadata('MNI152Lin')['Name']
88126
'Linear ICBM Average Brain (ICBM152) Stereotaxic Registration Model'
89127

templateflow/conf/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Settings
3-
"""
1+
"""Configuration and settings."""
42
from os import getenv
53
from warnings import warn
64
from pathlib import Path

templateflow/conf/bids.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Extending pyBIDS
3-
"""
1+
"""Extending pyBIDS for querying TemplateFlow."""
42
from pkg_resources import resource_filename
53
from bids.layout import BIDSLayout, add_config_paths
64

0 commit comments

Comments
 (0)