Skip to content

Commit

Permalink
Fix 0.6 abstract type declaration depwarn (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao authored and ararslan committed Feb 11, 2017
1 parent f807e01 commit e2dc761
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
julia 0.5
Compat 0.13.0
DataStructures 0.5.0
Compat 0.17.0
DataStructures 0.5.0
7 changes: 4 additions & 3 deletions perf/sampling.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Benchmark on non-weighted sampling
# Benchmark on non-weighted sampling

# require the BenchmarkLite package
using BenchmarkLite
using StatsBase
using Compat

import StatsBase: direct_sample!, xmultinom_sample!
import StatsBase: knuths_sample!, fisher_yates_sample!, self_avoid_sample!
Expand All @@ -12,8 +13,8 @@ import StatsBase: seqsample_a!, seqsample_c!

type SampleProc{Alg} <: Proc end

abstract WithRep
abstract NoRep
@compat abstract type WithRep end
@compat abstract type NoRep end

type Direct <: WithRep end
tsample!(s::Direct, a, x) = direct_sample!(a, x)
Expand Down
5 changes: 3 additions & 2 deletions perf/wsampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

using BenchmarkLite
using StatsBase
using Compat

import StatsBase: direct_sample!, alias_sample!, xmultinom_sample!

### procedure definition

type WSampleProc{Alg} <: Proc end

abstract WithRep
abstract NoRep
@compat abstract type WithRep end
@compat abstract type NoRep end

type Direct <: WithRep end
tsample!(s::Direct, wv, x) = direct_sample!(1:length(wv), wv, x)
Expand Down
2 changes: 1 addition & 1 deletion src/hist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function sturges(n) # Sturges' formula
ceil(Integer, log2(n))+1
end

abstract AbstractHistogram{T<:Real,N,E}
@compat abstract type AbstractHistogram{T<:Real,N,E} end

# N-dimensional histogram object
type Histogram{T<:Real,N,E} <: AbstractHistogram{T,N,E}
Expand Down
4 changes: 2 additions & 2 deletions src/statmodels.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Statistical Models

abstract StatisticalModel
@compat abstract type StatisticalModel end

coef(obj::StatisticalModel) = error("coef is not defined for $(typeof(obj)).")
coeftable(obj::StatisticalModel) = error("coeftable is not defined for $(typeof(obj)).")
Expand Down Expand Up @@ -145,7 +145,7 @@ end

const adjr² = adjr2

abstract RegressionModel <: StatisticalModel
@compat abstract type RegressionModel <: StatisticalModel end

fitted(obj::RegressionModel) = error("fitted is not defined for $(typeof(obj)).")
model_response(obj::RegressionModel) = error("model_response is not defined for $(typeof(obj)).")
Expand Down

0 comments on commit e2dc761

Please sign in to comment.