Skip to content

Commit

Permalink
Fixing compatibility with Julia 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rsarfati committed Dec 10, 2019
1 parent 3397a2d commit 3ae5ee3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Distributions = "0.16, 0.17, 0.18, 0.19, 0.20, 0.21"
ForwardDiff = "^0.10"
Nullables = "^0.0.8"
OrderedCollections = "^1.1.0"
SpecialFunctions = "0.7.0, 0.8"
SpecialFunctions = "0.7, 0.8"

[extras]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
10 changes: 5 additions & 5 deletions test/parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tomodel_answers[3] = 1.
for (i,T) in enumerate(subtypes(Transform))
global u = parameter(:σ_pist, 2.5230, (1e-8, 5.), (1e-8, 5.), T(), fixed=false)
@test differentiate_transform_to_real_line(u, u.value) == toreal_answers[i]
x = transform_to_real_line(u)
global x = transform_to_real_line(u)
@test differentiate_transform_to_model_space(u,x) == tomodel_answers[i]

if !isa(T,Type{ModelConstructors.Untransformed})
Expand All @@ -47,7 +47,7 @@ v = parameter(:cat, 2.5230, (1e-8, 5.), (1e-8, 5.), ModelConstructors.Exponentia

pvec = ParameterVector{Float64}(undef, N)
for i in 1:length(pvec)
pvec[i] = (i%2 == 0) ? u : v
global pvec[i] = (i%2 == 0) ? u : v
end
@testset "Check logpdf/pdf function approximations" begin
@test logpdf(pvec) 50*logpdf(v)
Expand Down Expand Up @@ -257,11 +257,11 @@ end
# Check we can update only specific parameter values in a ParameterVector
@testset "Test updating specific values of a ParameterVector" begin
# Check you can overwrite values which are unfixed
pvec = ParameterVector{Float64}(undef, 3)
global pvec = ParameterVector{Float64}(undef, 3)
pvec[1] = parameter(:a, 1., (0., 3.), (0., 3.), fixed = false)
pvec[2] = parameter(:b, 1.)
pvec[3] = parameter(:c, 1., (0., 3.), (0., 3.), fixed = false)
vals = [2., 2.]
global vals = [2., 2.]
update!(pvec, vals, BitArray([true, false, true]))
@test map(x -> x.value, pvec) == [2., 1., 2.]

Expand All @@ -270,7 +270,7 @@ end
pvec[1] = parameter(:a, 1.)
pvec[2] = parameter(:b, 1.)
pvec[3] = parameter(:c, 1.)
vals = [2., 2.]
global vals = [2., 2.]
update!(pvec, vals, BitArray([true, false, true]))
@test map(x -> x.value, pvec) == [1., 1., 1.]
end
Expand Down
4 changes: 2 additions & 2 deletions test/settings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ vint = Setting(:data_vintage, "REF", true, "vint", "Date of data") # full constr
m.testing = true

# Overwriting settings
a = gensym() # unlikely to clash
b = gensym()
global a = gensym() # unlikely to clash
global b = gensym()
m <= Setting(a, 0, true, "abcd", "a")
m <= Setting(a, 1)
@test m.test_settings[a].value == 1
Expand Down

2 comments on commit 3ae5ee3

@FRBNY-DSGE-Team
Copy link
Collaborator

Choose a reason for hiding this comment

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

@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 updated: JuliaRegistries/General/5424

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.1.5 -m "<description of version>" 3ae5ee3fe5421345742cfeceba1b9cd5b3d78e25
git push origin v0.1.5

Please sign in to comment.