From 189cda07a8d2abcf3ac34c0075de6078f2f91b62 Mon Sep 17 00:00:00 2001 From: cossio Date: Fri, 10 Dec 2021 19:08:53 +0100 Subject: [PATCH 1/3] Increase Julia compat 1.3 Add CI testing on 1.3 (compat) and 1.6 (LTS). --- .github/workflows/ci.yml | 3 ++- Project.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbca8a0..5a29b32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,8 @@ jobs: fail-fast: false matrix: version: - - '1.0' + - '1.3' + - '1.6' - '1' - 'nightly' os: diff --git a/Project.toml b/Project.toml index c962cf8..760396e 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,7 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" LogExpFunctions = "0.3.2" NaNMath = "0.3" SpecialFunctions = "0.8, 0.9, 0.10, 1.0, 2" -julia = "1" +julia = "1.3" [extras] Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" From 6bfabc2f2818a879294842d724203cca22a60c2b Mon Sep 17 00:00:00 2001 From: cossio Date: Sat, 11 Dec 2021 15:38:56 +0100 Subject: [PATCH 2/3] bump minor version See: https://github.com/JuliaDiff/DiffRules.jl/pull/77#issuecomment-991192926 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 760396e..49d8e90 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DiffRules" uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.6.0" +version = "1.7.0" [deps] LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688" From c3e6ab3cb5faa3043b22603ca2b7d0fab2e23908 Mon Sep 17 00:00:00 2001 From: cossio Date: Sat, 11 Dec 2021 18:03:38 +0100 Subject: [PATCH 3/3] unnecessary branch --- src/rules.jl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/rules.jl b/src/rules.jl index d70b71e..c6f8e48 100644 --- a/src/rules.jl +++ b/src/rules.jl @@ -83,11 +83,7 @@ _abs_deriv(x) = signbit(x) ? -one(x) : one(x) @define_diffrule Base.:\(x, y) = :( -($y / $x / $x) ), :( one($y) / ($x) ) @define_diffrule Base.:^(x, y) = :( $y * ($x^($y - 1)) ), :( ($x isa Real && $x<=0) ? Base.oftype(float($x), NaN) : ($x^$y)*log($x) ) -if VERSION < v"0.7-" - @define_diffrule Base.atan2(x, y) = :( $y / ($x^2 + $y^2) ), :( -$x / ($x^2 + $y^2) ) -else - @define_diffrule Base.atan(x, y) = :( $y / ($x^2 + $y^2) ), :( -$x / ($x^2 + $y^2) ) -end +@define_diffrule Base.atan(x, y) = :( $y / ($x^2 + $y^2) ), :( -$x / ($x^2 + $y^2) ) @define_diffrule Base.hypot(x, y) = :( $x / hypot($x, $y) ), :( $y / hypot($x, $y) ) @define_diffrule Base.log(b, x) = :( log($x) * inv(-log($b)^2 * $b) ), :( inv($x) / log($b) )