Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More CI #458

Merged
merged 4 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Downgrade
on:
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
push:
branches:
- master
paths-ignore:
- 'docs/**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['1']
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
- uses: cjdoris/julia-downgrade-compat-action@v1
# if: ${{ matrix.version == '1.6' }}
with:
skip: Pkg,TOML
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
29 changes: 20 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,29 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
Distributions = "0.21, 0.22, 0.23, 0.24, 0.25"
Aqua = "0.8"
Cubature = "1.5"
Distributions = "0.25.71"
ExtendableSparse = "1"
Flux = "0.12, 0.13"
GLM = "1.3"
Flux = "0.13"
ForwardDiff = "0.10.19"
GLM = "1.5"
IterativeSolvers = "0.9"
PolyChaos = "0.2"
QuasiMonteCarlo = "0.3"
Statistics = "1"
Zygote = "0.4, 0.5, 0.6"
julia = "1.9"
LinearAlgebra = "1.10"
PolyChaos = "0.2.5"
Pkg = "1"
QuadGK = "2.4"
QuasiMonteCarlo = "0.3.1"
SafeTestsets = "0.1"
SparseArrays = "1.10"
Statistics = "1.10"
Test = "1"
Tracker = "0.2.18"
Zygote = "0.6.62"
julia = "1.10"

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

[targets]
test = ["Cubature", "SafeTestsets", "Flux", "ForwardDiff", "PolyChaos", "QuadGK", "Test", "Tracker", "Pkg"]
test = ["Aqua", "Cubature", "SafeTestsets", "Flux", "ForwardDiff", "PolyChaos", "QuadGK", "Test", "Tracker", "Pkg"]
2 changes: 1 addition & 1 deletion src/Optimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2045,7 +2045,7 @@ function surrogate_optimize(obj, rtea::RTEA, lb, ub, surrRTEAND::AbstractSurroga
return pareto_set, pareto_front
end

function surrogate_optimize(obj::Function, ::EI, lb, ub, krig, sample_type::SectionSample;
function surrogate_optimize(obj::Function, ::EI, lb::AbstractArray, ub::AbstractArray, krig, sample_type::SectionSample;
maxiters = 100, num_new_samples = 100)
dtol = 1e-3 * norm(ub - lb)
eps = 0.01
Expand Down
7 changes: 4 additions & 3 deletions src/Radials.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using LinearAlgebra
using ExtendableSparse

Base.copy(t::Tuple) = t
_copy(t::Tuple) = t

Check warning on line 4 in src/Radials.jl

View check run for this annotation

Codecov / codecov/patch

src/Radials.jl#L4

Added line #L4 was not covered by tests
_copy(t) = copy(t)

mutable struct RadialBasis{F, Q, X, Y, L, U, C, S, D} <: AbstractSurrogate
phi::F
Expand Down Expand Up @@ -58,9 +59,9 @@
D = _construct_rbf_interp_matrix(x, first(x), lb, ub, phi, q, scale_factor, sparse)
Y = _construct_rbf_y_matrix(y, first(y), length(y) + num_poly_terms)
if (typeof(y) == Vector{Float64}) #single output case
coeff = copy(transpose(D \ y))
coeff = _copy(transpose(D \ y))
else
coeff = copy(transpose(D \ Y[1:size(D)[1], :])) #if y is multi output;
coeff = _copy(transpose(D \ Y[1:size(D)[1], :])) #if y is multi output;
end
return coeff
end
Expand Down
5 changes: 2 additions & 3 deletions src/Surrogates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export LobachevskyStructure,
SecondOrderPolynomialStructure
export WendlandStructure
export AbstractSurrogate, SamplingAlgorithm
export Kriging, RadialBasis, add_point!, current_estimate, std_error_at_point
export Kriging, RadialBasis, add_point!, std_error_at_point
# Parallelization Strategies
export potential_optimal_points
export MinimumConstantLiar, MaximumConstantLiar, MeanConstantLiar, KrigingBeliever,
Expand All @@ -104,10 +104,9 @@ export sample, GridSample, RandomSample, SobolSample, LatinHypercubeSample,
export RandomSample, KroneckerSample, GoldenSample, SectionSample

# Optimization algorithms
export SRBF, LCBS, EI, DYCORS, SOP, EGO, RTEA, SMB, surrogate_optimize
export SRBF, LCBS, EI, DYCORS, SOP, RTEA, SMB, surrogate_optimize
export LobachevskySurrogate, lobachevsky_integral, lobachevsky_integrate_dimension
export LinearSurrogate
export SVMSurrogate
export InverseDistanceSurrogate
export SecondOrderPolynomialSurrogate
export Wendland
Expand Down
11 changes: 11 additions & 0 deletions test/qa.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Surrogates, Aqua
@testset "Aqua" begin
Aqua.find_persistent_tasks_deps(Surrogates)
Aqua.test_ambiguities(Surrogates, recursive = false)
Aqua.test_deps_compat(Surrogates)
Aqua.test_piracies(Surrogates)
Aqua.test_project_extras(Surrogates)
Aqua.test_stale_deps(Surrogates)
Aqua.test_unbound_args(Surrogates)
Aqua.test_undefined_exports(Surrogates)
end
4 changes: 3 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ using Surrogates
using Test
using SafeTestsets
using Pkg
VERSION <= v"1.7" && Pkg.add(name = "Statistics", version = VERSION)

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

@testset "Surrogates" begin
@safetestset "Quality Assurance" begin
include("qa.jl")
end
@testset "Libs" begin
@testset "$pkg" for pkg in [
"SurrogatesAbstractGPs", "SurrogatesFlux",
Expand Down
Loading