Skip to content
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
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Expand All @@ -38,7 +37,6 @@ OrdinaryDiffEqTsit5 = "1, 2"
Parameters = "0.12.1, 0.13"
Pkg = "1"
PrecompileTools = "1"
ProgressMeter = "1.6"
QuadGK = "2.4"
Random = "1"
RecipesBase = "1"
Expand Down
2 changes: 0 additions & 2 deletions lib/DataDrivenDMD/src/DataDrivenDMD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ using DataDrivenDiffEq
using DataDrivenDiffEq: AbstractBasis
using DataDrivenDiffEq: AbstractDataDrivenAlgorithm
using DataDrivenDiffEq: AbstractDataDrivenResult
using DataDrivenDiffEq: AbstractDataDrivenProblem
using DataDrivenDiffEq: DDReturnCode, ABSTRACT_CONT_PROB, ABSTRACT_DISCRETE_PROB
using DataDrivenDiffEq: InternalDataDrivenProblem
using DataDrivenDiffEq: is_implicit, is_controlled

using DataDrivenDiffEq.DocStringExtensions
using DataDrivenDiffEq.CommonSolve
using DataDrivenDiffEq.CommonSolve: solve!
using DataDrivenDiffEq.StatsBase
using DataDrivenDiffEq.Parameters

Expand Down
2 changes: 2 additions & 0 deletions lib/DataDrivenDMD/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DataDrivenDMD = "3c9adf31-5280-42ff-b439-b71cc6b07807"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
Expand All @@ -10,5 +11,6 @@ DataDrivenDMD = {path = "../.."}
[compat]
Aqua = "0.8"
JET = "0.9, 0.10, 0.11"
SciMLTesting = "1.6"
Test = "1"
julia = "1.10"
38 changes: 29 additions & 9 deletions lib/DataDrivenDMD/test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
using SciMLTesting
using DataDrivenDMD
using Aqua
using JET
using Test

@testset "QA" begin
@testset "Aqua" begin
Aqua.test_all(DataDrivenDMD)
end
@testset "JET" begin
JET.test_package(DataDrivenDMD; target_defined_modules = true)
end
end
run_qa(
DataDrivenDMD;
explicit_imports = true,
# `get_trainerror`/`get_testerror` are listed in `export` (src/DataDrivenDMD.jl) but
# no method is ever defined for them (dead exports from the #371 refactor). Aqua was
# never run before this conversion, so this is pre-existing and surfaced, not
# introduced; marked broken rather than silenced.
aqua_broken = (:undefined_exports,),
ei_kwargs = (;
# DataDrivenDiffEq exposes these names as the (non-`export`ed) extension API its
# own sublibraries build on. They are used deliberately; declaring them `public`
# upstream is tracked separately.
all_explicit_imports_are_public = (;
ignore = (
:AbstractBasis, :AbstractDataDrivenAlgorithm, :AbstractDataDrivenResult,
:ABSTRACT_CONT_PROB, :ABSTRACT_DISCRETE_PROB,
:InternalDataDrivenProblem, :is_controlled, :is_implicit,
),
),
all_qualified_accesses_are_public = (;
ignore = (:__EMPTY_MATRIX, :__construct_basis, :get_fit_targets),
),
),
# The umbrella `using DataDrivenDiffEq` (plus the `using DataDrivenDiffEq.<submodule>`
# re-exports) pulls the DataDrivenDiffEq public surface in implicitly; making every
# name explicit is a large refactor tracked separately.
ei_broken = (:no_implicit_imports,)
)
6 changes: 3 additions & 3 deletions lib/DataDrivenLux/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "DataDrivenLux"
uuid = "47881146-99d0-492a-8425-8f2f33327637"
version = "0.2.4"
version = "0.2.5"
authors = ["JuliusMartensen <julius.martensen@gmail.com>"]

