Skip to content

Commit fa090b2

Browse files
committed
Merge pull request #165 from dsten/sam-tutorial
Tutorial
2 parents 4f688cf + 88d21e1 commit fa090b2

File tree

6 files changed

+419
-12
lines changed

6 files changed

+419
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ cache/
6161

6262
docs/_build/
6363
docs/_autosummary/
64+
docs/normal_data.csv

.travis.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ addons:
2626
before_install:
2727
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
2828
- chmod +x miniconda.sh
29-
- ./miniconda.sh -b -p $HOME/miniconda
29+
- ./miniconda.sh -b -f -p $HOME/miniconda
3030
- export PATH=/home/travis/miniconda/bin:$PATH
3131
- conda update --yes conda
3232

@@ -35,14 +35,18 @@ install:
3535
# TODO(sam): Add --upgrade flag when it works again
3636
- python3 setup.py install
3737

38+
# https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
39+
# sam: Not exactly sure why we need to initialize a display for this but it
40+
# helps the tutorial plots build on Travis
41+
before_script:
42+
- "export DISPLAY=:99.0"
43+
- "sh -e /etc/init.d/xvfb start"
44+
- sleep 3 # give xvfb some time to start
45+
3846
script:
3947
- coverage run setup.py test
40-
- cd docs && make html-raise-on-warning && cd ..
48+
- make docs
4149

4250
after_success:
4351
- coveralls
4452
- bash tools/deploy_docs.sh
45-
46-
cache:
47-
directories:
48-
- /home/travis/virtualenv/python3.4.2/

docs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ clean:
5252
rm -rf $(BUILDDIR)/*
5353

5454
html:
55+
mkdir -p $(BUILDDIR)/html/_images
5556
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
5657
@echo
5758
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
5859

5960
html-raise-on-warning:
61+
mkdir -p $(BUILDDIR)/html/_images
6062
$(SPHINXBUILD) -W -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
6163

6264
dirhtml:

docs/conf.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@
3535
'sphinx.ext.autodoc',
3636
'sphinx.ext.autosummary',
3737
'sphinx.ext.viewcode',
38+
# These IPython extensions allow for embedded IPython code that gets rerun
39+
# at build time.
40+
'IPython.sphinxext.ipython_console_highlighting',
41+
'IPython.sphinxext.ipython_directive'
42+
]
43+
44+
# The following lines silence the matplotlib.use warnings since we import
45+
# matplotlib in each ipython directive block
46+
ipython_mplbackend = None
47+
ipython_execlines = [
48+
'import matplotlib',
49+
'matplotlib.use("Agg", warn=False)',
50+
'import numpy as np',
51+
'import matplotlib.pyplot as plt',
52+
'plt.style.use("fivethirtyeight")',
3853
]
3954

4055
# Config autosummary
@@ -147,6 +162,7 @@
147162
# relative to this directory. They are copied after the builtin static files,
148163
# so a file named "default.css" will overwrite the builtin "default.css".
149164
html_static_path = []
165+
ipython_savefig_dir = './_build/html/_images'
150166

151167
# Add any extra paths that contain custom files (such as robots.txt or
152168
# .htaccess) here, relative to this directory. These files are copied

docs/sample.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
x,y,z
2+
1,10,100
3+
2,11,101
4+
3,12,102

0 commit comments

Comments
 (0)