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

Commit

Permalink
Fix isna(::DataArray) deprecation (#252)
Browse files Browse the repository at this point in the history
The deprecation wasn't used as the varargs isa(::DataArray, ::Real...) method
unexpectedly took precedence. It shouldn't apply when there are zero indices,
so change its signature to reflect this.

Get rid of the at-nsplat call which isn't needed here (and no longer used in
Julia Base).
  • Loading branch information
nalimilan authored and ararslan committed May 8, 2017
1 parent e074247 commit a65398b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/dataarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,13 @@ function Base.convert{T, N}(::Type{Array}, da::DataArray{T, N}, replacement::Any
end

dropna(dv::DataVector) = dv.data[.!dv.na] # -> Vector
isna(da::DataArray, I::Real) = getindex(da.na, I)

Base.broadcast(::typeof(isna), da::DataArray) = copy(da.na)

Base.any(::typeof(isna), da::DataArray) = any(da.na) # -> Bool
Base.all(::typeof(isna), da::DataArray) = all(da.na) # -> Bool

@nsplat N function isna(da::DataArray, I::NTuple{N,Real}...)
getindex(da.na, I...)
end
isna(da::DataArray, I::Real, Is::Real...) = getindex(da.na, I, Is...)

function Base.isfinite(da::DataArray) # -> DataArray{Bool}
n = length(da)
Expand Down

0 comments on commit a65398b

Please sign in to comment.