Skip to content

Commit 9b4d7b2

Browse files
committed
Merge branch 'release/v0.11.0'
2 parents 04f544c + 2f73930 commit 9b4d7b2

File tree

84 files changed

+10648
-1190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+10648
-1190
lines changed

.gitignore

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
*.jl.cov
1+
.DS_Store
2+
*.aux
3+
*.ipynb_checkpoints/
24
*.jl.*.cov
5+
*.jl.cov
36
*.jl.mem
4-
deps/deps.jl
5-
6-
.DS_Store
7-
7+
*.log
88
data/
9+
deps/custom_preamble.tex
10+
deps/deps.jl
11+
deps/pdf2svg.svg
12+
deps/showed_warning
13+
docs/build
914
input/
1015
output/
16+
scratch.jl

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ addons:
2222
- gfortran
2323
- pdf2svg
2424
- pgf
25+
- poppler-utils # provides /usr/bin/pdftoppm
2526
- texlive-binaries
2627
- texlive-latex-base
2728
- texlive-latex-extra

CONTRIBUTING.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to AluthgeSinhaBase
1+
# Contributing to PredictMD
22

3-
This document provides information on contributing to the AluthgeSinhaBase source code. For information on installing and using AluthgeSinhaBase, please see [README.md](README.md).
3+
This document provides information on contributing to the PredictMD source code. For information on installing and using PredictMD, please see [README.md](README.md).
44

