Skip to content

Commit f77f33c

Browse files
stephprincerly
andauthored
Add internal link checking to sphinx-build (#1827)
* add zarr intersphinx mapping * fix space typos * update links in tutorials * add nitpicky mode to make files and workflow * fix docstring links * replace colons in docstrings for sphinx doc building * fix typo in docval inputs * update changelog * fix code blocks from italics in tutorials * move nitpicky configuration to conf.py file * revert Intracomm type string * convert italics to code blocks in tutorials * update nitpick_ignore to include BaseStorageSpec * raise nitpicky warnings as errors * Use hdmf 3.12.1 * fix broken link in tutorial --------- Co-authored-by: Ryan Ly <[email protected]>
1 parent 047c37d commit f77f33c

29 files changed

+88
-83
lines changed

.github/workflows/check_external_links.yml renamed to .github/workflows/check_sphinx_links.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Check Sphinx external links
1+
name: Check Sphinx links
22
on:
33
pull_request:
44
schedule:
55
- cron: '0 5 * * *' # once per day at midnight ET
66
workflow_dispatch:
77

88
jobs:
9-
check-external-links:
9+
check-sphinx-links:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Cancel non-latest runs
@@ -31,5 +31,5 @@ jobs:
3131
python -m pip install -r requirements-doc.txt
3232
python -m pip install .
3333
34-
- name: Check Sphinx external links
35-
run: sphinx-build -b linkcheck ./docs/source ./test_build
34+
- name: Check Sphinx internal and external links
35+
run: sphinx-build -W -b linkcheck ./docs/source ./test_build

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
### Documentation and tutorial enhancements
2323
- Add RemFile to streaming tutorial. @bendichter [#1761](https://github.com/NeurodataWithoutBorders/pynwb/pull/1761)
2424
- Fix typos and improve clarify throughout tutorials. @zm711 [#1825](https://github.com/NeurodataWithoutBorders/pynwb/pull/1825)
25+
- Fix internal links in docstrings and tutorials. @stephprince [#1827](https://github.com/NeurodataWithoutBorders/pynwb/pull/1827)
2526
- Add Zarr IO tutorial @bendichter [#1834](https://github.com/NeurodataWithoutBorders/pynwb/pull/1834)
2627

2728
## PyNWB 2.5.0 (August 18, 2023)

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ changes:
149149
@echo "The overview file is in $(BUILDDIR)/changes."
150150

151151
linkcheck:
152-
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
152+
$(SPHINXBUILD) -W -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
153153
@echo
154154
@echo "Link check complete; look for any errors in the above output " \
155155
"or in $(BUILDDIR)/linkcheck/output.txt."

docs/gallery/advanced_io/h5dataio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535

3636
####################
37-
# Normally if we create a :py:class:`~pynwb.file.TimeSeries` we would do
37+
# Normally if we create a :py:class:`~pynwb.base.TimeSeries` we would do
3838

3939
import numpy as np
4040

docs/gallery/advanced_io/plot_editing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
# Editing groups
130130
# --------------
131131
# Editing of groups is not yet supported in PyNWB.
132-
# To edit the attributes of a group, open the file and edit it using :py:mod:`h5py`:
132+
# To edit the attributes of a group, open the file and edit it using ``h5py``:
133133

134134
import h5py
135135

docs/gallery/domain/images.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
191191
#
192192
# :py:class:`~pynwb.image.RGBAImage` is for storing data of color image with transparency.
193-
# :py:attr:`~pynwb.image.RGBAImage.data` must be 3D where the first and second dimensions
193+
# ``RGBAImage.data`` must be 3D where the first and second dimensions
194194
# represent x and y. The third dimension has length 4 and represents the RGBA value.
195195
#
196196

@@ -208,7 +208,7 @@
208208
# ^^^^^^^^^^^^^^^^^^^^^^^^^^
209209
#
210210
# :py:class:`~pynwb.image.RGBImage` is for storing data of RGB color image.
211-
# :py:attr:`~pynwb.image.RGBImage.data` must be 3D where the first and second dimensions
211+
# ``RGBImage.data`` must be 3D where the first and second dimensions
212212
# represent x and y. The third dimension has length 3 and represents the RGB value.
213213
#
214214

@@ -224,8 +224,7 @@
224224
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
225225
#
226226
# :py:class:`~pynwb.image.GrayscaleImage` is for storing grayscale image data.
227-
# :py:attr:`~pynwb.image.GrayscaleImage.data` must be 2D where the first and second dimensions
228-
# represent x and y.
227+
# ``GrayscaleImage.data`` must be 2D where the first and second dimensions represent x and y.
229228
#
230229

231230
gs_logo = GrayscaleImage(
@@ -300,7 +299,7 @@
300299

301300
####################
302301
# Here `data` contains the (0-indexed) index of the displayed image as they are ordered
303-
# in the :py:class:`~pynwb.base.ImageReference`.
302+
# in the :py:class:`~pynwb.base.ImageReferences`.
304303
#
305304
# Writing the images to an NWB File
306305
# ---------------------------------------

docs/gallery/domain/ophys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@
540540
# Data arrays are read passively from the file.
541541
# Calling the data attribute on a :py:class:`~pynwb.base.TimeSeries`
542542
# such as a :py:class:`~pynwb.ophys.RoiResponseSeries` does not read the data
543-
# values, but presents an :py:class:`~h5py` object that can be indexed to read data.
543+
# values, but presents an ``h5py`` object that can be indexed to read data.
544544
# You can use the ``[:]`` operator to read the entire data array into memory.
545545
# Load and print all the data values of the :py:class:`~pynwb.ophys.RoiResponseSeries`
546546
# object representing the fluorescence data.
@@ -558,7 +558,7 @@
558558
#
559559
# It is often preferable to read only a portion of the data. To do this, index
560560
# or slice into the data attribute just like if you were indexing or slicing a
561-
# :py:class:`~numpy` array.
561+
# :py:mod:`numpy` array.
562562
#
563563
# The following code prints elements ``0:10`` in the first dimension (time)
564564
# and ``0:3`` (ROIs) in the second dimension from the fluorescence data we have written.

docs/gallery/domain/plot_icephys.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@
350350
#####################################################################
351351
# .. note:: Since :py:meth:`~pynwb.file.NWBFile.add_intracellular_recording` can automatically add
352352
# the objects to the NWBFile we do not need to separately call
353-
# :py:meth:`~pynwb.file.NWBFile.add_stimulus` and :py:meth:`~pynwb.file.NWBFile.add_acquistion`
353+
# :py:meth:`~pynwb.file.NWBFile.add_stimulus` and :py:meth:`~pynwb.file.NWBFile.add_acquisition`
354354
# to add our stimulus and response, but it is still fine to do so.
355355
#
356356
# .. note:: The ``id`` parameter in the call is optional and if the ``id`` is omitted then PyNWB will
@@ -495,8 +495,7 @@
495495
# .. note:: The same process applies to all our other tables as well. We can use the
496496
# corresponding :py:meth:`~pynwb.file.NWBFile.get_intracellular_recordings`,
497497
# :py:meth:`~pynwb.file.NWBFile.get_icephys_sequential_recordings`,
498-
# :py:meth:`~pynwb.file.NWBFile.get_icephys_repetitions`, and
499-
# :py:meth:`~pynwb.file.NWBFile.get_icephys_conditions` functions instead.
498+
# :py:meth:`~pynwb.file.NWBFile.get_icephys_repetitions` functions instead.
500499
# In general, we can always use the get functions instead of accessing the property
501500
# of the file.
502501
#
@@ -507,7 +506,7 @@
507506
#
508507
# Add a single simultaneous recording consisting of a set of intracellular recordings.
509508
# Again, setting the id for a simultaneous recording is optional. The recordings
510-
# argument of the :py:meth:`~pynwb.file.NWBFile.add_simultaneous_recording` function
509+
# argument of the :py:meth:`~pynwb.file.NWBFile.add_icephys_simultaneous_recording` function
511510
# here is simply a list of ints with the indices of the corresponding rows in
512511
# the :py:class:`~pynwb.icephys.IntracellularRecordingsTable`
513512
#
@@ -564,7 +563,7 @@
564563
# Add a single sequential recording consisting of a set of simultaneous recordings.
565564
# Again, setting the id for a sequential recording is optional. Also this table is
566565
# optional and will be created automatically by NWBFile. The ``simultaneous_recordings``
567-
# argument of the :py:meth:`~pynwb.file.NWBFile.add_sequential_recording` function
566+
# argument of the :py:meth:`~pynwb.file.NWBFile.add_icephys_sequential_recording` function
568567
# here is simply a list of ints with the indices of the corresponding rows in
569568
# the :py:class:`~pynwb.icephys.SimultaneousRecordingsTable`.
570569

@@ -579,7 +578,7 @@
579578
# Add a single repetition consisting of a set of sequential recordings. Again, setting
580579
# the id for a repetition is optional. Also this table is optional and will be created
581580
# automatically by NWBFile. The ``sequential_recordings argument`` of the
582-
# :py:meth:`~pynwb.file.NWBFile.add_sequential_recording` function here is simply
581+
# :py:meth:`~pynwb.file.NWBFile.add_icephys_repetition` function here is simply
583582
# a list of ints with the indices of the corresponding rows in
584583
# the :py:class:`~pynwb.icephys.SequentialRecordingsTable`.
585584

@@ -592,7 +591,7 @@
592591
# Add a single experimental condition consisting of a set of repetitions. Again,
593592
# setting the id for a condition is optional. Also this table is optional and
594593
# will be created automatically by NWBFile. The ``repetitions`` argument of
595-
# the :py:meth:`~pynwb.file.NWBFile.add_icephys_condition` function again is
594+
# the :py:meth:`~pynwb.file.NWBFile.add_icephys_experimental_condition` function again is
596595
# simply a list of ints with the indices of the correspondingto rows in the
597596
# :py:class:`~pynwb.icephys.RepetitionsTable`.
598597

docs/gallery/general/add_remove_containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
# have raw data and processed data in the same NWB file and you want to create a new NWB file with all the contents of
7979
# the original file except for the raw data for sharing with collaborators.
8080
#
81-
# To remove existing containers, use the :py:class:`~hdmf.utils.LabelledDict.pop` method on any
81+
# To remove existing containers, use the :py:meth:`~hdmf.utils.LabelledDict.pop` method on any
8282
# :py:class:`~hdmf.utils.LabelledDict` object, such as ``NWBFile.acquisition``, ``NWBFile.processing``,
8383
# ``NWBFile.analysis``, ``NWBFile.processing``, ``NWBFile.scratch``, ``NWBFile.devices``, ``NWBFile.stimulus``,
8484
# ``NWBFile.stimulus_template``, ``NWBFile.electrode_groups``, ``NWBFile.imaging_planes``,

docs/gallery/general/object_id.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
unique and used widely across computing platforms as if they are unique.
1111
1212
The object ID of an NWB container object can be accessed using the
13-
:py:meth:`~hdmf.container.AbstractContainer.object_id` method.
13+
:py:attr:`~hdmf.container.AbstractContainer.object_id` method.
1414
1515
.. _UUID: https://en.wikipedia.org/wiki/Universally_unique_identifier
1616

0 commit comments

Comments
 (0)