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

Commit

Permalink
Fixes for 0.6 (#235)
Browse files Browse the repository at this point in the history
* Updates for Julia 0.6

Rewrite broadcast as generated function to avoid world age problems.
Use some of the broadcast functionality in Base.

Update getindex and setindex to Base changes. Use generated functions
instead of @nsplat. Use some of the Base machinery for getindex

Fix many syntax deprecations

* Remove Compat code

* Fix broadcast warnings and remove unused operator groups form operators.jl

* Use iteration instead of indexing into indices in setindex to avoid
deprecation warning

* Adjust CI

* Reenable precompilation

Add SpecialFunctions as dependency

Use new type keywords

* Use @inline instead of @generate when possible

* Now, erf, erfc, and digamma are in SpecialFunctions instead of Base

* Intialize arrays with all NAs. Flip bits _unsafe_getindex.

* Define linearindexing for Type{T} instead of T

* Update ! -> .! and remove commented out tests

* Reenable Compat. Necessary for old @nsplat and @ngenerate macros

* Make broadcast work for scalar Strings

* Update syntax for indexing traits
  • Loading branch information
andreasnoack authored Feb 17, 2017
1 parent 2f235b4 commit 2a83487
Show file tree
Hide file tree
Showing 28 changed files with 631 additions and 1,133 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: julia
julia:
- 0.4
- 0.5
# - 0.6
- nightly
os:
- linux
Expand Down
5 changes: 3 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
julia 0.4
StatsBase 0.3
julia 0.6-
Compat 0.8.6
StatsBase 0.3
Reexport
SpecialFunctions
6 changes: 2 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
environment:
matrix:
- JULIAVERSION: "julialang/bin/winnt/x86/0.4/julia-0.4-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe"
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
# - JULIAVERSION: "julialang/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
# - JULIAVERSION: "julialang/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"

Expand Down
12 changes: 3 additions & 9 deletions src/DataArrays.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
__precompile__()

module DataArrays
using Base: promote_op
using Base.Cartesian, Compat, Reexport
import Compat.String
@reexport using StatsBase
using SpecialFunctions

const DEFAULT_POOLED_REF_TYPE = UInt32

import Base: ==, !=, >, <, >=, <=, +, -, *, !, &, |, $, ^, /,
.==, .!=, .>, .<, .>=, .<=, .+, .-, .*, .%, ./, .\, .^
import Base: ==, !=, >, <, >=, <=, +, -, *, !, &, |, $, ^, /

import StatsBase: autocor, inverse_rle, rle

Expand Down Expand Up @@ -80,10 +80,4 @@ module DataArrays
include("predicates.jl")
include("literals.jl")
include("deprecated.jl")

Base.@deprecate removeNA dropna
Base.@deprecate each_failNA each_failna
Base.@deprecate each_replaceNA each_replacena
Base.@deprecate set_levels setlevels
Base.@deprecate set_levels! setlevels!
end
12 changes: 6 additions & 6 deletions src/abstractdataarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
#'
#' An AbstractDataArray is an Array whose entries can take on
#' values of type `T` or the value `NA`.
abstract AbstractDataArray{T, N} <: AbstractArray{T, N}
abstract type AbstractDataArray{T, N} <: AbstractArray{T, N} end

#' @description
#'
#' An AbstractDataVector is an AbstractDataArray of order 1.
typealias AbstractDataVector{T} AbstractDataArray{T, 1}
const AbstractDataVector{T} = AbstractDataArray{T, 1}

#' @description
#'
#' An AbstractDataMatrix is an AbstractDataArray of order 2.
typealias AbstractDataMatrix{T} AbstractDataArray{T, 2}
const AbstractDataMatrix{T} = AbstractDataArray{T, 2}

#' @description
#' Determine the type of the elements of an AbstractDataArray.
Expand Down Expand Up @@ -121,7 +121,7 @@ dropna(v::AbstractVector) = copy(v) # -> AbstractVector
# TODO: Use values()
# Use DataValueIterator type?

type EachFailNA{T}
struct EachFailNA{T}
da::AbstractDataArray{T}
end
each_failna{T}(da::AbstractDataArray{T}) = EachFailNA(da)
Expand All @@ -136,7 +136,7 @@ function Base.next(itr::EachFailNA, ind::Integer)
end
end

type EachDropNA{T}
struct EachDropNA{T}
da::AbstractDataArray{T}
end
each_dropna{T}(da::AbstractDataArray{T}) = EachDropNA(da)
Expand All @@ -154,7 +154,7 @@ function Base.next(itr::EachDropNA, ind::Int)
(itr.da[ind], _next_nonna_ind(itr.da, ind))
end

type EachReplaceNA{S, T}
struct EachReplaceNA{S, T}
da::AbstractDataArray{S}
replacement::T
end
Expand Down
Loading

0 comments on commit 2a83487

Please sign in to comment.