-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
104 changed files
with
4,431 additions
and
13,066 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
# Directories to ignore: | ||
|
||
*.ipynb_checkpoints/ | ||
data/ | ||
docs/build/ | ||
docs/site/ | ||
docs/src/examples/ | ||
input/ | ||
output/ | ||
|
||
# Files to ignore: | ||
|
||
.DS_Store | ||
*.aux | ||
*.ipynb_checkpoints/ | ||
*.jl.*.cov | ||
*.jl.cov | ||
*.jl.*.cov | ||
*.jl.mem | ||
*.log | ||
data/ | ||
deps/custom_preamble.tex | ||
deps/deps.jl | ||
deps/pdf2svg.svg | ||
deps/showed_warning | ||
docs/build | ||
input/ | ||
output/ | ||
scratch.jl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,49 @@ | ||
## Documentation: http://docs.travis-ci.com/user/languages/julia/ | ||
language: julia | ||
|
||
os: | ||
- linux | ||
- osx | ||
- linux | ||
- osx | ||
|
||
julia: | ||
- 0.6 | ||
# - nightly | ||
- 0.6 | ||
- nightly | ||
|
||
notifications: | ||
email: false | ||
email: false | ||
|
||
git: | ||
depth: 99999999 | ||
depth: 99999999 | ||
|
||
## Allow failures on nightly julia: | ||
matrix: | ||
allow_failures: | ||
- julia: nightly | ||
allow_failures: | ||
- julia: nightly | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- gfortran | ||
- pdf2svg | ||
- pgf | ||
- poppler-utils # provides /usr/bin/pdftoppm | ||
- texlive-binaries | ||
- texlive-latex-base | ||
- texlive-latex-extra | ||
- texlive-pictures | ||
apt: | ||
packages: | ||
- gfortran | ||
- pdf2svg | ||
- pgf | ||
- poppler-utils | ||
- texlive-binaries | ||
- texlive-latex-base | ||
- texlive-latex-extra | ||
- texlive-pictures | ||
|
||
before_install: | ||
# update homebrew | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi | ||
# install mactex | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask install basictex; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=/Library/TeX/texbin:"$PATH"; fi | ||
# update tlmgr | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo tlmgr update --self; fi | ||
# install tex packages | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo tlmgr install luatex85; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo tlmgr install pgfplots; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo tlmgr install standalone; fi | ||
# install pdf2svg | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install pdf2svg; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask install basictex; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=/Library/TeX/texbin:"$PATH"; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo tlmgr update --self; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo tlmgr install luatex85; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo tlmgr install pgfplots; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo tlmgr install standalone; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install pdf2svg; fi | ||
|
||
script: | ||
- julia --color=yes -e 'Pkg.clone(pwd())' | ||
- julia --color=yes -e 'Pkg.build("PredictMD")' | ||
- julia --check-bounds=yes --color=yes -e 'Pkg.test("PredictMD", coverage=true)' | ||
|
||
after_success: | ||
- julia -e 'cd(Pkg.dir("PredictMD")); include(joinpath("docs", "deploy_docs.jl"))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,6 @@ This document provides information on contributing to the PredictMD source code. | |
</tr> | ||
<tr> | ||
<td align="left"><a href="#2-setting-up-the-predictmd-repo">2. Setting up the PredictMD repo</a></td> | ||
</tr> | ||
<tr> | ||
<td align="left"><a href="#3-working-with-examples">3. Working with examples</a></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
@@ -156,41 +153,3 @@ cd ~/.julia/v0.6/PredictMD | |
```bash | ||
git config commit.gpgsign true && git remote set-url origin https://github.com/bcbi/PredictMD.jl.git && git remote set-url --push origin [email protected]:bcbi/PredictMD.jl.git && git checkout master && git checkout develop && git flow init -fd && git checkout develop && git fetch --all --prune | ||
``` | ||
|
||
## 3. Working with examples | ||
|
||
Some of the examples are provided as Jupyter notebooks as a convinient way to visualize and interact with the code. However, we also like to mantain corresponding plain Julia scripts that are in-sync with the notebooks. A convinient way to do so, is to add a post-save hook to your Jupyter configuration file. | ||
|
||
1. Open you jupyter configuration file ~/.jupyter/jupyter_notebook_config.py. If the file does not exist you can generate it by running `jupyter notebook --generate-config` | ||
|
||
2. Add the following code to the top of the file | ||
|
||
```python | ||
#----------------------------------------------------------------------------- | ||
# Auto save script version of notebook | ||
# Reference: https://svds.com/jupyter-notebook-best-practices-for-data-science/ | ||
#----------------------------------------------------------------------------- | ||
|
||
import os | ||
from subprocess import check_call | ||
|
||
def post_save(model, os_path, contents_manager): | ||
"""post-save hook for converting notebooks to .py scripts""" | ||
if model['type'] != 'notebook': | ||
return # only do this for notebooks | ||
d, fname = os.path.split(os_path) | ||
check_call(['jupyter', 'nbconvert', '--to', 'script', fname], cwd=d) | ||
|
||
c.FileContentsManager.post_save_hook = post_save | ||
``` | ||
|
||
**Note:** This behavior is global. If you want to have this saving only when in a particular folder, you can create multiple configuration files as a work-around. First create a new profile name via a bash command line: | ||
```bash | ||
export JUPYTER_CONFIG_DIR=~/.jupyter_profile2 | ||
jupyter notebook --generate-config | ||
``` | ||
This will create a new directory and file at `~/.jupyter_profile2/jupyter_notebook_config.py` Then run jupyter notebook and work as usual. To switch back to your default profile you will have to set (either by hand, shell function, or your .bashrc) back to: | ||
|
||
```bash | ||
export JUPYTER_CONFIG_DIR=~/.jupyter | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Documenter | ||
import PredictMD | ||
|
||
ENV["PREDICTMD_IS_DEPLOY_DOCS"] = "true" | ||
|
||
Documenter.deploydocs( | ||
branch = "gh-pages", | ||
deps = Documenter.Deps.pip( | ||
"mkdocs", | ||
"pygments", | ||
"python-markdown-math", | ||
), | ||
julia = "0.6", | ||
latest = "develop", | ||
osname = "linux", | ||
repo = "github.com/bcbi/PredictMD.jl.git", | ||
target = "site", | ||
) | ||
|
||
ENV["PREDICTMD_IS_DEPLOY_DOCS"] = "false" |
Oops, something went wrong.