Skip to content

Commit 4da2f9b

Browse files
authored
Merge pull request #127 from tanmaykm/tan/fixjulia10
fixes for Julia 1.0
2 parents 1124541 + 40d2e33 commit 4da2f9b

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ os:
55
- osx
66
julia:
77
- 0.6
8+
- 0.7
89
- nightly
910
notifications:
1011
email: false

src/derivative.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ derivative(f, dtype::Symbol = :central) = derivative(f, :scalar, dtype)
1313
gradient(f, x::Union{T, Vector{T}}, dtype::Symbol = :central) where {T <: Number} = finite_difference(f, float(x), dtype)
1414
gradient(f, dtype::Symbol = :central) = derivative(f, :vector, dtype)
1515

16+
@static if isdefined(Compat.LinearAlgebra, :gradient)
1617
function Compat.LinearAlgebra.gradient(f, x::Union{T, Vector{T}}, dtype::Symbol = :central) where T <: Number
1718
Base.depwarn("The finite difference methods from Calculus.jl no longer extend " *
1819
"Base.gradient and should be called as Calculus.gradient instead. " *
@@ -26,6 +27,7 @@ function Compat.LinearAlgebra.gradient(f, dtype::Symbol = :central)
2627
"This usage is deprecated.", :gradient)
2728
Calculus.gradient(f,dtype)
2829
end
30+
end
2931

3032
if isdefined(Base, :adjoint)
3133
Base.adjoint(f::Function) = derivative(f)

src/symbolic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function simplify(ex::Expr)
9393
return ex
9494
end
9595
if all(isnumber, ex.args[2:end]) && length(ex.args) > 1
96-
return eval(@__MODULE__, ex)
96+
return (@static (VERSION < v"0.7.0-DEV.5149") ? eval : Core.eval)(@__MODULE__, ex)
9797
end
9898
new_ex = simplify(SymbolParameter(ex.args[1]), ex.args[2:end])
9999
while !(isequal(new_ex, ex))

0 commit comments

Comments
 (0)