Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Commit 30010f2

Browse files
authored
Merge pull request #255 from tkelman/tk/deprecation-backport
[release-0.4] backport of deprecation fix (#254) and CI updates (#253)
2 parents 2f235b4 + 1a4e104 commit 30010f2

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: julia
22
julia:
3-
- 0.4
43
- 0.5
54
- nightly
65
os:

REQUIRE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
julia 0.4
2-
StatsBase 0.3
1+
julia 0.5
2+
StatsBase 0.15
33
Compat 0.8.6
44
Reexport

appveyor.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
environment:
22
matrix:
3-
- JULIAVERSION: "julialang/bin/winnt/x86/0.4/julia-0.4-latest-win32.exe"
4-
- JULIAVERSION: "julialang/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe"
5-
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
6-
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
7-
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
8-
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"
3+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
4+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
5+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
6+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
97

108
branches:
119
only:
1210
- master
1311
- /julia-.*/
12+
- /release-.*/
1413

1514
notifications:
1615
- provider: Email
@@ -19,14 +18,15 @@ notifications:
1918
on_build_status_changed: false
2019

2120
install:
21+
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
2222
# if there's a newer build queued for the same PR, cancel this one
2323
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
2424
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
2525
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
2626
throw "There are newer queued builds for this pull request, failing early." }
2727
# Download most recent Julia Windows binary
2828
- ps: (new-object net.webclient).DownloadFile(
29-
$("http://s3.amazonaws.com/"+$env:JULIAVERSION),
29+
$env:JULIA_URL,
3030
"C:\projects\julia-binary.exe")
3131
# Run installer silently, output to C:\projects\julia
3232
- C:\projects\julia-binary.exe /S /D=C:\projects\julia

src/extras.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function StatsBase.addcounts!{T,U}(cm::Dict{U,Int}, x::AbstractDataArray{T})
55
return cm
66
end
77

8-
function StatsBase.addcounts!{T,U,W}(cm::Dict{U,W}, x::AbstractDataArray{T}, wv::WeightVec{W})
8+
function StatsBase.addcounts!{T,U,W}(cm::Dict{U,W}, x::AbstractDataArray{T}, wv::Weights{W})
99
n = length(x)
1010
length(wv) == n || raise_dimerror()
1111
w = values(wv)
@@ -23,7 +23,7 @@ function StatsBase.countmap{T}(x::AbstractDataArray{T})
2323
addcounts!(Dict{(@compat Union{T, NAtype}), Int}(), x)
2424
end
2525

26-
function StatsBase.countmap{T,W}(x::AbstractDataArray{T}, wv::WeightVec{W})
26+
function StatsBase.countmap{T,W}(x::AbstractDataArray{T}, wv::Weights{W})
2727
addcounts!(Dict{(@compat Union{T, NAtype}), W}(), x, wv)
2828
end
2929

src/reduce.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Base.std(A::DataArray; corrected::Bool=true, mean=nothing, skipna::Bool=false) =
175175

176176
## weighted mean
177177

178-
function Base.mean(a::DataArray, w::WeightVec; skipna::Bool=false)
178+
function Base.mean(a::DataArray, w::Weights; skipna::Bool=false)
179179
if skipna
180180
v = a .* w.values
181181
sum(v; skipna=true) / sum(DataArray(w.values, v.na); skipna=true)
@@ -184,7 +184,7 @@ function Base.mean(a::DataArray, w::WeightVec; skipna::Bool=false)
184184
end
185185
end
186186

187-
function Base.mean{W,V<:DataArray}(a::DataArray, w::WeightVec{W,V}; skipna::Bool=false)
187+
function Base.mean{W,V<:DataArray}(a::DataArray, w::Weights{W,V}; skipna::Bool=false)
188188
if skipna
189189
v = a .* w.values
190190
sum(v; skipna=true) / sum(DataArray(w.values.data, v.na); skipna=true)

test/reduce.jl

-1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,5 @@ da1[1:3:end] = NA
164164

165165
da2[1:2:end] = NA
166166
keep = !da1.na & !da2.na
167-
@test isna(mean(da1, weights(da2)))
168167
@same_behavior mean(da1, weights(da2); skipna=true) mean(da1.data[keep], weights(da2.data[keep]))
169168
end

0 commit comments

Comments
 (0)