Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

Commit

Permalink
Update test data
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed May 7, 2019
1 parent 041fb51 commit 2e900b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
Binary file modified test/data/CondSimSol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/data/UncondSimSol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 12 additions & 26 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ using GeoStatsBase
using GeoStatsDevTools
using Variography
using DirectGaussianSimulation
using Plots; gr()
using Plots; gr(size=(1000,400))
using VisualRegressionTests
using Test, Pkg, Random

# list of maintainers
maintainers = ["juliohm"]
# workaround GR warnings
ENV["GKSwstype"] = "100"

# environment settings
islinux = Sys.islinux()
istravis = "TRAVIS" keys(ENV)
ismaintainer = "USER" keys(ENV) && ENV["USER"] maintainers
datadir = joinpath(@__DIR__,"data")

if ismaintainer
visualtests = !istravis || (istravis && islinux)
if !istravis
Pkg.add("Gtk")
using Gtk
end
Expand All @@ -25,39 +25,25 @@ end

@testset "Conditional simulation" begin
problem = SimulationProblem(geodata, domain, :z, 2)

Random.seed!(2018)
solver = DirectGaussSim(:z => (variogram=SphericalVariogram(range=10.),))

Random.seed!(2018)
solution = solve(problem, solver)

if ismaintainer || istravis
function plot_cond_solution(fname)
plot(solution, size=(1000,400))
png(fname)
end
refimg = joinpath(datadir,"CondSimSol.png")

@test test_images(VisualTest(plot_cond_solution, refimg), popup=!istravis, tol=0.1) |> success
if visualtests
@plottest plot(solution) joinpath(datadir,"CondSimSol.png") !istravis
end
end

@testset "Unconditional simulation" begin
problem = SimulationProblem(domain, :z => Float64, 2)

Random.seed!(2018)
solver = DirectGaussSim(:z => (variogram=SphericalVariogram(range=10.),))

Random.seed!(2018)
solution = solve(problem, solver)

if ismaintainer || istravis
function plot_uncond_solution(fname)
plot(solution, size=(1000,400))
png(fname)
end
refimg = joinpath(datadir,"UncondSimSol.png")

@test test_images(VisualTest(plot_uncond_solution, refimg), popup=!istravis, tol=0.1) |> success
if visualtests
@plottest plot(solution) joinpath(datadir,"UncondSimSol.png") !istravis
end
end
end

2 comments on commit 2e900b8

@juliohm
Copy link
Owner Author

@juliohm juliohm commented on 2e900b8 May 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/591

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" 2e900b8e8cd137a0bbd321c08d29052ffe15205e
git push origin v0.2.1

Please sign in to comment.