-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update observables #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JuliaFormatter
src/observables/simple.jl|135|
src/observables/simple.jl|138|
src/observables/simplevector.jl|10|
src/observables/simplevector.jl|29|
src/observables/simplevector.jl|31|
src/observables/simplevector.jl|33|
src/observables/simplevector.jl|35|
src/observables/simplevector.jl|45|
src/observables/simplevector.jl|51|
src/observables/simplevector.jl|87|
src/observables/simplevector.jl|145|
src/observables/simplevector.jl|150|
src/observables/simplevector.jl|153|
src/observables/tinyvector.jl|47|
src/runMC.jl|139|
test/classical.jl|26|
test/classical.jl|37|
test/observable.jl|6|
test/observable.jl|10|
test/observable.jl|17|
test/observable.jl|19|
test/observable.jl|22|
test/observable.jl|31|
test/observable.jl|35|
test/observable.jl|42|
test/observable.jl|45|
test/observable.jl|47|
test/observable.jl|57|
test/observable.jl|59|
test/observable.jl|64|
test/observable.jl|72|
test/observable.jl|75|
test/observable.jl|102|
use_index_as_sitetype = get(param, "Use Indecies as Site Types", false) | ||
use_index_as_bondtype = get(param, "Use Indecies as Bond Types", false) | ||
use_index_as_sitetype = get(param, "Use Indicies as Site Types", false) | ||
use_index_as_bondtype = get(param, "Use Indicies as Bond Types", false) | ||
|
||
for icell in 0:(numcell-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
for icell in 0:(numcell-1) | |
for icell = 0:(numcell-1) |
raw_ts :: Vector{Vector{Float64}} ## Time series of raw data | ||
bins :: Vector{Vector{Float64}} ## Time series of bins | ||
sum :: Vector{Vector{Float64}} ## Summation of stored values | ||
sum2 :: Vector{Vector{Float64}} ## Summation of square of bin's mean | ||
entries :: Vector{Int} ## Number of bins | ||
binsize :: Int | ||
lastbin :: Int | ||
minbinnum :: Int | ||
maxlevel :: Int | ||
end | ||
|
||
function BinningVectorObservable(minbinnum::Int = 128) | ||
BinningVectorObservable( Vector{Float64}[], Vector{Float64}[], Vector{Float64}[], Vector{Float64}[], | ||
zeros(Int,1), 1, 0, minbinnum, 1) | ||
function BinningVectorObservable(minbinnum::Int = 128) | ||
Base.depwarn("BinningVectorObservable is deprecated. Use obs=SimpleVectorObservable() and binning(obs) instead.", nothing, force=true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
raw_ts :: Vector{Vector{Float64}} ## Time series of raw data | |
bins :: Vector{Vector{Float64}} ## Time series of bins | |
sum :: Vector{Vector{Float64}} ## Summation of stored values | |
sum2 :: Vector{Vector{Float64}} ## Summation of square of bin's mean | |
entries :: Vector{Int} ## Number of bins | |
binsize :: Int | |
lastbin :: Int | |
minbinnum :: Int | |
maxlevel :: Int | |
end | |
function BinningVectorObservable(minbinnum::Int = 128) | |
BinningVectorObservable( Vector{Float64}[], Vector{Float64}[], Vector{Float64}[], Vector{Float64}[], | |
zeros(Int,1), 1, 0, minbinnum, 1) | |
function BinningVectorObservable(minbinnum::Int = 128) | |
Base.depwarn("BinningVectorObservable is deprecated. Use obs=SimpleVectorObservable() and binning(obs) instead.", nothing, force=true) | |
raw_ts::Vector{Vector{Float64}} ## Time series of raw data | |
bins::Vector{Vector{Float64}} ## Time series of bins | |
sum::Vector{Vector{Float64}} ## Summation of stored values | |
sum2::Vector{Vector{Float64}} ## Summation of square of bin's mean | |
entries::Vector{Int} ## Number of bins | |
binsize::Int | |
lastbin::Int | |
minbinnum::Int | |
maxlevel::Int | |
function BinningVectorObservable(minbinnum::Int = 128) | |
Base.depwarn( | |
"BinningVectorObservable is deprecated. Use obs=SimpleVectorObservable() and binning(obs) instead.", | |
nothing, | |
force = true, | |
) |
bins = Vector{Float64}[] | ||
sum = Vector{Float64}[] | ||
sum2 = Vector{Float64}[] | ||
entries = zeros(Int,1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
entries = zeros(Int,1) | |
entries = zeros(Int, 1) |
@@ -5,9 +5,25 @@ mutable struct Jackknife <: ScalarObservable | |||
xs :: Vector{Float64} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
xs :: Vector{Float64} | |
xs::Vector{Float64} |
end | ||
|
||
const JackknifeSet = MCObservableSet{Jackknife} | ||
const JackknifeVectorSet = MCObservableSet{JackknifeVector} | ||
|
||
jackknife(obs::VectorObservable) = JackknifeVector(obs) | ||
function jackknife(obsset :: MCObservableSet{Obs}) where (Obs<: VectorObservable) | ||
JK = JackknifeSet() | ||
for (k,v) in obsset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
for (k,v) in obsset | |
for (k, v) in obsset |
end | ||
|
||
if binsize > 0 | ||
numbins = floor(Int, nobs/binsize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
numbins = floor(Int, nobs/binsize) | |
numbins = floor(Int, nobs / binsize) |
if binsize > 0 | ||
numbins = floor(Int, nobs/binsize) | ||
else | ||
binsize = floor(Int, nobs/numbins) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
binsize = floor(Int, nobs/numbins) | |
binsize = floor(Int, nobs / numbins) |
|
||
bins = zeros(numbins) | ||
offset = 1 | ||
for i in 1:numbins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
for i in 1:numbins | |
for i = 1:numbins |
newobs = SimpleObservable(bins, numbins, sum(bins), sum(abs2, bins)) | ||
return newobs | ||
end | ||
|
||
function reset!(obs :: SimpleObservable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
function reset!(obs :: SimpleObservable) | |
function reset!(obs::SimpleObservable) |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JuliaFormatter
test/observable.jl|72|
test/observable.jl|75|
test/observable.jl|102|
function binning(obsset::SimpleObservableSet; binsize::Int = 0, numbins::Int = 0) | ||
newobsset = SimpleObservableSet() | ||
for (name, obs) in obsset | ||
newobsset[name] = binning(obs, binsize=binsize, numbins=numbins) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
newobsset[name] = binning(obs, binsize=binsize, numbins=numbins) | |
newobsset[name] = binning(obs, binsize = binsize, numbins = numbins) |
newobsset[name] = binning(obs, binsize=binsize, numbins=numbins) | ||
end | ||
return newobsset | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
end | |
end |
@@ -9,6 +9,45 @@ end | |||
|
|||
SimpleVectorObservable() = SimpleVectorObservable(Vector{Float64}[], 0, Float64[], Float64[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
SimpleVectorObservable() = SimpleVectorObservable(Vector{Float64}[], 0, Float64[], Float64[]) | |
SimpleVectorObservable() = | |
SimpleVectorObservable(Vector{Float64}[], 0, Float64[], Float64[]) |
end | ||
|
||
if binsize > 0 | ||
numbins = floor(Int, nobs/binsize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
numbins = floor(Int, nobs/binsize) | |
numbins = floor(Int, nobs / binsize) |
if binsize > 0 | ||
numbins = floor(Int, nobs/binsize) | ||
else | ||
binsize = floor(Int, nobs/numbins) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
binsize = floor(Int, nobs/numbins) | |
binsize = floor(Int, nobs / numbins) |
binning_scalar = [binning(obs_scalar[i]) for i in 1:nobs] | ||
binning_vector = binning(obs_vector) | ||
|
||
mean_scalar = [mean(binning_scalar[i]) for i in 1:nobs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
mean_scalar = [mean(binning_scalar[i]) for i in 1:nobs] | |
mean_scalar = [mean(binning_scalar[i]) for i = 1:nobs] |
|
||
mean_scalar = [mean(binning_scalar[i]) for i in 1:nobs] | ||
mean_vector = mean(binning_vector) | ||
var_scalar = [var(binning_scalar[i]) for i in 1:nobs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
var_scalar = [var(binning_scalar[i]) for i in 1:nobs] | |
var_scalar = [var(binning_scalar[i]) for i = 1:nobs] |
function test_jackknife(scalartype, vectortype) | ||
nobs = 3 | ||
ndata = 100 | ||
obs_scalar_x = [scalartype() for i in 1:nobs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
obs_scalar_x = [scalartype() for i in 1:nobs] | |
obs_scalar_x = [scalartype() for i = 1:nobs] |
ndata = 100 | ||
obs_scalar_x = [scalartype() for i in 1:nobs] | ||
obs_vector_x = vectortype() | ||
obs_scalar_y = [scalartype() for i in 1:nobs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
obs_scalar_y = [scalartype() for i in 1:nobs] | |
obs_scalar_y = [scalartype() for i = 1:nobs] |
for i in 1:ndata | ||
for j in 1:nobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
for i in 1:ndata | |
for j in 1:nobs | |
for i = 1:ndata | |
for j = 1:nobs |
I close it until the test passes |
VectorObservable
likevar
are correctedBinningObservable
is deprecatedobs = SimpleObservable()
andbinned = binning(obs)
binning
returns newSimpleObservable
with binnedbinning
takes one option,binsize::Int
ornumbins::Int
.binsize
is the size of each binnumbins
is the number of binsbinsize = floor(Int, sqrt(count(obs)))
is usedparam
inrunMC(param::Parameter)
takes new optional keys,Binning size
andNumber of Bins
Jackknife
andJackknifeVector
are added