Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
joshday committed Apr 24, 2020
1 parent 65c0e3a commit d1f1f3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/part.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#-----------------------------------------------------------------------------# Part
struct Part{D, O<:OnlineStat} <: OnlineStat{TwoThings}
stat::O
domain::D
stat::O
end
Part(stat::OnlineStat, domain) = Part(domain, stat)

value(o::Part) = (domain=o.domain, stat=o.stat)
Base.in(x, o::Part) = x o.domain
Base.isless(a::Part, b::Part) = isless(a.domain, b.domain)
Expand Down
12 changes: 5 additions & 7 deletions test/test_stats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ println(" > CovMatrix")
@test all(x -> (x...), zip(std(o), std(ymat; dims=1)))
@test all(x -> (x...), zip(mean(o), mean(ymat; dims=1)))

@test (mergevals(CovMatrix(), O.eachrow(ymat), O.eachrow(ymat2))...)
@test (mergevals(CovMatrix(), eachrow(ymat), eachrow(ymat2))...)
@test (mergevals(CovMatrix(), O.eachcol(ymat'), O.eachcol(ymat2'))...)
@test (mergevals(CovMatrix(Complex{Float64}), O.eachrow(ymat * im), O.eachrow(ymat2))...)
@test (mergevals(CovMatrix(Complex{Float64}), O.eachrow(ymat * im), O.eachrow(ymat2 * im))...)
@test (mergevals(CovMatrix(Complex{Float64}), eachrow(ymat * im), eachrow(ymat2))...)
@test (mergevals(CovMatrix(Complex{Float64}), eachrow(ymat * im), eachrow(ymat2 * im))...)
end
#-----------------------------------------------------------------------# Extrema
println(" > Extrema")
Expand Down Expand Up @@ -122,7 +122,7 @@ end
#-----------------------------------------------------------------------# Group
println(" > Group")
@testset "Group" begin
o = fit!(5Mean(), O.eachrow(ymat))
o = fit!(5Mean(), eachrow(ymat))
@test o[1] == first(o)
@test o[end] == last(o)
@test 5Mean() == 5Mean()
Expand All @@ -134,9 +134,7 @@ println(" > Group")
@test length(o2) == 5

a, b = mergevals(
Group(Mean(), Variance(), Sum(), Moments(), Mean()),
O.eachrow(ymat),
O.eachrow(ymat2)
Group(Mean(), Variance(), Sum(), Moments(), Mean()), eachrow(ymat), eachrow(ymat2)
)
for (ai, bi) in zip(a, b)
@test value(ai) value(bi)
Expand Down

2 comments on commit d1f1f3b

@joshday
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.

Error while trying to register: "Tag with name 1.2.7 already exists and points to a different commit"

Please sign in to comment.