Skip to content

Commit

Permalink
another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Aug 6, 2024
1 parent 5077ff1 commit b0f4089
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MadsMonteCarlo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function emceesampling(madsdata::AbstractDict; filename::AbstractString="", load
filename = joinpath(Mads.getmadsproblemdir(madsdata), Mads.getmadsrootname(madsdata) * "_emcee_results_$(np)_$(no)_$(numwalkers)_$(nexecutions)_$(burnin)_$(thinning).jld2")
madsinfo("Filename not provided! AffineInvariantMCMC results will be saved in $(filename) ...")
end
if load && filename == ""
if load && filename != ""
chain, llhoods, observations = loadecmeeresults(madsdata, filename)
if isnothing(chain)
if execute
Expand Down Expand Up @@ -127,7 +127,7 @@ function emceesampling(madsdata::AbstractDict; filename::AbstractString="", load
end
function emceesampling(madsdata::AbstractDict, p0::AbstractMatrix; filename::AbstractString="", load::Bool=false, save::Bool=false, execute::Bool=true, numwalkers::Integer=10, nexecutions::Integer=100, burnin::Integer=numwalkers, thinning::Integer=10, seed::Integer=-1, weightfactor::Number=1.0, rng::Union{Nothing,Random.AbstractRNG,DataType}=nothing, distributed_function::Bool=false)
if filename != ""
load = save = true
save = true
end
np = length(Mads.getoptparams(madsdata))
no = length(Mads.getobskeys(madsdata))
Expand All @@ -136,7 +136,7 @@ function emceesampling(madsdata::AbstractDict, p0::AbstractMatrix; filename::Abs
madsinfo("Filename not provided! AffineInvariantMCMC results will be saved in $(filename) ...")
end
numsamples_perwalker = div(nexecutions, numwalkers)
if load
if load && filename != ""
bad_data = false
@info("AffineInvariantMCMC preexisting data loading $(filename) ...")
chain, llhoods, observations = loadecmeeresults(madsdata, filename)
Expand Down

0 comments on commit b0f4089

Please sign in to comment.