[deps]
Expand Down Expand Up @@ -45,13 +45,13 @@ Distributions = "0.25.123"
DistributionsAD = "0.6"
DocStringExtensions = "0.9.3"
ForwardDiff = "0.10, 1"
IntervalArithmetic = "0.22, 0.23, 1"
IntervalArithmetic = "0.22.10, 0.23, 1"
InverseFunctions = "0.1"
LinearAlgebra = "1.10"
Logging = "1.10"
Lux = "1"
LuxCore = "1"
Optim = "1.7, 2"
Optim = "2"
Optimisers = "0.3, 0.4"
OrdinaryDiffEq = "6, 7"
Pkg = "1.10"
Expand Down
9 changes: 4 additions & 5 deletions lib/DataDrivenLux/src/DataDrivenLux.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ module DataDrivenLux
using DataDrivenDiffEq

# Load specific (abstract) types
using DataDrivenDiffEq: AbstractBasis, AbstractDataDrivenAlgorithm,
using DataDrivenDiffEq: AbstractDataDrivenAlgorithm,
AbstractDataDrivenResult, AbstractDataDrivenProblem, DDReturnCode,
ABSTRACT_CONT_PROB, ABSTRACT_DISCRETE_PROB,
InternalDataDrivenProblem, is_implicit, is_controlled
InternalDataDrivenProblem

using DocStringExtensions: DocStringExtensions, FIELDS, TYPEDEF, SIGNATURES
using CommonSolve: CommonSolve, solve!
using CommonSolve: CommonSolve
using ConcreteStructs: @concrete
using Setfield: Setfield, @set!

Expand All @@ -25,7 +24,7 @@ using TransformVariables: TransformVariables, as, transform_logdensity
using Distributions: Distributions, Distribution, Normal, Uniform, Univariate, dof,
loglikelihood, logpdf, mean, mode, quantile, scale, truncated
using DistributionsAD: DistributionsAD
using StatsBase: StatsBase, aicc, nobs, nullloglikelihood, r2, rss, sum, weights
using StatsBase: StatsBase, aicc, nobs, nullloglikelihood, r2, rss, sum

using ChainRulesCore: @ignore_derivatives
using ComponentArrays: ComponentArrays, ComponentVector
Expand Down
2 changes: 2 additions & 0 deletions lib/DataDrivenLux/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DataDrivenDiffEq = "2445eb08-9709-466a-b3fc-47e12bd697a2"
DataDrivenLux = "47881146-99d0-492a-8425-8f2f33327637"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
Expand All @@ -12,5 +13,6 @@ DataDrivenLux = {path = "../.."}
[compat]
Aqua = "0.8"
JET = "0.9, 0.10, 0.11"
SciMLTesting = "1.6"
Test = "1"
julia = "1.10"
49 changes: 40 additions & 9 deletions lib/DataDrivenLux/test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
using SciMLTesting
using DataDrivenLux
using Aqua
using JET
using Test

@testset "QA" begin
@testset "Aqua" begin
Aqua.test_all(DataDrivenLux)
end
@testset "JET" begin
JET.test_package(DataDrivenLux; target_defined_modules = true)
end
end
run_qa(
DataDrivenLux;
explicit_imports = true,
ei_kwargs = (;
all_explicit_imports_are_public = (;
ignore = (
# DataDrivenDiffEq non-`export`ed extension API its sublibraries build on.
:AbstractDataDrivenAlgorithm, :AbstractDataDrivenProblem,
:AbstractDataDrivenResult, :InternalDataDrivenProblem,
# External non-public names, used deliberately.
:AbstractBackend, :ForwardDiffBackend, :gradient, # AbstractDifferentiation
:converged, :Options, # Optim
:isempty, # IntervalArithmetic
:square, # InverseFunctions
),
),
all_explicit_imports_via_owners = (;
ignore = (:isempty,), # IntervalArithmetic.isempty (owner Base)
),
all_qualified_accesses_are_public = (;
ignore = (
# DataDrivenDiffEq internals accessed qualified.
:get_f, :get_fit_targets, :get_implicit_data, :get_oop_args,
:remake_problem, :_set_default_val, :AbstractDataDrivenResult,
:getdefaultval, # Symbolics
:isvariable, # ModelingToolkit
:promote_eltype, # Base
:AbstractBackend, :ForwardDiffBackend, :gradient, # AbstractDifferentiation
:converged, :Options, # Optim
),
),
all_qualified_accesses_via_owners = (;
ignore = (:isvariable,), # ModelingToolkit.isvariable (owner ModelingToolkitBase)
),
),
# The umbrella `using DataDrivenDiffEq` pulls its public surface in implicitly;
# making every name explicit is a large refactor tracked separately.
ei_broken = (:no_implicit_imports,)
)
7 changes: 2 additions & 5 deletions lib/DataDrivenSR/src/DataDrivenSR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ module DataDrivenSR

