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

Make robust to deprecations removals #168

Merged
merged 4 commits into from
Mar 27, 2025
Merged

Make robust to deprecations removals #168

merged 4 commits into from
Mar 27, 2025

Conversation

ChrisRackauckas
Copy link
Member

No description provided.

@JoshuaLampert
Copy link

JoshuaLampert commented Mar 27, 2025

Does this close SciML/OrdinaryDiffEq.jl#2639?

@kellertuer
Copy link

That error you posted at leat looks very very similar to the one that we discussed on Slack and that lead to this PR – so, maybe (or probably) that solves it, yes.

@ChrisRackauckas ChrisRackauckas merged commit b73c4b7 into main Mar 27, 2025
3 of 11 checks passed
@ChrisRackauckas ChrisRackauckas deleted the robust branch March 27, 2025 14:01
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JuliaFormatter

[JuliaFormatter] reported by reviewdog 🐶

patience_objective_multiplier = 3,
min_max_factor = 1.3) where {T}


[JuliaFormatter] reported by reviewdog 🐶

NLSolveSafeTerminationResult,
Nothing
})


[JuliaFormatter] reported by reviewdog 🐶

return _termination_condition_closure_basic(get_du(integrator), integrator.u,
integrator.uprev, abstol, reltol)


[JuliaFormatter] reported by reviewdog 🐶

return _termination_condition_closure_safe(get_du(integrator), integrator.u,
integrator.uprev, abstol, reltol)


[JuliaFormatter] reported by reviewdog 🐶

return check_termination(
tc_cache, fx, x, xo, prob, alg, get_termination_mode(tc_cache))

Comment on lines +152 to +153
export NLSolveTerminationMode,
NLSolveSafeTerminationOptions, NLSolveTerminationCondition,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
export NLSolveTerminationMode,
NLSolveSafeTerminationOptions, NLSolveTerminationCondition,
export NLSolveTerminationMode, NLSolveSafeTerminationOptions, NLSolveTerminationCondition,

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JuliaFormatter

[JuliaFormatter] reported by reviewdog 🐶

struct NLSolveTerminationCondition{mode, T,
S <: Union{<:NLSolveSafeTerminationOptions, Nothing}}


[JuliaFormatter] reported by reviewdog 🐶

patience_objective_multiplier = 3,
min_max_factor = 1.3) where {T}


[JuliaFormatter] reported by reviewdog 🐶

NLSolveSafeTerminationResult,
Nothing
})


[JuliaFormatter] reported by reviewdog 🐶

return _termination_condition_closure_basic(get_du(integrator), integrator.u,
integrator.uprev, abstol, reltol)


[JuliaFormatter] reported by reviewdog 🐶

return _termination_condition_closure_safe(get_du(integrator), integrator.u,
integrator.uprev, abstol, reltol)


[JuliaFormatter] reported by reviewdog 🐶

return check_termination(
tc_cache, fx, x, xo, prob, alg, get_termination_mode(tc_cache))

Comment on lines +57 to +58
:AbsNorm => doc"``\| \Delta u \| \leq abstol``."
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
:AbsNorm => doc"``\| \Delta u \| \leq abstol``."
)
:AbsNorm => doc"``\| \Delta u \| \leq abstol``.")

