Skip to content

Commit 64d9b2f

Browse files
authored
Merge pull request #135 from QInfer/fix-sphinx-latex
Fix Sphinx LaTeX builds
2 parents 252ac03 + cb4074f commit 64d9b2f

File tree

5 files changed

+31
-21
lines changed

5 files changed

+31
-21
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ sudo: false
22
language: python
33
python:
44
- "2.7"
5-
- "3.3"
65
- "3.4"
76
- "3.5"
7+
- "3.6"
88

99
addons:
1010
apt:
@@ -18,6 +18,7 @@ addons:
1818
- texlive
1919
- texlive-latex-extra
2020
- texlive-fonts-extra
21+
- latexmk
2122

2223
# Explicitly add doctest support as separate parts of the build matrix,
2324
# since these tests require additional packages that should be optional.
@@ -79,7 +80,7 @@ script:
7980
- if [[ "${DOCTEST}" == "1" ]]; then
8081
cd $TRAVIS_BUILD_DIR/doc;
8182
make doctest;
82-
make latexpdf;
83+
make latexpdf LATEXOPTS="--interaction=nonstopmode";
8384
fi
8485

8586
after_success:

doc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ help:
2626
@echo " devhelp to make HTML files and a Devhelp project"
2727
@echo " epub to make an epub"
2828
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
29-
@echo " latexpdf to make LaTeX files and run them through pdflatex"
29+
@echo " latexpdf to make LaTeX files and run them through latexmk"
3030
@echo " text to make text files"
3131
@echo " man to make manual pages"
3232
@echo " changes to make an overview of all changed/added/deprecated items"
@@ -99,9 +99,9 @@ latex:
9999

100100
latexpdf:
101101
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
102-
@echo "Running LaTeX files through pdflatex..."
102+
@echo "Running LaTeX files through latexmk..."
103103
$(MAKE) -C $(BUILDDIR)/latex all-pdf
104-
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
104+
@echo "latexmk finished; the PDF files are in $(BUILDDIR)/latex."
105105

106106
text:
107107
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text

doc/source/conf.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,17 @@
6666
\let\footnotesize\small
6767
\let\footnoterule\relax
6868
\rule{\textwidth}{1pt}%
69-
\ifsphinxpdfoutput
70-
\begingroup
71-
% These \defs are required to deal with multi-line authors; it
72-
% changes \\ to ', ' (comma-space), making it pass muster for
73-
% generating document info in the PDF file.
74-
\def\\{, }
75-
\def\and{and }
76-
\pdfinfo{
77-
/Author (\@author)
78-
/Title (\@title)
79-
}
80-
\endgroup
81-
\fi
69+
\begingroup
70+
% These \defs are required to deal with multi-line authors; it
71+
% changes \\ to ', ' (comma-space), making it pass muster for
72+
% generating document info in the PDF file.
73+
\def\\{, }
74+
\def\and{and }
75+
\pdfinfo{
76+
/Author (\@author)
77+
/Title (\@title)
78+
}
79+
\endgroup
8280
\begin{flushright}%
8381
\sphinxlogo%
8482
{\rm\Huge\py@HeaderFamily \@title \par}%
@@ -298,6 +296,11 @@
298296

299297
# Additional stuff for the LaTeX preamble.
300298
latex_preamble = preamble
299+
# In Sphinx 1.5, this now appears as latex_elements, so we pack the
300+
# preamble that way, too.
301+
latex_elements = {
302+
'preamble': preamble
303+
}
301304

302305
# Documents to append as an appendix to all manuals.
303306
#latex_appendices = []

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ def write_version(filename=VERSION_TARGET):
7171
'Natural Language :: English',
7272
'Operating System :: OS Independent',
7373
'Programming Language :: Python :: 2.7',
74-
'Programming Language :: Python :: 3.3',
7574
'Programming Language :: Python :: 3.4',
75+
'Programming Language :: Python :: 3.5',
76+
'Programming Language :: Python :: 3.6',
7677
'Programming Language :: Python :: Implementation :: CPython',
7778
'Topic :: Scientific/Engineering :: Physics',
7879
],

src/qinfer/test_models.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,13 @@ def score(self, outcomes, modelparams, expparams, return_L=False):
198198
new_eps['w_'] = 0
199199
new_eps['t'] = expparams
200200

201-
return super(SimplePrecessionModel, self).score(outcomes, modelparams, new_eps, return_L)
202-
201+
q = super(SimplePrecessionModel, self).score(outcomes, modelparams, new_eps, return_L=False)
202+
203+
if return_L:
204+
return q, self.likelihood(outcomes, modelparams, expparams)
205+
else:
206+
return q
207+
203208
class CoinModel(FiniteOutcomeModel, DifferentiableModel):
204209
r"""
205210
Arguably the simplest possible model; the unknown model parameter

0 commit comments

Comments
 (0)