Skip to content

Commit

Permalink
Merge pull request #8 from JuliaAstro/julia-0.6
Browse files Browse the repository at this point in the history
Update for Julia 0.6
  • Loading branch information
giordano committed Mar 2, 2017
2 parents 4ea8c30 + c10123a commit 5c2819b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 12 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia
os:
- linux
- linux
- osx
julia:
- 0.4
- 0.5
- nightly
- 0.5
- 0.6
- nightly
notifications:
email: false
script:
Expand Down
5 changes: 3 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
julia 0.4
Compat 0.8.6
julia 0.5
Compat 0.17.0
QuadGK 0.1.1
36 changes: 36 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
environment:
matrix:
- 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"

branches:
only:
- master
- /release-.*/

notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false

install:
# Download most recent Julia Windows binary
- ps: (new-object net.webclient).DownloadFile(
$("http://s3.amazonaws.com/"+$env:JULIAVERSION),
"C:\projects\julia-binary.exe")
# Run installer silently, output to C:\projects\julia
- C:\projects\julia-binary.exe /S /D=C:\projects\julia

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(), \"Cosmology\"); Pkg.build(\"Cosmology\")"

test_script:
- C:\projects\julia\bin\julia --check-bounds=yes -e "Pkg.test(\"Cosmology\")"
13 changes: 7 additions & 6 deletions src/Cosmology.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Cosmology

using Compat
using QuadGK

export cosmology,
age_gyr,
Expand All @@ -16,10 +17,10 @@ export cosmology,
lookback_time_gyr,
scale_factor

abstract AbstractCosmology
abstract AbstractClosedCosmology <: AbstractCosmology
abstract AbstractFlatCosmology <: AbstractCosmology
abstract AbstractOpenCosmology <: AbstractCosmology
@compat abstract type AbstractCosmology end
@compat abstract type AbstractClosedCosmology <: AbstractCosmology end
@compat abstract type AbstractFlatCosmology <: AbstractCosmology end
@compat abstract type AbstractOpenCosmology <: AbstractCosmology end

immutable FlatLCDM{T<:Real} <: AbstractFlatCosmology
h::T
Expand Down Expand Up @@ -141,7 +142,7 @@ hubble_time_gyr(c::AbstractCosmology, z) = hubble_time_gyr0(c)/E(c,z)

# distances

Z(c::AbstractCosmology, z::Real) = ((q,_) = quadgk(a::Float64->1.0/a2E(c,a), scale_factor(z), 1); q)
Z(c::AbstractCosmology, z::Real) = ((q,_) = QuadGK.quadgk(a::Float64->1.0/a2E(c,a), scale_factor(z), 1); q)

comoving_radial_dist_mpc(c::AbstractCosmology, z) = hubble_dist_mpc0(c)*Z(c, z)

Expand Down Expand Up @@ -187,7 +188,7 @@ comoving_volume_element_gpc3(c::AbstractCosmology, z) =

# times

T(c::AbstractCosmology, a0::Float64, a1::Float64) = ((q,_) = quadgk(x::Float64->x/a2E(c,x), a0, a1); q)
T(c::AbstractCosmology, a0::Float64, a1::Float64) = ((q,_) = QuadGK.quadgk(x::Float64->x/a2E(c,x), a0, a1); q)
age_gyr(c::AbstractCosmology, z) = hubble_time_gyr0(c)*T(c, 0., scale_factor(z))
lookback_time_gyr(c::AbstractCosmology, z) = hubble_time_gyr0(c)*T(c, scale_factor(z), 1.)

Expand Down

0 comments on commit 5c2819b

Please sign in to comment.