Skip to content

Commit

Permalink
Update doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsch committed Jun 4, 2024
1 parent ac31e73 commit c5ca5df
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
5 changes: 1 addition & 4 deletions src/base/abstractfiltration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,7 @@ julia> vertices(Rips([0 1 1; 1 0 1; 1 1 0]))
Base.OneTo(3)
julia> vertices(Cubical([0 1 1; 1 0 1; 1 1 0]))
3×3 CartesianIndices{2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}:
CartesianIndex(1, 1) CartesianIndex(1, 2) CartesianIndex(1, 3)
CartesianIndex(2, 1) CartesianIndex(2, 2) CartesianIndex(2, 3)
CartesianIndex(3, 1) CartesianIndex(3, 2) CartesianIndex(3, 3)
CartesianIndices((3, 3))
```
"""
Expand Down
2 changes: 1 addition & 1 deletion src/base/chain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ julia> data = [(rand(), rand(), rand()) for _ in 1:100];
julia> result = ripserer(data; reps=true, modulus=7);
julia> chain = result[end][end].representative
28-element Chain{Ripserer.Mod{7},Ripserer.Simplex{1, Float64, Int64}}:
28-element Chain{Mod{7},Simplex{1, Float64, Int64}}:
+Simplex{1}((68, 54), 0.25178097927369875) => 6 mod 7
+Simplex{1}((54, 46), 0.2575262844682746) => 1 mod 7
+Simplex{1}((88, 56), 0.25936896586973557) => 1 mod 7
Expand Down
2 changes: 1 addition & 1 deletion src/extra/circularcoordinates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ CircularCoordinates(
radius=(0.9510565162951535,),
n_landmarks=10,
partition=linear,
metric=Distances.Euclidean(0.0),
metric=Euclidean(0.0),
)
julia> summary(cc(data))
Expand Down
8 changes: 4 additions & 4 deletions src/filtrations/alpha.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ julia> length(Ripserer.edges(rips))
julia> sort(ripserer(alpha)[2], by=persistence)[end]
[0.375, 2.01) with:
birth_simplex: Ripserer.Simplex{1, Float64, Int64}
death_simplex: Ripserer.Simplex{2, Float64, Int64}
birth_simplex: Simplex{1, Float64, Int64}
death_simplex: Simplex{2, Float64, Int64}
julia> sort(ripserer(rips)[2], by=persistence)[end]
[0.375, 2.01) with:
birth_simplex: Ripserer.Simplex{1, Float64, Int64}
death_simplex: Ripserer.Simplex{2, Float64, Int64}
birth_simplex: Simplex{1, Float64, Int64}
death_simplex: Simplex{2, Float64, Int64}
```
"""
struct Alpha{I,P<:SVector} <: AbstractCustomFiltration{I,Float64}
Expand Down
8 changes: 4 additions & 4 deletions test/doctests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ using Documenter
using Distances
using Ripserer

if VERSION v"1.8-DEV" || VERSION < v"1.7-DEV" || !Sys.islinux()
@warn "Doctests only run on Linux and Julia 1.7"
if VERSION v"1.11-DEV" || VERSION < v"1.10-DEV" || !Sys.islinux()
@warn "Doctests only run on Linux and Julia 1.10"
else
DocMeta.setdocmeta!(
Ripserer, :DocTestSetup, :(using Ripserer; using Distances); recursive=true
Ripserer, :DocTestSetup, :(using Ripserer; using Distances); recursive=true,
)
doctest(Ripserer)
doctest(Ripserer; fix=true)
end

0 comments on commit c5ca5df

Please sign in to comment.