using DataDrivenDiffEq
# Load specific (abstract) types
using DataDrivenDiffEq: AbstractBasis, Difference
using DataDrivenDiffEq: Difference
using DataDrivenDiffEq: AbstractDataDrivenAlgorithm
using DataDrivenDiffEq: AbstractDataDrivenResult
using DataDrivenDiffEq: AbstractDataDrivenProblem
using DataDrivenDiffEq: DDReturnCode, ABSTRACT_CONT_PROB, ABSTRACT_DISCRETE_PROB
using DataDrivenDiffEq: DDReturnCode
using DataDrivenDiffEq: InternalDataDrivenProblem
using DataDrivenDiffEq: is_implicit, is_controlled

using DataDrivenDiffEq.DocStringExtensions
using DataDrivenDiffEq.CommonSolve
using DataDrivenDiffEq.CommonSolve: solve!
using DataDrivenDiffEq.StatsBase
using DataDrivenDiffEq.Parameters

Expand Down
2 changes: 2 additions & 0 deletions lib/DataDrivenSR/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DataDrivenDiffEq = "2445eb08-9709-466a-b3fc-47e12bd697a2"
DataDrivenSR = "7fed8a53-d475-4873-af3a-ba53cceea094"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
Expand All @@ -12,5 +13,6 @@ DataDrivenSR = {path = "../.."}
[compat]
Aqua = "0.8"
JET = "0.9, 0.10, 0.11"
SciMLTesting = "1.6"
Test = "1"
julia = "1.10"
40 changes: 31 additions & 9 deletions lib/DataDrivenSR/test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
using SciMLTesting
using DataDrivenSR
using Aqua
using JET
using Test

@testset "QA" begin
@testset "Aqua" begin
Aqua.test_all(DataDrivenSR)
end
@testset "JET" begin
JET.test_package(DataDrivenSR; target_defined_modules = true)
end
end
run_qa(
DataDrivenSR;
explicit_imports = true,
ei_kwargs = (;
all_explicit_imports_are_public = (;
# DataDrivenDiffEq non-`export`ed extension API its sublibraries build on.
ignore = (
:AbstractDataDrivenAlgorithm, :AbstractDataDrivenResult,
:InternalDataDrivenProblem,
),
),
all_qualified_accesses_are_public = (;
ignore = (
# DataDrivenDiffEq internals accessed qualified.
:assert_lhs, :get_implicit_data, :remake_problem, :_set_default_val,
:setdefaultval, # Symbolics
:Sym, # SymbolicUtils
:toparam, # ModelingToolkit
),
),
all_qualified_accesses_via_owners = (;
ignore = (:toparam,), # ModelingToolkit.toparam (owner ModelingToolkitBase)
),
),
# The umbrella `using DataDrivenDiffEq` and `@reexport using SymbolicRegression`
# (plus the `using DataDrivenDiffEq.<submodule>` re-exports) pull those public
# surfaces in implicitly; making every name explicit is a large refactor tracked
# separately.
ei_broken = (:no_implicit_imports,)
)
5 changes: 1 addition & 4 deletions lib/DataDrivenSparse/src/DataDrivenSparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ module DataDrivenSparse

using DataDrivenDiffEq
# Load specific (abstract) types
using DataDrivenDiffEq: AbstractBasis
using DataDrivenDiffEq: AbstractDataDrivenAlgorithm
using DataDrivenDiffEq: AbstractDataDrivenResult
using DataDrivenDiffEq: AbstractDataDrivenProblem
using DataDrivenDiffEq: DDReturnCode, ABSTRACT_CONT_PROB, ABSTRACT_DISCRETE_PROB
using DataDrivenDiffEq: DDReturnCode
using DataDrivenDiffEq: InternalDataDrivenProblem
using DataDrivenDiffEq: is_implicit, is_controlled

