Skip to content

Commit

Permalink
Require Julia v0.7.0-beta2 (#395)
Browse files Browse the repository at this point in the history
* Require Julia v0.7.0-beta2 (Statistics stdlib)

This permits massive code deletion.

* Use the fancy new AppVeyor setup from JuliaCI/AppVeyor.jl

* Fix mapslices deprecations
  • Loading branch information
ararslan committed Jul 16, 2018
1 parent 11a4439 commit cc9ad6e
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 1,345 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
julia 0.7.0-alpha
julia 0.7.0-beta2
DataStructures 0.5.0
SortingAlgorithms
Missings
38 changes: 17 additions & 21 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
environment:
matrix:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.7/julia-0.7-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.7/julia-0.7-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
- julia_version: 0.7
- julia_version: latest

platform:
- x86
- x64

## uncomment the following lines to allow failures on nightly julia
## (tests will run but not make your overall status red)
#matrix:
# allow_failures:
# - julia_version: latest

branches:
only:
Expand All @@ -17,24 +25,12 @@ notifications:
on_build_status_changed: false

install:
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
# If there's a newer build queued for the same PR, cancel this one
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
# Download most recent Julia Windows binary
- ps: (new-object net.webclient).DownloadFile(
$env:JULIA_URL,
"C:\projects\julia-binary.exe")
# Run installer silently, output to C:\projects\julia
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/master/bin/install.ps1'))

build_script:
# Need to convert from shallow to complete for Pkg.clone to work
- IF EXIST .git\shallow (git fetch --unshallow)
- C:\projects\julia\bin\julia -e "versioninfo();
Pkg.clone(pwd(), \"StatsBase\"); Pkg.build(\"StatsBase\")"
- echo "%JL_BUILD_SCRIPT%"
- julia -e "%JL_BUILD_SCRIPT%"

test_script:
- C:\projects\julia\bin\julia -e "Pkg.test(\"StatsBase\")"
- echo "%JL_TEST_SCRIPT%"
- julia -e "%JL_TEST_SCRIPT%"
31 changes: 4 additions & 27 deletions src/StatsBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,16 @@ module StatsBase
using SortingAlgorithms
using Missings

if VERSION >= v"0.7.0-beta.85"
using Statistics
import Statistics: mean, mean!, var, varm, varm!, std, stdm, cov, covm,
cor, corm, cov2cor!, unscaled_covzm, quantile, sqrt!,
median, middle
else
import Base: mean, mean!, var, varm, varm!, std, stdm, cov, covm,
cor, corm, cov2cor!, unscaled_covzm, quantile, sqrt!,
median, middle
end

# Location of the `mean` function, used for calling the function inside of
# functions definitions that have `mean` as a keyword argument
const MEANHOME = (VERSION >= v"0.7.0-beta.85" ? Statistics : Base)::Module

using Statistics
using LinearAlgebra
using Random
using Printf
using SparseArrays
import Random: rand, rand!
import LinearAlgebra: BlasReal, BlasFloat
import Statistics: mean, mean!, var, varm, varm!, std, stdm, cov, covm,
cor, corm, cov2cor!, unscaled_covzm, quantile, sqrt!,
median, middle

## tackle compatibility issues

Expand Down Expand Up @@ -206,18 +195,6 @@ module StatsBase

ConvergenceException

const BASESTATS_IN_STATSBASE = v"0.7.0-DEV.5238" <= VERSION < v"0.7.0-beta.85"

@static if BASESTATS_IN_STATSBASE
export cor, cov, std, stdm, var, varm, linreg
include("base.jl")
end

module StatsCompat
import ..StatsBase: var, std, varm, cov, cor, MEANHOME
end
export StatsCompat

# source files

include("common.jl")
Expand Down
Loading

0 comments on commit cc9ad6e

Please sign in to comment.