Comment on lines +151 to +153
return new{__norm_type(f), typeof(max_stalled_steps), F,
typeof(protective_threshold), typeof(patience_objective_multiplier),
typeof(min_max_factor)}(f, protective_threshold, patience_steps,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
return new{__norm_type(f), typeof(max_stalled_steps), F,
typeof(protective_threshold), typeof(patience_objective_multiplier),
typeof(min_max_factor)}(f, protective_threshold, patience_steps,
return new{__norm_type(f), typeof(max_stalled_steps),
F, typeof(protective_threshold),
typeof(patience_objective_multiplier), typeof(min_max_factor)}(
f, protective_threshold, patience_steps,

Comment on lines +167 to +168
@concrete mutable struct NonlinearTerminationModeCache{dep_retcode,
M <: AbstractNonlinearTerminationMode,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@concrete mutable struct NonlinearTerminationModeCache{dep_retcode,
M <: AbstractNonlinearTerminationMode,
@concrete mutable struct NonlinearTerminationModeCache{
dep_retcode, M <: AbstractNonlinearTerminationMode,

function SciMLBase.init(du::Union{AbstractArray{T}, T}, u::Union{AbstractArray{T}, T},
mode::AbstractNonlinearTerminationMode, saved_value_prototype...;
use_deprecated_retcodes::Val{D} = Val(true), # Remove in v8, warn in v7
abstol = nothing, reltol = nothing, kwargs...) where {D, T <: Number}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
abstol = nothing, reltol = nothing, kwargs...) where {D, T <: Number}
abstol = nothing,
reltol = nothing, kwargs...) where {D, T <: Number}

Vector{TT}(undef, mode.max_stalled_steps)
best_value = initial_objective
max_stalled_steps = mode.max_stalled_steps
if ArrayInterface.can_setindex(u_) && !(u_ isa Number) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
if ArrayInterface.can_setindex(u_) && !(u_ isa Number) &&
if ArrayInterface.can_setindex(u_) &&
!(u_ isa Number) &&

Comment on lines +82 to +83
function NLSolveSafeTerminationResult(u = nothing; best_objective_value = Inf64,
best_objective_value_iteration = 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function NLSolveSafeTerminationResult(u = nothing; best_objective_value = Inf64,
best_objective_value_iteration = 0,
function NLSolveSafeTerminationResult(
u = nothing; best_objective_value = Inf64, best_objective_value_iteration = 0,

Comment on lines +89 to +90
return NLSolveSafeTerminationResult{typeof(best_objective_value), typeof(u)}(u,
best_objective_value, best_objective_value_iteration, return_code)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
return NLSolveSafeTerminationResult{typeof(best_objective_value), typeof(u)}(u,
best_objective_value, best_objective_value_iteration, return_code)
return NLSolveSafeTerminationResult{typeof(best_objective_value), typeof(u)}(
u, best_objective_value, best_objective_value_iteration, return_code)

Comment on lines +94 to +96
NLSolveTerminationMode.NLSolveDefault,
NLSolveTerminationMode.Norm, NLSolveTerminationMode.Rel,
NLSolveTerminationMode.RelNorm,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
NLSolveTerminationMode.NLSolveDefault,
NLSolveTerminationMode.Norm, NLSolveTerminationMode.Rel,
NLSolveTerminationMode.RelNorm,
NLSolveTerminationMode.NLSolveDefault, NLSolveTerminationMode.Norm,
NLSolveTerminationMode.Rel, NLSolveTerminationMode.RelNorm,

Comment on lines +99 to +102
const SAFE_TERMINATION_MODES = (NLSolveTerminationMode.RelSafe,
NLSolveTerminationMode.RelSafeBest,
NLSolveTerminationMode.AbsSafe,
NLSolveTerminationMode.AbsSafeBest)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
const SAFE_TERMINATION_MODES = (NLSolveTerminationMode.RelSafe,
NLSolveTerminationMode.RelSafeBest,
NLSolveTerminationMode.AbsSafe,
NLSolveTerminationMode.AbsSafeBest)
const SAFE_TERMINATION_MODES = (
NLSolveTerminationMode.RelSafe, NLSolveTerminationMode.RelSafeBest,
NLSolveTerminationMode.AbsSafe, NLSolveTerminationMode.AbsSafeBest)

Comment on lines +104 to +105
const SAFE_BEST_TERMINATION_MODES = (NLSolveTerminationMode.RelSafeBest,
NLSolveTerminationMode.AbsSafeBest)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
const SAFE_BEST_TERMINATION_MODES = (NLSolveTerminationMode.RelSafeBest,
NLSolveTerminationMode.AbsSafeBest)
const SAFE_BEST_TERMINATION_MODES = (
NLSolveTerminationMode.RelSafeBest, NLSolveTerminationMode.AbsSafeBest)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants