{"action":"created","issue":{"url":"https://api.github.com/repos/joshday/OnlineStats.jl/issues/6","labels_url":"https://api.github.com/repos/joshday/OnlineStats.jl/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/joshday/OnlineStats.jl/issues/6/comments","events_url":"https://api.github.com/repos/joshday/OnlineStats.jl/issues/6/events","html_url":"https://github.com/joshday/OnlineStats.jl/issues/6","id":71603089,"number":6,"title":"Code cleanup","user":{"login":"tbreloff","id":933338,"avatar_url":"https://avatars.githubusercontent.com/u/933338?v=3","gravatar_id":"","url":"https://api.github.com/users/tbreloff","html_url":"https://github.com/tbreloff","followers_url":"https://api.github.com/users/tbreloff/followers","following_url":"https://api.github.com/users/tbreloff/following{/other_user}","gists_url":"https://api.github.com/users/tbreloff/gists{/gist_id}","starred_url":"https://api.github.com/users/tbreloff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbreloff/subscriptions","organizations_url":"https://api.github.com/users/tbreloff/orgs","repos_url":"https://api.github.com/users/tbreloff/repos","events_url":"https://api.github.com/users/tbreloff/events{/privacy}","received_events_url":"https://api.github.com/users/tbreloff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"tbreloff","id":933338,"avatar_url":"https://avatars.githubusercontent.com/u/933338?v=3","gravatar_id":"","url":"https://api.github.com/users/tbreloff","html_url":"https://github.com/tbreloff","followers_url":"https://api.github.com/users/tbreloff/followers","following_url":"https://api.github.com/users/tbreloff/following{/other_user}","gists_url":"https://api.github.com/users/tbreloff/gists{/gist_id}","starred_url":"https://api.github.com/users/tbreloff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbreloff/subscriptions","organizations_url":"https://api.github.com/users/tbreloff/orgs","repos_url":"https://api.github.com/users/tbreloff/repos","events_url":"https://api.github.com/users/tbreloff/events{/privacy}","received_events_url":"https://api.github.com/users/tbreloff/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-04-28T14:21:05Z","updated_at":"2015-04-28T18:16:52Z","closed_at":null,"body":"There's a bunch of places where there's unnecessary parametric types/signatures and wasteful work .  For example...\r\n`Base.push!{T <: ScalarStat}(df::DataFrame, obj::T) = append!(df, DataFrame(obj))`\r\nmight be better as:\r\n`Base.push!(df::DataFrame, obj::ScalarStat) = push!(df, value(obj))`\r\n\r\nNote that:\r\n- No need for a parametric method here... T is never used.  It's no slower to give the type as `obj::ScalarStat`.. it's still compiled to the same method (i.e. `Base.push!(df::DataFrame, obj::Var) = ...`)  You only want the parametric if you need T in the RHS of the assignment **or** if you need types to match in the signature (i.e. `add{T<:Integer}(x::T, y::T) = ...` will make sure x and y are the same type of integer) **or** if you want an abstract as the parameter of another type (i.e. `Base.push!{T<:Integer}(df::DataFrame, obj::Vector{T}) = ...` is appropriate)\r\n- It's inefficient to create a new one-row DataFrame just to then merge it with an existing DataFrame.  You can `push!()` any iterable of row values to a DataFrame and it will just push!()` each of those values to the columns.\r\n\r\n\r\nI'll make changes like these as I see them... If you have any questions on why I made a certain change, don't hesitate to talk it through here."},"comment":{"url":"https://api.github.com/repos/joshday/OnlineStats.jl/issues/comments/97160498","html_url":"https://github.com/joshday/OnlineStats.jl/issues/6#issuecomment-97160498","issue_url":"https://api.github.com/repos/joshday/OnlineStats.jl/issues/6","id":97160498,"user":{"login":"tbreloff","id":933338,"avatar_url":"https://avatars.githubusercontent.com/u/933338?v=3","gravatar_id":"","url":"https://api.github.com/users/tbreloff","html_url":"https://github.com/tbreloff","followers_url":"https://api.github.com/users/tbreloff/followers","following_url":"https://api.github.com/users/tbreloff/following{/other_user}","gists_url":"https://api.github.com/users/tbreloff/gists{/gist_id}","starred_url":"https://api.github.com/users/tbreloff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbreloff/subscriptions","organizations_url":"https://api.github.com/users/tbreloff/orgs","repos_url":"https://api.github.com/users/tbreloff/repos","events_url":"https://api.github.com/users/tbreloff/events{/privacy}","received_events_url":"https://api.github.com/users/tbreloff/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T18:16:52Z","updated_at":"2015-04-28T18:16:52Z","body":"I just checked the github page for compat... it looks like correct syntax might be:\r\n`weight(w::EqualWeighting, n1::Int, n2::Int) = n1 > 0 || n2 > 0 ? @compat Float64(n2 / (n1 + n2)) : 1.0`"}}