Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fixed zero lag show
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Jul 24, 2023
1 parent 11d62ab commit 6699d17
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/BlockAverage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ end

function Base.show(io::IO, ::MIME"text/plain", b::BlockAverageData)
merr = findmax(b.xmean_stderr)
print(
io,
izerolag = findfirst(x -> x <=0, b.autocor)
izerolag = isnothing(izerolag) ? 1 : izerolag
print(io, chomp(
"""
-------------------------------------------------------------------
$(typeof(b))
Expand All @@ -77,13 +78,13 @@ function Base.show(io::IO, ::MIME"text/plain", b::BlockAverageData)
percentual: $((100/b.xmean)*(b.xmean_maxerr[max(1,lastindex(b.xmean_maxerr)-2):end] .- b.xmean))
absolute: $((b.xmean_maxerr[max(1,lastindex(b.xmean_maxerr)-2):end] .- b.xmean))
Autocorrelation is first zero with lag: $(b.lags[findfirst(x -> x <=0, b.autocor)])
Autocorrelation is first zero with lag: $(b.lags[izerolag])
Characteristic time of autocorrelation decay:
as fraction of series length: $(b.tau / length(b.x))
absolute: $(b.tau)
-------------------------------------------------------------------
"""
)
))
end

#
Expand Down

0 comments on commit 6699d17

Please sign in to comment.