Skip to content

Commit 11b8202

Browse files
committed
Doctests for Julia 0.7/1.0
1 parent 4263e42 commit 11b8202

9 files changed

+125
-174
lines changed

Diff for: .travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ os:
55
julia:
66
- 0.7
77
- 1.0
8+
- nightly
9+
810
notifications:
911
email: false
1012

@@ -16,4 +18,4 @@ after_success:
1618
- julia -e 'using Pkg; using PairwiseListMatrices; cd(dirname(pathof(PairwiseListMatrices))); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
1719
- julia -e 'using Pkg; Pkg.add("Documenter")'
1820
- julia -e 'using Pkg; Pkg.add("Plots"); Pkg.add("GR")' # Plots
19-
- julia -e 'cd(dirname(pathof(PairwiseListMatrices))); include(joinpath("docs", "make.jl"))'
21+
- julia -e 'cd(dirname(pathof(PairwiseListMatrices))); include(joinpath("..", "docs", "make.jl"))'

Diff for: NEWS.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ PairwiseListMatrices v0.6 was the last version with Julia 0.6 support.
77

88
* `writecsv` changed to `writedlm` using `delim=','`.
99

10+
* A type parameter to indicate the wrapped matrix type was added to
11+
`NamedResidueMatrix`, which is now `NamedResidueMatrix{Array{Residue,2}}`.
12+
1013
### Changes from v0.5 to v0.6
1114

1215
PairwiseListMatrices v0.6 requires Julia v0.6.

Diff for: REQUIRE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
julia 0.7 1.0
1+
julia 0.7
22
NamedArrays
33
RecipesBase

Diff for: appveyor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ environment:
22
matrix:
33
- julia_version: 0.7
44
- julia_version: 1.0
5+
- julia_version: latest
56

67
platform:
78
- x86 # 32-bit

Diff for: docs/make.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Documenter, PairwiseListMatrices
22

33
makedocs(
4+
doctest = true,
45
format = :html,
56
sitename = "PairwiseListMatrices",
67
modules = [PairwiseListMatrices],
@@ -13,7 +14,6 @@ makedocs(
1314
deploydocs(
1415
repo = "github.com/diegozea/PairwiseListMatrices.jl.git",
1516
target = "build",
16-
julia = "0.6",
1717
deps = nothing,
1818
make = nothing
1919
)

Diff for: src/PairwiseListMatrices.jl

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
__precompile__()
22

3+
"""
4+
This package allows you to use a pairwise list as a symmetric matrix.
35
6+
```julia
7+
using PairwiseListMatrices
8+
```
9+
"""
410
module PairwiseListMatrices
511

612
# standard libraries
@@ -28,18 +34,10 @@ export @iterateupper,
2834
from_table, to_table,
2935
to_dict,
3036
join,
31-
to_dataframe, from_dataframe
37+
writedlm
3238

3339
include("macros.jl")
3440
include("pairwiselistmatrix.jl")
3541
include("plotrecipes.jl")
3642

37-
function to_dataframe(args...)
38-
throw(ErrorException("Deprecated function, use DataFrame(to_dict(args...)) instead."))
39-
end
40-
41-
function from_dataframe(args...)
42-
throw(ErrorException("Deprecated function, use from_table(args...) instead."))
43-
end
44-
4543
end

Diff for: src/macros.jl

+16-8
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ In the body `list` will be the list field of the `PairwiseListMatrix` and `k` th
66
over that list. Other variables should be interpolated in a quote. You must not modify the
77
value of `k`.
88
9-
```julia
9+
```jldoctest
10+
julia> using PairwiseListMatrices
11+
1012
julia> PLM = PairwiseListMatrix([1,2,3], false)
11-
3×3 PairwiseListMatrices.PairwiseListMatrix{Int64,false,Array{Int64,1}}:
13+
3×3 PairwiseListMatrix{Int64,false,Array{Int64,1}}:
1214
0 1 2
1315
1 0 3
1416
2 3 0
@@ -37,17 +39,19 @@ second is the body of the loop. In the body `diag` will be the diag field of the
3739
`PairwiseListMatrix` and `k` the index over that vector.
3840
Other variables should be interpolated in a quote. You must not modify the value of `k`.
3941
40-
```julia
42+
```jldoctest
43+
julia> using PairwiseListMatrices
44+
4145
julia> PLM = PairwiseListMatrix([1,2,3], false)
42-
3×3 PairwiseListMatrices.PairwiseListMatrix{Int64,false,Array{Int64,1}}:
46+
3×3 PairwiseListMatrix{Int64,false,Array{Int64,1}}:
4347
0 1 2
4448
1 0 3
4549
2 3 0
4650
4751
julia> @iteratediag PLM diag[k] += 10k
4852
4953
julia> PLM
50-
3×3 PairwiseListMatrices.PairwiseListMatrix{Int64,false,Array{Int64,1}}:
54+
3×3 PairwiseListMatrix{Int64,false,Array{Int64,1}}:
5155
10 1 2
5256
1 20 3
5357
2 3 30
@@ -75,9 +79,11 @@ You can also use the respective `i` and `j` indexes for that position `k` in the
7579
triangular part of the matrix. Other variables should be interpolated in a quote.
7680
You must not modify the values of `i`, `j` or `k`.
7781
78-
```julia
82+
```jldoctest
83+
julia> using PairwiseListMatrices
84+
7985
julia> PLM = PairwiseListMatrix([1,2,3], true)
80-
2×2 PairwiseListMatrices.PairwiseListMatrix{Int64,true,Array{Int64,1}}:
86+
2×2 PairwiseListMatrix{Int64,true,Array{Int64,1}}:
8187
1 2
8288
2 3
8389
@@ -86,7 +92,9 @@ julia> mat = zeros(Int, 2, 2)
8692
0 0
8793
0 0
8894
89-
julia> @iterateupper PLM true :(\$mat)[i,j] = list[k]
95+
julia> let mat = mat # To avoid using global
96+
@iterateupper PLM true :(\$mat)[i,j] = list[k]
97+
end
9098
9199
julia> mat
92100
2×2 Array{Int64,2}:

0 commit comments

Comments
 (0)