Skip to content

Commit

Permalink
Updates for Julia 1.0 (#33)
Browse files Browse the repository at this point in the history
* Update for Julia 1.0

* Use `Random.seed!`

* Also test on 1.0
  • Loading branch information
mschauer authored and ararslan committed Sep 6, 2018
1 parent 5b8a08a commit c802ff2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ os:
- osx
julia:
- 0.7
- 1.0
- nightly
notifications:
email: false
Expand All @@ -12,4 +13,4 @@ notifications:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia --check-bounds=yes -e 'Pkg.clone(pwd()); Pkg.build("ConjugatePriors"); Pkg.test("ConjugatePriors"; coverage=true)'
after_success:
- julia -e 'cd(Pkg.dir("ConjugatePriors")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())'
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())'
4 changes: 2 additions & 2 deletions test/conjugates_normal.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Distributions
using ConjugatePriors

using Random: srand
using Random: seed!

using ConjugatePriors: NormalGamma, NormalInverseGamma, NormalInverseChisq
using ConjugatePriors: posterior, posterior_rand, posterior_mode, posterior_randmodel, fit_map
Expand Down Expand Up @@ -164,7 +164,7 @@ w = rand(100)
@test mean(pri2) == mean(pri)
@test pdf(pri, mu_true, sig2_true) == pdf(pri2, mu_true, sig2_true)

@test (srand(1); rand(pri)) == (srand(1); rand(pri2))
@test (seed!(1); rand(pri)) == (seed!(1); rand(pri2))

# check that updating is consistent between NIχ2 and NIG
post = posterior(pri, Normal, x)
Expand Down

0 comments on commit c802ff2

Please sign in to comment.