Skip to content

Commit d0e6363

Browse files
authored
Merge pull request #1163 from ZviBaratz/docs
Fixed documentation build error and warnings
2 parents 14faf88 + e86addb commit d0e6363

22 files changed

+77
-67
lines changed

.github/workflows/misc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525
python-version: ["3.10"]
2626
install: ['pip']
27-
check: ['style', 'doc']
27+
check: ['style', 'doctest']
2828
pip-flags: ['']
2929
depends: ['REQUIREMENTS']
3030
env:

doc-requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Requirements for building docs
1+
# Auto-generated by tools/update_requirements.py
22
-r requirements.txt
3-
sphinx<3
3+
matplotlib >= 1.5.3
44
numpydoc
5+
sphinx ~= 5.3
56
texext
6-
matplotlib >=1.3.1
7+
tomli; python_version < "3.11"

doc/source/conf.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
from pathlib import Path
2424
from runpy import run_path
2525

26-
import toml
26+
try:
27+
import tomllib
28+
except ImportError:
29+
import tomli as tomllib
2730

2831
# Check for external Sphinx extensions we depend on
2932
try:
@@ -52,14 +55,15 @@
5255
fobj.write(rel['long_description'])
5356

5457
# Load metadata from setup.cfg
55-
pyproject_dict = toml.load(Path("../../pyproject.toml"))
56-
metadata = pyproject_dict["project"]
58+
with open(Path("../../pyproject.toml"), 'rb') as fobj:
59+
pyproject = tomllib.load(fobj)
60+
authors = pyproject["project"]["authors"][0]
5761

5862
# Add any Sphinx extension module names here, as strings. They can be
5963
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
6064
extensions = ['sphinx.ext.autodoc',
6165
'sphinx.ext.doctest',
62-
#'sphinx.ext.intersphinx',
66+
'sphinx.ext.intersphinx',
6367
'sphinx.ext.todo',
6468
'sphinx.ext.mathjax',
6569
'sphinx.ext.inheritance_diagram',
@@ -69,9 +73,10 @@
6973
'matplotlib.sphinxext.plot_directive',
7074
]
7175

72-
# the following doesn't work with sphinx < 1.0, but will make a separate
73-
# sphinx-autogen run obsolete in the future
74-
#autosummary_generate = True
76+
# Autosummary always wants to use a `generated/` directory.
77+
# We generate with `make api-stamp`
78+
# This could change in the future
79+
autosummary_generate = False
7580

7681
# Add any paths that contain templates here, relative to this directory.
7782
templates_path = ['_templates']
@@ -87,9 +92,7 @@
8792

8893
# General information about the project.
8994
project = u'NiBabel'
90-
author_name = metadata["authors"][0]["name"]
91-
author_email = metadata["authors"][0]["email"]
92-
copyright = f"2006-2022, {author_name} <{author_email}>"
95+
copyright = f"2006-2022, {authors['name']} <{authors['email']}>"
9396

9497
# The version info for the project you're documenting, acts as replacement for
9598
# |version| and |release|, also used in various other places throughout the
@@ -269,7 +272,7 @@
269272

270273

271274
# Example configuration for intersphinx: refer to the Python standard library.
272-
intersphinx_mapping = {'https://docs.python.org/': None}
275+
intersphinx_mapping = {'https://docs.python.org/3/': None}
273276

274277
# Config of plot_directive
275278
plot_include_source = True

doc/source/devel/biaps/biap_0003.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ The base level header will usually also have image metadata fields giving
199199
information about the whole image. A field is an "image metadata field" if it
200200
is defined at the top level of the header. For example::
201201

202-
>>> hdr = dict(nipy_header_version='1.0',
203-
... Manufacturer="SIEMENS")
202+
>>> hdr = dict(nipy_header_version='1.0',
203+
... Manufacturer="SIEMENS")
204204

205205
All image metadata fields are optional.
206206

@@ -635,7 +635,7 @@ Use case
635635
^^^^^^^^
636636

637637
When doing motion correction on a 4D image, we calculate the required affine
638-
transformation from |--| say |--| the second image to the first image; the
638+
transformation from, say, the second image to the first image; the
639639
third image to the first image; etc. If there are N volumes in the 4D image,
640640
we would need to store N-1 affine transformations. If we have registered to
641641
the mean volume of the volume series instead of one of the volumes in the

doc/source/devel/biaps/biap_0004.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ Improving access to varying meta data through the Nifti
221221

222222
Currently, when accessing varying meta data through the `get_meta` method
223223
you can only get one value at a time::
224+
224225
>>> echo_times = [nii.get_meta('EchoTime', (0, 0, 0, idx))
225226
for idx in xrange(data.shape[-1])]
226227

doc/source/devel/biaps/biap_0006.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ In NIfTI:
193193

194194
We saw above that the MGH format refers to a volume (in our sense) as a
195195
*frame*. ECAT has the same usage - a frame is a 3D volume. The fmristat
196-
software uses frame in the same sense |--| e.g. `line 32 of example.m
196+
software uses frame in the same sense, e.g., `line 32 of example.m
197197
<https://github.com/matthew-brett/fmristat/blob/master/fmristat/example.m#L32>`_.
198198

199199
Unfortunately DICOM appears to use "frame" to mean a 2D slice. For example,

doc/source/devel/devdiscuss.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ progress.
2222
spm_use
2323
modified_images
2424
data_pkg_design
25+
data_pkg_discuss
26+
data_pkg_uses
27+
scaling
28+
bv_formats

doc/source/devel/image_design.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:orphan:
2+
13
########################
24
The nibabel image object
35
########################

doc/source/installing_data.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:orphan:
2+
13
.. _installing-data:
24

35
Installing data packages

doc/source/old/ioimplementation.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.. -*- mode: rst -*-
22
3+
:orphan:
4+
35
##################################################
46
Relationship between images and io implementations
57
##################################################

0 commit comments

Comments
 (0)