Skip to content

Commit 1cff140

Browse files
Merge pull request #458 from ArnoStrouwen/ci
More CI
2 parents aa744e5 + 3fd8d0b commit 1cff140

File tree

7 files changed

+70
-17
lines changed

7 files changed

+70
-17
lines changed

.github/workflows/Downgrade.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Downgrade
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
paths-ignore:
7+
- 'docs/**'
8+
push:
9+
branches:
10+
- master
11+
paths-ignore:
12+
- 'docs/**'
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
version: ['1']
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: julia-actions/setup-julia@v1
22+
with:
23+
version: ${{ matrix.version }}
24+
- uses: cjdoris/julia-downgrade-compat-action@v1
25+
# if: ${{ matrix.version == '1.6' }}
26+
with:
27+
skip: Pkg,TOML
28+
- uses: julia-actions/julia-buildpkg@v1
29+
- uses: julia-actions/julia-runtest@v1

Project.toml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,29 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1515
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
1616

1717
[compat]
18-
Distributions = "0.21, 0.22, 0.23, 0.24, 0.25"
18+
Aqua = "0.8"
19+
Cubature = "1.5"
20+
Distributions = "0.25.71"
1921
ExtendableSparse = "1"
20-
Flux = "0.12, 0.13"
21-
GLM = "1.3"
22+
Flux = "0.13"
23+
ForwardDiff = "0.10.19"
24+
GLM = "1.5"
2225
IterativeSolvers = "0.9"
23-
PolyChaos = "0.2"
24-
QuasiMonteCarlo = "0.3"
25-
Statistics = "1"
26-
Zygote = "0.4, 0.5, 0.6"
27-
julia = "1.9"
26+
LinearAlgebra = "1.10"
27+
PolyChaos = "0.2.5"
28+
Pkg = "1"
29+
QuadGK = "2.4"
30+
QuasiMonteCarlo = "0.3.1"
31+
SafeTestsets = "0.1"
32+
SparseArrays = "1.10"
33+
Statistics = "1.10"
34+
Test = "1"
35+
Tracker = "0.2.18"
36+
Zygote = "0.6.62"
37+
julia = "1.10"
2838

2939
[extras]
40+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3041
Cubature = "667455a9-e2ce-5579-9412-b964f529a492"
3142
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
3243
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
@@ -38,4 +49,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3849
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
3950

4051
[targets]
41-
test = ["Cubature", "SafeTestsets", "Flux", "ForwardDiff", "PolyChaos", "QuadGK", "Test", "Tracker", "Pkg"]
52+
test = ["Aqua", "Cubature", "SafeTestsets", "Flux", "ForwardDiff", "PolyChaos", "QuadGK", "Test", "Tracker", "Pkg"]

src/Optimization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,7 @@ function surrogate_optimize(obj, rtea::RTEA, lb, ub, surrRTEAND::AbstractSurroga
20452045
return pareto_set, pareto_front
20462046
end
20472047

2048-
function surrogate_optimize(obj::Function, ::EI, lb, ub, krig, sample_type::SectionSample;
2048+
function surrogate_optimize(obj::Function, ::EI, lb::AbstractArray, ub::AbstractArray, krig, sample_type::SectionSample;
20492049
maxiters = 100, num_new_samples = 100)
20502050
dtol = 1e-3 * norm(ub - lb)
20512051
eps = 0.01

src/Radials.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using LinearAlgebra
22
using ExtendableSparse
33

4-
Base.copy(t::Tuple) = t
4+
_copy(t::Tuple) = t
5+
_copy(t) = copy(t)
56

67
mutable struct RadialBasis{F, Q, X, Y, L, U, C, S, D} <: AbstractSurrogate
78
phi::F
@@ -58,9 +59,9 @@ function _calc_coeffs(x, y, lb, ub, phi, q, scale_factor, sparse)
5859
D = _construct_rbf_interp_matrix(x, first(x), lb, ub, phi, q, scale_factor, sparse)
5960
Y = _construct_rbf_y_matrix(y, first(y), length(y) + num_poly_terms)
6061
if (typeof(y) == Vector{Float64}) #single output case
61-
coeff = copy(transpose(D \ y))
62+
coeff = _copy(transpose(D \ y))
6263
else
63-
coeff = copy(transpose(D \ Y[1:size(D)[1], :])) #if y is multi output;
64+
coeff = _copy(transpose(D \ Y[1:size(D)[1], :])) #if y is multi output;
6465
end
6566
return coeff
6667
end

src/Surrogates.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export LobachevskyStructure,
8989
SecondOrderPolynomialStructure
9090
export WendlandStructure
9191
export AbstractSurrogate, SamplingAlgorithm
92-
export Kriging, RadialBasis, add_point!, current_estimate, std_error_at_point
92+
export Kriging, RadialBasis, add_point!, std_error_at_point
9393
# Parallelization Strategies
9494
export potential_optimal_points
9595
export MinimumConstantLiar, MaximumConstantLiar, MeanConstantLiar, KrigingBeliever,
@@ -104,10 +104,9 @@ export sample, GridSample, RandomSample, SobolSample, LatinHypercubeSample,
104104
export RandomSample, KroneckerSample, GoldenSample, SectionSample
105105

106106
# Optimization algorithms
107-
export SRBF, LCBS, EI, DYCORS, SOP, EGO, RTEA, SMB, surrogate_optimize
107+
export SRBF, LCBS, EI, DYCORS, SOP, RTEA, SMB, surrogate_optimize
108108
export LobachevskySurrogate, lobachevsky_integral, lobachevsky_integrate_dimension
109109
export LinearSurrogate
110-
export SVMSurrogate
111110
export InverseDistanceSurrogate
112111
export SecondOrderPolynomialSurrogate
113112
export Wendland

test/qa.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Surrogates, Aqua
2+
@testset "Aqua" begin
3+
Aqua.find_persistent_tasks_deps(Surrogates)
4+
Aqua.test_ambiguities(Surrogates, recursive = false)
5+
Aqua.test_deps_compat(Surrogates)
6+
Aqua.test_piracies(Surrogates)
7+
Aqua.test_project_extras(Surrogates)
8+
Aqua.test_stale_deps(Surrogates)
9+
Aqua.test_unbound_args(Surrogates)
10+
Aqua.test_undefined_exports(Surrogates)
11+
end

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ using Surrogates
22
using Test
33
using SafeTestsets
44
using Pkg
5-
VERSION <= v"1.7" && Pkg.add(name = "Statistics", version = VERSION)
65

76
function dev_subpkg(subpkg)
87
subpkg_path = joinpath(dirname(@__DIR__), "lib", subpkg)
98
Pkg.develop(PackageSpec(path = subpkg_path))
109
end
1110

1211
@testset "Surrogates" begin
12+
@safetestset "Quality Assurance" begin
13+
include("qa.jl")
14+
end
1315
@testset "Libs" begin
1416
@testset "$pkg" for pkg in [
1517
"SurrogatesAbstractGPs", "SurrogatesFlux",

0 commit comments

Comments
 (0)