55
<table>
66
<thead>
@@ -13,7 +13,10 @@ This document provides information on contributing to the AluthgeSinhaBase sourc
1313
<td align="left"><a href="#1-prerequisites">1. Prerequisites</a></td>
1414
</tr>
1515
<tr>
16-
<td align="left"><a href="#2-setting-up-the-aluthgesinhabase-repo">2. Setting up the AluthgeSinhaBase repo</a></td>
16+
<td align="left"><a href="#2-setting-up-the-predictmd-repo">2. Setting up the PredictMD repo</a></td>
17+
</tr>
18+
<tr>
19+
<td align="left"><a href="#3-working-with-examples">3. Working with examples</a></td>
1720
</tr>
1821
</tbody>
1922
</table>
@@ -136,20 +139,58 @@ If you do, then go to Step 2. If you instead see an error, download and install
136139
4. [https://help.github.com/articles/telling-git-about-your-gpg-key/](https://help.github.com/articles/telling-git-about-your-gpg-key/)
137140
5. [https://help.github.com/articles/associating-an-email-with-your-gpg-key/](https://help.github.com/articles/associating-an-email-with-your-gpg-key/)
138141

139-
## 2. Setting up the AluthgeSinhaBase repo
142+
## 2. Setting up the PredictMD repo
140143

141144
**Step 1:** Make sure that you have followed all of the instructions in [Section 1 (Prerequisites)](#1-prerequisites).
142145

143-
**Step 2:** Follow the installation instructions in [README.md](README.md) to install AluthgeSinhaBase.
146+
**Step 2:** Follow the installation instructions in [README.md](README.md) to install PredictMD.
144147

145-
**Step 3:** Open a terminal window and `cd` to the directory containing the AluthgeSinhaBase source code:
148+
**Step 3:** Open a terminal window and `cd` to the directory containing the PredictMD source code:
146149

147150
```bash
148-
cd ~/.julia/v0.6/AluthgeSinhaBase
151+
cd ~/.julia/v0.6/PredictMD
149152
```
150153

151154
**Step 4:** Run the following line:
152155

153156
```bash
154-
git config commit.gpgsign true && git checkout master && git checkout develop && git flow init -fd && git checkout develop
157+
git config commit.gpgsign true && git remote set-url origin https://github.com/bcbi/PredictMD.jl.git && git remote set-url --push origin git@github.com:bcbi/PredictMD.jl.git && git checkout master && git checkout develop && git flow init -fd && git checkout develop && git fetch --all --prune
158+
```
159+
160+
## 3. Working with examples
161+
162+
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.
163+
164+
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`
165+
166+
2. Add the following code to the top of the file
167+
168+
```python
169+
#-----------------------------------------------------------------------------
170+
# Auto save script version of notebook
171+
# Reference: https://svds.com/jupyter-notebook-best-practices-for-data-science/
172+
#-----------------------------------------------------------------------------
173+
174+
import os
175+
from subprocess import check_call
176+
177+
def post_save(model, os_path, contents_manager):
178+
"""post-save hook for converting notebooks to .py scripts"""
179+
if model['type'] != 'notebook':
180+
return # only do this for notebooks
181+
d, fname = os.path.split(os_path)
182+
check_call(['jupyter', 'nbconvert', '--to', 'script', fname], cwd=d)
183+
184+
c.FileContentsManager.post_save_hook = post_save
185+
```
186+
187+
**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:
188+
```bash
189+
export JUPYTER_CONFIG_DIR=~/.jupyter_profile2
190+
jupyter notebook --generate-config
191+
```
192+
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:
193+
194+
```bash
195+
export JUPYTER_CONFIG_DIR=~/.jupyter
155196
```

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AluthgeSinhaBase.jl
1+
# PredictMD.jl
22

33
<table>
44
<thead>
@@ -9,13 +9,13 @@
99
</thead>
1010
<tbody>
1111
<tr>
12-
<td><a href="https://travis-ci.com/DilumAluthge/AluthgeSinhaBase.jl/branches"><img alt="Build Status (master)" title="Build Status (master)" src="https://travis-ci.com/DilumAluthge/AluthgeSinhaBase.jl.svg?token=dMqeEKHqcnWSXz982pdf&branch=master"></a></td>
13-
<td><a href="https://travis-ci.com/DilumAluthge/AluthgeSinhaBase.jl/branches"><img alt="Build Status (develop)" title="Build Status (develop)" src="https://travis-ci.com/DilumAluthge/AluthgeSinhaBase.jl.svg?token=dMqeEKHqcnWSXz982pdf&branch=develop"></a></td>
12+
<td><a href="https://travis-ci.org/bcbi/PredictMD.jl/branches"><img alt="Build Status (master)" title="Build Status (master)" src="https://travis-ci.org/bcbi/PredictMD.jl.svg?branch=master"></a></td>
13+
<td><a href="https://travis-ci.org/bcbi/PredictMD.jl/branches"><img alt="Build Status (develop)" title="Build Status (develop)" src="https://travis-ci.org/bcbi/PredictMD.jl.svg?branch=develop"></a></td>
1414
</tr>
1515
</tbody>
1616
</table>
1717

18-
AluthgeSinhaBase is a [Julia](https://julialang.org/) package that provides a uniform interface for using multiple different statistics and machine learning packages. This document describes how to install and use AluthgeSinhaBase.
18+
PredictMD is a [Julia](https://julialang.org/) package that provides a uniform interface for using multiple different statistics and machine learning packages. This document describes how to install and use PredictMD.
1919

2020
<table>
2121
<thead>
@@ -41,7 +41,7 @@ AluthgeSinhaBase is a [Julia](https://julialang.org/) package that provides a un
4141

4242
## 1. Prerequisites
4343

44-
In order to run AluthgeSinhaBase, you need to have all of the following software packages installed on your system:
44+
In order to run PredictMD, you need to have all of the following software packages installed on your system:
4545
* Julia (version >= 0.6)
4646
* LaTeX
4747
* pdf2svg.
@@ -112,20 +112,19 @@ If you receive an error (e.g. "command not found"), download and install pdf2svg
112112

113113
**Step 3:** Paste the following line into Julia and press enter:
114114
```julia
115-
Pkg.update();Pkg.clone("git@github.com:dilumaluthge/AluthgeSinhaBase.jl.git");Pkg.checkout("AluthgeSinhaBase", "master");Pkg.test("AluthgeSinhaBase");
115+
Pkg.update();Pkg.clone("https://github.com/bcbi/PredictMD.jl.git");Pkg.checkout("PredictMD", "master");Pkg.test("PredictMD");
116116
```
117-
118117
You will need to wait several minutes while all of the required packages are installed and all of the tests are run.
119118

120-
If you receive the message "INFO: AluthgeSinhaBase tests passed", then you have successfully installed AluthgeSinhaBase. If the tests do not pass or if you see an error message, then do the following:
119+
If you receive the message "INFO: PredictMD tests passed", then you have successfully installed PredictMD. If the tests do not pass or if you see an error message, then do the following:
121120
1. Close your Julia session (e.g. type ```quit()``` and press enter).
122121
2. Open a new terminal window, type ```mv ~/.julia ~/.julia.backup-$(date +"%Y%m%d-%H%M%S")```, and press enter.
123122
3. Repeat Steps 2 and 3 above.
124123

125-
If the tests still do not pass or if you still receive an error message, go to [https://github.com/dilumaluthge/AluthgeSinhaBase.jl/issues/new](https://github.com/dilumaluthge/AluthgeSinhaBase.jl/issues/new) and submit a new issue. Please include a screenshot of the error.
124+
If the tests still do not pass or if you still receive an error message, go to [https://github.com/bcbi/PredictMD.jl/issues/new](https://github.com/bcbi/PredictMD.jl/issues/new) and submit a new issue. Please include a screenshot of the error.
126125

127126
## 3. Examples
128-
The `examples/` folder contains several files that illustrate the usage of AluthgeSinhaBase:
127+
The `examples/` folder contains several files that illustrate the usage of PredictMD:
129128

130129
### 3.1. Machine Learning Examples
131130

@@ -156,4 +155,4 @@ The `examples/` folder contains several files that illustrate the usage of Aluth
156155

157156
## 4. Contributing
158157

159-
If you would like to contribute to the AluthgeSinhaBase source code, please see [CONTRIBUTING.md](CONTRIBUTING.md).
158+
If you would like to contribute to the PredictMD source code, please see [CONTRIBUTING.md](CONTRIBUTING.md).

REQUIRE

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,30 @@
11
julia 0.6
22

3-
Adapt 0.2
4-
ArgCheck 0.4
5-
ArgParse 0.5
6-
ArrayFire 0.1
73
Atom 0.6
8-
AutoGrad 0.0.10
9-
BenchmarkTools 0.2
10-
BioMedQuery 0.3
11-
Blink 0.6
12-
CLArrays 0.1
134
CSV 0.2
14-
CUDAapi
15-
CUDAdrv
16-
CUDAnative
17-
CUDNN
18-
CategoricalArrays 0.3
195
ClassImbalance 0.2
20-
Clustering 0.9
21-
ColorBrewer 0.3
22-
ColorSchemes 1.5
23-
ColorTypes 0.6
24-
Colors 0.8
25-
CuArrays 0.4
26-
DataFlow 0.3
6+
Crayons 0.4
277
DataFrames 0.11
28-
DataFramesMeta 0.3
29-
DataStreams 0.3
308
DecisionTree 0.6
31-
Devectorize 0.4
32-
Discretizers 2.1
33-
Distributions 0.15
34-
Documenter 0.13
359
FileIO 0.6
3610
Flux 0.4
37-
ForwardDiff 0.7
3811
GLM 0.10
39-
GLMNet 0.3
40-
GPUArrays 0.2
4112
GZip 0.3
42-
GroupedErrors 0.1
43-
HypothesisTests 0.6
44-
IterTools 0.2
45-
IterableTables 0.6
4613
JLD2 0.0.5
47-
JuMP 0.18
48-
Juno 0.4
49-
KernelDensity 0.4
5014
Knet 0.9
51-
LARS 0.0.3
52-
LIBLINEAR 0.3
5315
LIBSVM 0.1
5416
LaTeXStrings 0.3
55-
Lasso 0.1
56-
Lazy 0.12
57-
LearnBase 0.1
58-
LearningStrategies 0.2
59-
LightGraphs 0.11
60-
Loess 0.3
61-
LossFunctions 0.2
6217
MLBase 0.7
63-
MNIST 0.0.2
64-
MacroTools 0.4
65-
Merlin 0.0.3
66-
Missings 0.2
67-
MultivariateStats 0.4
6818
NNlib 0.2
6919
NumericalIntegration 0.0.3
70-
OhMyREPL
71-
OpenCL 0.7
7220
PGFPlots 2.2
7321
PGFPlotsX 0.2
7422
PackageCompiler 0.3
75-
PenaltyFunctions 0.0.2
76-
PlotRecipes 0.3
77-
PlotThemes 0.2
78-
Plots 0.15
7923
ProgressMeter 0.5
80-
QuadGK 0.2
81-
Query 0.9
82-
RData 0.3
8324
RDatasets 0.3
84-
REPLCompletions
85-
Rmath 0.3
8625
ROCAnalysis 0.2
87-
RecipesBase 0.2
88-
Reel 1.0
89-
Reinforce 0.0.1
9026
Requires 0.4
91-
ReverseDiff 0.2
92-
ReverseDiffSource 0.3
93-
ScikitLearnBase 0.3
94-
StaticArrays 0.6
9527
StatsBase 0.19
96-
StatsFuns 0.5
9728
StatsModels 0.2
98-
StatPlots 0.7
99-
TaylorSeries 0.7
100-
TikzGraphs 0.5
10129
TikzPictures 1.2
10230
ValueHistories 0.4

deps/build.jl

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Originally based on https://github.com/KristofferC/PGFPlotsX.jl/blob/master/deps/build.jl
2+
3+
import Crayons
4+
5+
const OK = Crayons.Box.GREEN_FG * Crayons.Box.BOLD("OK")
6+
const X = Crayons.Box.RED_FG * Crayons.Box.BOLD("X")
7+
8+
print(STDERR, "Looking for lualatex...")
9+
have_lualatex = try success(`lualatex -v`); catch; false; end
10+
println(STDERR, " ", have_lualatex ? OK : X)
11+
12+
print(STDERR, "Looking for pdflatex...")
13+
have_pdflatex = try success(`pdflatex -v`); catch; false; end
14+
println(STDERR, " ", have_pdflatex ? OK : X)
15+
16+
default_engine = ""
17+
if have_lualatex
18+
default_engine = "LUALATEX"
19+
elseif have_pdflatex
20+
default_engine = "PDFLATEX"
21+
else
22+
warn(string("No LaTeX installation found, figures will not be generated. ",
23+
"Make sure either pdflatex or lualatex are installed and that ",
24+
"the correct paths are set then run Pkg.build(\"PredictMD\")"))
25+
end
26+
27+
print(STDERR, "Looking for pdftoppm...")
28+
have_pdftoppm = try success(`pdftoppm -v`); catch; false; end
29+
println(STDERR, " ", have_pdftoppm ? OK : X)
30+
if !have_pdftoppm
31+
warn(string("Did not find `pdftoppm`, png output will be disabled. Install `pdftoppm` ",
32+
"and run Pkg.build(\"PredictMD\") to enable"))
33+
end
34+
35+
print(STDERR, "Looking for pdf2svg...")
36+
pdfpath = joinpath(@__DIR__, "pdf2svg.pdf")
37+
svgpath = joinpath(@__DIR__, "pdf2svg.svg")
38+
have_pdf2svg = try success(`pdf2svg $pdfpath $svgpath`); catch; false; end
39+
println(STDERR, " ", have_pdf2svg ? OK : X)
40+
if !have_pdf2svg
41+
warn(string("Did not find `pdf2svg`, svg output will be disabled. Install `pdf2svg` ",
42+
"and run Pkg.build(\"PredictMD\") to enable"))
43+
end
44+
45+
if !have_pdf2svg && !have_pdftoppm
46+
warn(string("Found neither pdf2svg or pdftoppm, figures will not be viewable in Jupyter or Juno"))
47+
end
48+
49+
open(joinpath(@__DIR__, "deps.jl"), "w") do f
50+
println(f, "DEFAULT_ENGINE = \"", default_engine, "\"")
51+
println(f, "HAVE_PDFTOPPM = ", have_pdftoppm)
52+
println(f, "HAVE_PDFTOSVG = ", have_pdf2svg)
53+
end
54+
55+
const PREAMBLE_PATH = joinpath(@__DIR__, "custom_preamble.tex")
56+
if !isfile(PREAMBLE_PATH)
57+
touch(PREAMBLE_PATH)
58+
end

deps/pdf2svg.pdf

17.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)