Skip to content

Commit

Permalink
Add example notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
goerz committed Dec 2, 2018
1 parent 766024c commit 96c5a22
Show file tree
Hide file tree
Showing 5 changed files with 505 additions and 33 deletions.
5 changes: 2 additions & 3 deletions .appveyor.yml
Expand Up @@ -5,17 +5,16 @@ environment:
MINICONDA: C:\Miniconda3
- PYTHON_VERSION: 3.6
MINICONDA: C:\Miniconda3
- PYTHON_VERSION: 3.7
MINICONDA: C:\Miniconda3

install:
- "%MINICONDA%\\Scripts\\activate"
- conda config --set always_yes yes
- conda create -q -n test_env python=%PYTHON_VERSION%
- conda create -q -n test_env python=%PYTHON_VERSION%
- activate test_env
- echo CONDA_PREFIX %CONDA_PREFIX%
- echo PATH %PATH%
- conda config --append channels conda-forge
- conda install qutip
- pip install .[dev]
- pip freeze

Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -19,6 +19,7 @@ install:
- conda create -q -n test_env python=$TRAVIS_PYTHON_VERSION
- conda activate test_env
- conda config --append channels conda-forge
- conda install qutip
- pip install -e .[dev]
- pip freeze
- pip install coveralls
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -85,7 +85,7 @@ test36: .venv/py36/bin/py.test ## run tests for Python 3.6
@.venv/py37/bin/pip install -e .[dev]

test37: .venv/py37/bin/py.test ## run tests for Python 3.7
$(TESTENV) $< -v $(TESTOPTIONS) $(TESTS)
$(TESTENV) $< -v $(TESTOPTIONS) src tests docs/*.rst
.venv/py37/bin/sphinx-build: .venv/py37/bin/py.test

docs: .venv/py36/bin/sphinx-build ## generate Sphinx HTML documentation, including API docs
Expand Down Expand Up @@ -134,7 +134,7 @@ develop-docs: develop ## generate Sphinx HTML documentation, including API docs
# How to execute notebook files
%.ipynb.log: %.ipynb .venv/py36/bin/jupyter
@echo ""
@.venv/py36/bin/jupyter nbconvert --to notebook --execute --inplace --allow-errors --ExecutePreprocessor.kernel_name='python3' --config=/dev/null $< 2>&1 | tee $@
@.venv/py36/bin/jupyter nbconvert --to notebook --execute --inplace --allow-errors --ExecutePreprocessor.timeout=300 --ExecutePreprocessor.kernel_name='python3' --config=/dev/null $< 2>&1 | tee $@

NOTEBOOKFILES = $(shell find docs/ -iname '*.ipynb' -maxdepth 1)
NOTEBOOKLOGS = $(patsubst %.ipynb,%.ipynb.log,$(NOTEBOOKFILES))
Expand Down
524 changes: 496 additions & 28 deletions docs/example.ipynb

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/nbval_sanitize.cfg
Expand Up @@ -13,3 +13,7 @@ replace: TIME-STAMP
[regex4]
regex: id='[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'>
replace: id='JUPYTERID'

[regex5]
regex: .*per loop .mean .* std. dev. of \d+ runs, \d+ loops? each.*
replace: TIMEIT-result

0 comments on commit 96c5a22

Please sign in to comment.