Skip to content

Commit a33a2af

Browse files
committed
Merge remote-tracking branch 'upstream/master' into ResourceWarning_unclosed_file
2 parents 07e25d0 + d0e6363 commit a33a2af

File tree

226 files changed

+9933
-8625
lines changed

Some content is hidden

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

226 files changed

+9933
-8625
lines changed

.git-blame-ignore-revs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Thu Dec 29 22:53:17 2022 -0500 - [email protected] - STY: Reduce array().astype() and similar constructs
2+
bf298113da99079c9c7b5e1690e41879828cd472
3+
# Thu Dec 29 22:32:46 2022 -0500 - [email protected] - STY: pyupgrade --py37-plus
4+
4481a4c2640bd4be6e9c468e550d01aae448ab99
5+
# Fri Dec 30 11:01:19 2022 -0500 - [email protected] - STY: Run vanilla blue
6+
6b0ddd23b1da1df7ca9ae275673f82bfa20a754c
7+
# Thu Dec 29 21:46:13 2022 -0500 - [email protected] - STY: Manual, blue-compatible touchups
8+
263fca9bf6d4ca314a5a322b4824d6f53d0589df
9+
# Thu Dec 29 21:32:00 2022 -0500 - [email protected] - STY: isort
10+
0ab2856cac4d4baae7ab3e2f6d58421db55d807f
11+
# Thu Dec 29 21:30:29 2022 -0500 - [email protected] - STY: blue
12+
1a8dd302ff85b1136c81d492509b80e7748339f0

.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:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Thumbs.db
8383
# Things specific to this project #
8484
###################################
8585
doc/source/reference
86+
doc/source/generated
8687
venv/
8788
.buildbot.patch
8889
.vscode

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ distclean: clean
7878
$(WWW_DIR):
7979
if [ ! -d $(WWW_DIR) ]; then mkdir -p $(WWW_DIR); fi
8080

81+
.git-blame-ignore-revs:
82+
git log --grep "\[git-blame-ignore-rev\]" --pretty=format:"# %ad - %ae - %s%n%H" \
83+
> .git-blame-ignore-revs
8184

8285
#
8386
# Tests
@@ -288,4 +291,4 @@ rm-orig:
288291
# Remove .orig temporary diff files generated by git
289292
find . -name "*.orig" -print | grep -v "fsaverage" | xargs rm
290293

291-
.PHONY: orig-src pylint all build
294+
.PHONY: orig-src pylint all build .git-blame-ignore-revs

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: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@
1919
# All configuration values have a default; values that are commented out
2020
# serve to show the default.
2121

22-
import sys
2322
import os
23+
from pathlib import Path
2424
from runpy import run_path
25-
from configparser import ConfigParser
25+
26+
try:
27+
import tomllib
28+
except ImportError:
29+
import tomli as tomllib
2630

2731
# Check for external Sphinx extensions we depend on
2832
try:
@@ -41,11 +45,6 @@
4145
raise RuntimeError('Need nibabel on Python PATH; consider "make htmldoc" '
4246
'from nibabel root directory')
4347

44-
# If extensions (or modules to document with autodoc) are in another directory,
45-
# add these directories to sys.path here. If the directory is relative to the
46-
# documentation root, use os.path.abspath to make it absolute, like shown here.
47-
# sys.path.append(os.path.abspath('../sphinxext'))
48-
4948
# -- General configuration ----------------------------------------------------
5049

5150
# We load the nibabel release info into a dict by explicit execution
@@ -56,15 +55,15 @@
5655
fobj.write(rel['long_description'])
5756

5857
# Load metadata from setup.cfg
59-
config = ConfigParser()
60-
config.read(os.path.join('..', '..', 'setup.cfg'))
61-
metadata = config['metadata']
58+
with open(Path("../../pyproject.toml"), 'rb') as fobj:
59+
pyproject = tomllib.load(fobj)
60+
authors = pyproject["project"]["authors"][0]
6261

6362
# Add any Sphinx extension module names here, as strings. They can be
6463
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
6564
extensions = ['sphinx.ext.autodoc',
6665
'sphinx.ext.doctest',
67-
#'sphinx.ext.intersphinx',
66+
'sphinx.ext.intersphinx',
6867
'sphinx.ext.todo',
6968
'sphinx.ext.mathjax',
7069
'sphinx.ext.inheritance_diagram',
@@ -74,9 +73,10 @@
7473
'matplotlib.sphinxext.plot_directive',
7574
]
7675

77-
# the following doesn't work with sphinx < 1.0, but will make a separate
78-
# sphinx-autogen run obsolete in the future
79-
#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
8080

8181
# Add any paths that contain templates here, relative to this directory.
8282
templates_path = ['_templates']
@@ -92,7 +92,7 @@
9292

9393
# General information about the project.
9494
project = u'NiBabel'
95-
copyright = f"2006-2022, {metadata['maintainer']} <{metadata['author_email']}>"
95+
copyright = f"2006-2022, {authors['name']} <{authors['email']}>"
9696

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

273273

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

277277
# Config of plot_directive
278278
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

0 commit comments

Comments
 (0)