Skip to content

Commit

Permalink
Switch Print/Save order
Browse files Browse the repository at this point in the history
  • Loading branch information
paschermayr committed Jul 28, 2022
1 parent ec09b12 commit 29b15b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Baytes"
uuid = "72ddfcfc-6e9d-43df-829b-7aed7c549d4f"
authors = ["Patrick Aschermayr <p.aschermayr@gmail.com>"]
version = "0.1.8"
version = "0.1.9"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
24 changes: 12 additions & 12 deletions src/sampling/sample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ function sample(
## Loop through iterations
println("Sampling starts...")
propose!(_rng, trace, algorithmᵛ, modelᵛ, data)
## Save output
if safeoutput
println("Saving trace, initial model and algorithm.")
savetrace(trace, model, algorithmᵛ)
end
## Print diagnostics
println("Sampling finished, printing diagnostics and saving trace.")
if printoutput
println("Sampling finished, printing diagnostics and saving trace.")
## Assign relevant parameter for printing and print summary to REPL.
transform = TraceTransform(trace, model)
summary(trace, algorithmᵛ, transform, printdefault)
end
## Save output
if safeoutput
println("Saving trace, initial model and algorithm.")
savetrace(trace, model, algorithmᵛ)
end
## Return trace and algorithm
return trace, algorithmᵛ
end
Expand Down Expand Up @@ -111,18 +111,18 @@ function sample!(iterations::Integer,
## Loop through iterations
println("Sampling starts...")
propose!(_rng, trace_new, algorithmᵛ, modelᵛ, data)
## Save output
if safeoutput
println("Saving trace, initial model and algorithm.")
savetrace(trace_new, model, algorithmᵛ)
end
## Print diagnostics
println("Sampling finished, printing diagnostics.")
if printoutput
println("Sampling finished, printing diagnostics.")
## Assign relevant parameter for printing and print summary to REPL.
transform = TraceTransform(trace_new, model)
summary(trace_new, algorithmᵛ, transform, printdefault)
end
## Save output
if safeoutput
println("Saving trace, initial model and algorithm.")
savetrace(trace_new, model, algorithmᵛ)
end
## Return trace and algorithm
return trace_new, algorithmᵛ
end
Expand Down

2 comments on commit 29b15b4

@paschermayr
Copy link
Owner Author

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 created: JuliaRegistries/General/65219

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 the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.9 -m "<description of version>" 29b15b428b7467dfbd18986435b19204c2a985e5
git push origin v0.1.9

Please sign in to comment.