Skip to content

Commit

Permalink
Drop compatibility with Julia versions below LTS (#204)
Browse files Browse the repository at this point in the history
* Simplify package extensions

* Remove version conditionals for Julia <1.10
  • Loading branch information
adrhill authored Oct 9, 2024
1 parent 387245a commit b172a4c
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 302 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ jobs:
- Core
- Benchmarks
- NLPModels
exclude: # TODO: remove once LTS is not 1.6
- version: 'lts'
group: NLPModels
- version: 'lts'
group: Benchmarks
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
Expand Down
13 changes: 2 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name = "SparseConnectivityTracer"
uuid = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
authors = ["Adrian Hill <[email protected]>"]
version = "0.6.6"
version = "0.6.7-DEV"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[weakdeps]
Expand All @@ -36,14 +35,6 @@ LogExpFunctions = "0.3.28"
NNlib = "0.8, 0.9"
NaNMath = "1"
Random = "<0.0.1, 1"
Requires = "1.3"
SparseArrays = "<0.0.1, 1"
SpecialFunctions = "2.4"
julia = "1.6"

[extras]
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
julia = "1.10"
54 changes: 17 additions & 37 deletions ext/SparseConnectivityTracerDataInterpolationsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,23 @@
# copy another, less complicated one!
module SparseConnectivityTracerDataInterpolationsExt

if isdefined(Base, :get_extension)
using SparseConnectivityTracer: AbstractTracer, Dual, primal, tracer
using SparseConnectivityTracer: GradientTracer, gradient_tracer_1_to_1
using SparseConnectivityTracer: HessianTracer, hessian_tracer_1_to_1
using FillArrays: Fill # from FillArrays.jl
import DataInterpolations:
LinearInterpolation,
QuadraticInterpolation,
LagrangeInterpolation,
AkimaInterpolation,
ConstantInterpolation,
QuadraticSpline,
CubicSpline,
BSplineInterpolation,
BSplineApprox,
CubicHermiteSpline,
# PCHIPInterpolation,
QuinticHermiteSpline
else
using ..SparseConnectivityTracer: AbstractTracer, Dual, primal, tracer
using ..SparseConnectivityTracer: GradientTracer, gradient_tracer_1_to_1
using ..SparseConnectivityTracer: HessianTracer, hessian_tracer_1_to_1
using ..FillArrays: Fill # from FillArrays.jl
import ..DataInterpolations:
LinearInterpolation,
QuadraticInterpolation,
LagrangeInterpolation,
AkimaInterpolation,
ConstantInterpolation,
QuadraticSpline,
CubicSpline,
BSplineInterpolation,
BSplineApprox,
CubicHermiteSpline,
# PCHIPInterpolation,
QuinticHermiteSpline
end
using SparseConnectivityTracer: AbstractTracer, Dual, primal, tracer
using SparseConnectivityTracer: GradientTracer, gradient_tracer_1_to_1
using SparseConnectivityTracer: HessianTracer, hessian_tracer_1_to_1
using FillArrays: Fill # from FillArrays.jl
import DataInterpolations:
LinearInterpolation,
QuadraticInterpolation,
LagrangeInterpolation,
AkimaInterpolation,
ConstantInterpolation,
QuadraticSpline,
CubicSpline,
BSplineInterpolation,
BSplineApprox,
CubicHermiteSpline,
# PCHIPInterpolation,
QuinticHermiteSpline

#========================#
# General interpolations #
Expand Down
84 changes: 27 additions & 57 deletions ext/SparseConnectivityTracerLogExpFunctionsExt.jl
Original file line number Diff line number Diff line change
@@ -1,62 +1,32 @@
module SparseConnectivityTracerLogExpFunctionsExt

if isdefined(Base, :get_extension)
import SparseConnectivityTracer as SCT
using LogExpFunctions:
LogExpFunctions,
cexpexp,
cloglog,
log1mexp,
log1mlogistic,
log1pexp,
log1pmx,
log1psq,
log2mexp,
logabssinh,
logaddexp,
logcosh,
logexpm1,
logistic,
logit,
logit1mexp,
logitexp,
loglogistic,
logmxp1,
logsubexp,
xexpx,
xexpy,
xlog1py,
xlogx,
xlogy
else
import ..SparseConnectivityTracer as SCT
using ..LogExpFunctions:
LogExpFunctions,
cexpexp,
cloglog,
log1mexp,
log1mlogistic,
log1pexp,
log1pmx,
log1psq,
log2mexp,
logabssinh,
logaddexp,
logcosh,
logexpm1,
logistic,
logit,
logit1mexp,
logitexp,
loglogistic,
logmxp1,
logsubexp,
xexpx,
xexpy,
xlog1py,
xlogx,
xlogy
end
import SparseConnectivityTracer as SCT
using LogExpFunctions:
LogExpFunctions,
cexpexp,
cloglog,
log1mexp,
log1mlogistic,
log1pexp,
log1pmx,
log1psq,
log2mexp,
logabssinh,
logaddexp,
logcosh,
logexpm1,
logistic,
logit,
logit1mexp,
logitexp,
loglogistic,
logmxp1,
logsubexp,
xexpx,
xexpy,
xlog1py,
xlogx,
xlogy

## 1-to-1 functions

Expand Down
81 changes: 26 additions & 55 deletions ext/SparseConnectivityTracerNNlibExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,32 @@
# Parametric activation functions with two or more arguments are ignored.
module SparseConnectivityTracerNNlibExt

if isdefined(Base, :get_extension)
import SparseConnectivityTracer as SCT
using NNlib:
NNlib,
celu,
elu,
gelu,
hardswish,
hardtanh,
hardσ,
leakyrelu,
lisht,
logcosh,
logσ,
mish,
relu,
relu6,
selu,
sigmoid_fast,
softplus,
softshrink,
softsign,
swish,
tanh_fast,
tanhshrink,
trelu,
σ
else
import ..SparseConnectivityTracer as SCT
using ..NNlib:
NNlib,
celu,
elu,
gelu,
hardswish,
hardtanh,
hardσ,
leakyrelu,
lisht,
logcosh,
logσ,
mish,
relu,
relu6,
selu,
sigmoid_fast,
softplus,
softshrink,
softsign,
swish,
tanh_fast,
tanhshrink,
trelu,
σ
end
import SparseConnectivityTracer as SCT
using NNlib:
NNlib,
celu,
elu,
gelu,
hardswish,
hardtanh,
hardσ,
leakyrelu,
lisht,
logcosh,
logσ,
mish,
relu,
relu6,
selu,
sigmoid_fast,
softplus,
softshrink,
softsign,
swish,
tanh_fast,
tanhshrink,
trelu,
σ

## 1-to-1

Expand Down
9 changes: 2 additions & 7 deletions ext/SparseConnectivityTracerNaNMathExt.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
module SparseConnectivityTracerNaNMathExt

if isdefined(Base, :get_extension)
import SparseConnectivityTracer as SCT
using NaNMath: NaNMath
else
import ..SparseConnectivityTracer as SCT
using ..NaNMath: NaNMath
end
import SparseConnectivityTracer as SCT
using NaNMath: NaNMath

## 1-to-1

Expand Down
Loading

0 comments on commit b172a4c

Please sign in to comment.