using DataDrivenDiffEq.DocStringExtensions
using DataDrivenDiffEq.CommonSolve
Expand Down
2 changes: 1 addition & 1 deletion lib/DataDrivenSparse/src/algorithms/proximals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ ClippedAbsoluteDeviation() = ClippedAbsoluteDeviation(NaN)
end

function (s::ClippedAbsoluteDeviation)(x::AbstractArray, λ::T) where {T <: Real}
@unpack ρ = h
@unpack ρ = s
ρ = isnan(ρ) ? convert(T, 5) * λ : convert(T, ρ)
for i in eachindex(x)
x[i] = abs(x[i]) > ρ ? x[i] : sign(x[i]) * max(abs(x[i]) - λ, 0)
Expand Down
2 changes: 1 addition & 1 deletion lib/DataDrivenSparse/src/result.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ is_success(k::SparseRegressionResult) = getfield(k, :retcode) == DDReturnCode(1)
l2error(k::SparseRegressionResult) = is_success(k) ? getfield(k, :testerror) : Inf

function l2error(k::SparseRegressionResult{<:Any, <:Any, Nothing})
return is_success(k) ? getfield(k, :traineerror) : Inf
return is_success(k) ? getfield(k, :trainerror) : Inf
end

get_coefficients(k::SparseRegressionResult) = getfield(k, :coefficients)
2 changes: 2 additions & 0 deletions lib/DataDrivenSparse/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DataDrivenSparse = "5b588203-7d8b-4fab-a537-c31a7f73f46b"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
Expand All @@ -10,5 +11,6 @@ DataDrivenSparse = {path = "../.."}
[compat]
Aqua = "0.8"
JET = "0.9, 0.10, 0.11"
SciMLTesting = "1.6"
Test = "1"
julia = "1.10"
37 changes: 28 additions & 9 deletions lib/DataDrivenSparse/test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
using SciMLTesting
using DataDrivenSparse
using Aqua
using JET
using Test

@testset "QA" begin
@testset "Aqua" begin
Aqua.test_all(DataDrivenSparse)
end
@testset "JET" begin
JET.test_package(DataDrivenSparse; target_defined_modules = true)
end
end
run_qa(
DataDrivenSparse;
explicit_imports = true,
# The `unique!`/`deleteat!` Basis methods that DataDrivenDiffEq defines on
# `Symbolics.Num`/`Symbolics.Arr` vectors are ambiguous against `Base.unique!`/
# `Base.deleteat!`; the ambiguity is inherited from the parent package (it predates
# this conversion and Aqua was never run before), so it is marked broken here.
aqua_broken = (:ambiguities,),
ei_kwargs = (;
# DataDrivenDiffEq exposes these names as the (non-`export`ed) extension API its
# own sublibraries build on; declaring them `public` upstream is tracked separately.
all_explicit_imports_are_public = (;
ignore = (
:AbstractDataDrivenAlgorithm, :AbstractDataDrivenResult,
:InternalDataDrivenProblem,
),
),
all_qualified_accesses_are_public = (;
# __construct_basis/is_implicit: DataDrivenDiffEq internals; transform: StatsBase.
ignore = (:__construct_basis, :is_implicit, :transform),
),
),
# The umbrella `using DataDrivenDiffEq` (plus the `using DataDrivenDiffEq.<submodule>`
# re-exports) pulls the DataDrivenDiffEq public surface in implicitly; making every
# name explicit is a large refactor tracked separately.
ei_broken = (:no_implicit_imports,)
)
2 changes: 1 addition & 1 deletion src/DataDrivenDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module DataDrivenDiffEq
using LinearAlgebra

using DiffEqBase
using SciMLBase: SciMLBase, AbstractTimeseriesSolution
using SciMLBase: SciMLBase
using CommonSolve
using Reexport

Expand Down
Loading
Loading