From e17a142ed47abe9eed104476882d77d2c4046b33 Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Fri, 7 Jun 2019 11:07:00 -0700 Subject: [PATCH] DOC: Fix readthedocs build (#419) readthedocs was broken by directory restructuring and because the environment spec was deleted. Also moving renaming the bibtex files so the citations are picked up on the first try. --- doc/source/bibtex/{app.bib => zapp.bib} | 0 doc/source/bibtex/{cite.bib => zcite.bib} | 0 doc/source/bibtex/{ref.bib => zref.bib} | 0 doc/source/conf.py | 7 +++---- doc/source/credits.rst | 8 ++++---- doc/source/gpu.rst | 2 +- envs/requirements-doc.txt | 6 ++++++ source/tomopy/misc/morph.py | 4 ++-- 8 files changed, 16 insertions(+), 11 deletions(-) rename doc/source/bibtex/{app.bib => zapp.bib} (100%) rename doc/source/bibtex/{cite.bib => zcite.bib} (100%) rename doc/source/bibtex/{ref.bib => zref.bib} (100%) create mode 100644 envs/requirements-doc.txt diff --git a/doc/source/bibtex/app.bib b/doc/source/bibtex/zapp.bib similarity index 100% rename from doc/source/bibtex/app.bib rename to doc/source/bibtex/zapp.bib diff --git a/doc/source/bibtex/cite.bib b/doc/source/bibtex/zcite.bib similarity index 100% rename from doc/source/bibtex/cite.bib rename to doc/source/bibtex/zcite.bib diff --git a/doc/source/bibtex/ref.bib b/doc/source/bibtex/zref.bib similarity index 100% rename from doc/source/bibtex/ref.bib rename to doc/source/bibtex/zref.bib diff --git a/doc/source/conf.py b/doc/source/conf.py index 5226bb799..e1d784f44 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -19,7 +19,7 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('../..')) +sys.path.insert(0, os.path.abspath('../../source')) # -- General configuration ------------------------------------------------ @@ -77,9 +77,9 @@ # built documents. # # The short X.Y version. -version = open(os.path.join('..', '..', 'VERSION')).read().strip() +# version = open(os.path.join('..', '..', 'VERSION')).read().strip() # The full version, including alpha/beta/rc tags. -release = version +# release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -301,4 +301,3 @@ # http://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_mock_imports autodoc_mock_imports = "numpy scipy matplotlib tifffile pywt skimage DM3lib pyfftw numexpr concurrent libtomopy".split() - diff --git a/doc/source/credits.rst b/doc/source/credits.rst index d7dfdc28f..2b7c878ef 100644 --- a/doc/source/credits.rst +++ b/doc/source/credits.rst @@ -4,17 +4,17 @@ Credits We kindly request that you cite the following article(s) :cite:`Gursoy:14a` if you use TomoPy (and also cite :cite:`Pelt:16a` if you use ASTRA or -:cite:`Vogelgesang:12` if you use UFO). For vector reconstructions please +:cite:`Vogelgesang:12` if you use UFO). For vector reconstructions please additionally cite :cite:`Hierro-Rodriguez:18`. -.. bibliography:: bibtex/cite.bib +.. bibliography:: bibtex/zcite.bib :style: unsrt :labelprefix: A Applications ============ -.. bibliography:: bibtex/app.bib +.. bibliography:: bibtex/zapp.bib :style: plain :labelprefix: B :all: @@ -22,7 +22,7 @@ Applications References ========== -.. bibliography:: bibtex/ref.bib +.. bibliography:: bibtex/zref.bib :style: plain :labelprefix: C :all: diff --git a/doc/source/gpu.rst b/doc/source/gpu.rst index b36f14cee..54bd075d0 100644 --- a/doc/source/gpu.rst +++ b/doc/source/gpu.rst @@ -39,7 +39,7 @@ a factor of 90 degrees: .. code-block:: python - obj = tomopy.misc.phantom("shepp2d") + obj = tomopy.shepp2d() obj = tomopy.misc.morph.pad(obj, axis=1, mode='constant') obj = tomopy.misc.morph.pad(obj, axis=2, mode='constant') diff --git a/envs/requirements-doc.txt b/envs/requirements-doc.txt new file mode 100644 index 000000000..0fe2b9a94 --- /dev/null +++ b/envs/requirements-doc.txt @@ -0,0 +1,6 @@ +sphinx +sphinx_rtd_theme +sphinxcontrib-bibtex +nbsphinx +pandoc +jupyter diff --git a/source/tomopy/misc/morph.py b/source/tomopy/misc/morph.py index ca40d9fff..4420e02b7 100644 --- a/source/tomopy/misc/morph.py +++ b/source/tomopy/misc/morph.py @@ -85,10 +85,10 @@ def pad(arr, axis, npad=None, mode='constant', ncore=None, **kwargs): ---------- arr : ndarray Input array. + axis : int + Axis along which padding will be performed. npad : int, optional New dimension after padding. - axis : int, optional - Axis along which padding will be performed. mode : str or function One of the following string values or a user supplied function.