Skip to content

Commit e48e777

Browse files
committed
remove unused toggles
1 parent cf07038 commit e48e777

File tree

3 files changed

+41
-128
lines changed

3 files changed

+41
-128
lines changed

lib/NonlinearSolveBase/src/verbosity.jl

Lines changed: 19 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,15 @@ diagnostic messages, warnings, and errors during nonlinear system solution.
77
# Fields
88
99
## Error Control Group
10-
- `immutable_u0`: Messages when u0 is immutable
11-
- `non_enclosing_interval`: Messages when interval doesn't enclose root
12-
- `non_forward_mode`: Messages when forward mode AD is not used
13-
- `fd_ad_caution`: Messages about finite differencing cautions
14-
- `ad_backend_incompatible`: Messages when AD backend is incompatible
10+
- `non_enclosing_interval`: Messages when interval doesn't enclose root (bracketing methods)
1511
- `alias_u0_immutable`: Messages when aliasing u0 with immutable array
1612
- `linsolve_failed_noncurrent`: Messages when linear solve fails on non-current iteration
17-
- `jacobian_free`: Messages about jacobian-free methods
1813
- `termination_condition`: Messages about termination conditions
1914
20-
## Performance Group
21-
- `colorvec_non_sparse`: Messages when color vector is used with non-sparse matrix
22-
- `colorvec_no_prototype`: Messages when color vector has no prototype
23-
- `sparsity_using_jac_prototype`: Messages when using jacobian prototype for sparsity
24-
- `sparse_matrixcolorings_not_loaded`: Messages when SparseMatrixColorings not loaded
25-
2615
## Numerical Group
27-
- `threshold_state`: Messages about threshold state
28-
- `pinv_undefined`: Messages when pseudoinverse is undefined
16+
- `threshold_state`: Messages about threshold state in low-rank methods
2917
30-
## Linear Solver
18+
## Linear Solver Group
3119
- `linear_verbosity`: Verbosity configuration for linear solvers
3220
3321
# Constructors
@@ -59,51 +47,36 @@ verbose = NonlinearVerbosity(
5947
6048
# Set individual fields
6149
verbose = NonlinearVerbosity(
62-
immutable_u0 = SciMLLogging.WarnLevel(),
50+
alias_u0_immutable = SciMLLogging.WarnLevel(),
6351
threshold_state = SciMLLogging.InfoLevel()
6452
)
6553
6654
# Mix group and individual settings
6755
verbose = NonlinearVerbosity(
6856
numerical = SciMLLogging.InfoLevel(), # Set all numerical to InfoLevel
69-
pinv_undefined = SciMLLogging.ErrorLevel() # Override specific field
57+
threshold_state = SciMLLogging.ErrorLevel() # Override specific field
7058
)
7159
```
7260
"""
7361
@concrete struct NonlinearVerbosity <: AbstractVerbositySpecifier
7462
# Linear verbosity
7563
linear_verbosity
7664
# Error control
77-
immutable_u0
7865
non_enclosing_interval
79-
non_forward_mode
80-
fd_ad_caution
81-
ad_backend_incompatible
8266
alias_u0_immutable
8367
linsolve_failed_noncurrent
84-
jacobian_free
8568
termination_condition
86-
# Performance
87-
colorvec_non_sparse
88-
colorvec_no_prototype
89-
sparsity_using_jac_prototype
90-
sparse_matrixcolorings_not_loaded
9169
# Numerical
9270
threshold_state
93-
pinv_undefined
9471
end
9572

9673
# Group classifications
9774
const error_control_options = (
98-
:immutable_u0, :non_enclosing_interval, :non_forward_mode, :fd_ad_caution,
99-
:ad_backend_incompatible, :alias_u0_immutable, :linsolve_failed_noncurrent,
100-
:jacobian_free, :termination_condition
101-
)
102-
const performance_options = (
103-
:colorvec_non_sparse, :colorvec_no_prototype, :sparsity_using_jac_prototype,
104-
:sparse_matrixcolorings_not_loaded
75+
:non_enclosing_interval, :alias_u0_immutable, :linsolve_failed_noncurrent,
76+
:termination_condition
10577
)
106-
const numerical_options = (:threshold_state, :pinv_undefined)
78+
const performance_options = ()
79+
const numerical_options = (:threshold_state,)
10780

10881
function option_group(option::Symbol)
10982
if option in error_control_options
@@ -121,13 +94,13 @@ end
12194
function group_options(verbosity::NonlinearVerbosity, group::Symbol)
12295
if group === :error_control
12396
return NamedTuple{error_control_options}(getproperty(verbosity, opt)
124-
for opt in error_control_options)
97+
for opt in error_control_options)
12598
elseif group === :performance
12699
return NamedTuple{performance_options}(getproperty(verbosity, opt)
127-
for opt in performance_options)
100+
for opt in performance_options)
128101
elseif group === :numerical
129102
return NamedTuple{numerical_options}(getproperty(verbosity, opt)
130-
for opt in numerical_options)
103+
for opt in numerical_options)
131104
else
132105
error("Unknown group: $group")
133106
end
@@ -161,21 +134,11 @@ function NonlinearVerbosity(;
161134
# Build arguments using NamedTuple for type stability
162135
default_args = (
163136
linear_verbosity = linear_verbosity === nothing ? Minimal() : linear_verbosity,
164-
immutable_u0 = WarnLevel(),
165137
non_enclosing_interval = WarnLevel(),
166-
non_forward_mode = WarnLevel(),
167-
fd_ad_caution = WarnLevel(),
168-
ad_backend_incompatible = WarnLevel(),
169138
alias_u0_immutable = WarnLevel(),
170139
linsolve_failed_noncurrent = WarnLevel(),
171-
jacobian_free = WarnLevel(),
172140
termination_condition = WarnLevel(),
173-
colorvec_non_sparse = WarnLevel(),
174-
colorvec_no_prototype = WarnLevel(),
175-
sparsity_using_jac_prototype = WarnLevel(),
176-
sparse_matrixcolorings_not_loaded = WarnLevel(),
177-
threshold_state = WarnLevel(),
178-
pinv_undefined = WarnLevel()
141+
threshold_state = WarnLevel()
179142
)
180143

181144
# Apply group-level settings
@@ -206,64 +169,34 @@ function NonlinearVerbosity(verbose::AbstractVerbosityPreset)
206169
# Minimal: Only fatal errors and critical warnings
207170
NonlinearVerbosity(
208171
linear_verbosity = Minimal(),
209-
immutable_u0 = WarnLevel(),
210172
non_enclosing_interval = WarnLevel(),
211-
non_forward_mode = Silent(),
212-
fd_ad_caution = Silent(),
213-
ad_backend_incompatible = WarnLevel(),
214173
alias_u0_immutable = Silent(),
215174
linsolve_failed_noncurrent = WarnLevel(),
216-
jacobian_free = Silent(),
217175
termination_condition = Silent(),
218-
colorvec_non_sparse = Silent(),
219-
colorvec_no_prototype = Silent(),
220-
sparsity_using_jac_prototype = Silent(),
221-
sparse_matrixcolorings_not_loaded = Silent(),
222-
threshold_state = Silent(),
223-
pinv_undefined = ErrorLevel()
176+
threshold_state = Silent()
224177
)
225178
elseif verbose isa Standard
226179
# Standard: Everything from Minimal + non-fatal warnings
227180
NonlinearVerbosity()
228181
elseif verbose isa Detailed
229182
# Detailed: Everything from Standard + debugging/solver behavior
230183
NonlinearVerbosity(
231-
linear_verbosity = Minimal(),
232-
immutable_u0 = WarnLevel(),
184+
linear_verbosity = Detailed(),
233185
non_enclosing_interval = WarnLevel(),
234-
non_forward_mode = InfoLevel(),
235-
fd_ad_caution = WarnLevel(),
236-
ad_backend_incompatible = WarnLevel(),
237186
alias_u0_immutable = WarnLevel(),
238187
linsolve_failed_noncurrent = WarnLevel(),
239-
jacobian_free = InfoLevel(),
240188
termination_condition = WarnLevel(),
241-
colorvec_non_sparse = InfoLevel(),
242-
colorvec_no_prototype = InfoLevel(),
243-
sparsity_using_jac_prototype = InfoLevel(),
244-
sparse_matrixcolorings_not_loaded = InfoLevel(),
245-
threshold_state = WarnLevel(),
246-
pinv_undefined = WarnLevel()
189+
threshold_state = WarnLevel()
247190
)
248191
elseif verbose isa All
249192
# All: Maximum verbosity - every possible logging message at InfoLevel
250193
NonlinearVerbosity(
251-
linear_verbosity = All(),
252-
immutable_u0 = WarnLevel(),
194+
linear_verbosity = Detailed(),
253195
non_enclosing_interval = WarnLevel(),
254-
non_forward_mode = InfoLevel(),
255-
fd_ad_caution = WarnLevel(),
256-
ad_backend_incompatible = WarnLevel(),
257196
alias_u0_immutable = WarnLevel(),
258197
linsolve_failed_noncurrent = WarnLevel(),
259-
jacobian_free = InfoLevel(),
260198
termination_condition = WarnLevel(),
261-
colorvec_non_sparse = InfoLevel(),
262-
colorvec_no_prototype = InfoLevel(),
263-
sparsity_using_jac_prototype = InfoLevel(),
264-
sparse_matrixcolorings_not_loaded = InfoLevel(),
265-
threshold_state = InfoLevel(),
266-
pinv_undefined = WarnLevel()
199+
threshold_state = InfoLevel()
267200
)
268201
end
269202
end
@@ -275,16 +208,6 @@ end
275208
Silent(),
276209
Silent(),
277210
Silent(),
278-
Silent(),
279-
Silent(),
280-
Silent(),
281-
Silent(),
282-
Silent(),
283-
Silent(),
284-
Silent(),
285-
Silent(),
286-
Silent(),
287-
Silent(),
288211
Silent()
289212
)
290213
end
@@ -303,5 +226,4 @@ end
303226
else
304227
return default_val
305228
end
306-
end
307-
229+
end

lib/NonlinearSolveSpectralMethods/src/solve.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ function InternalAPI.step!(
188188
kwargs...
189189
)
190190
if recompute_jacobian !== nothing
191-
@SciMLMessage("GeneralizedDFSane is a Jacobian-Free Algorithm. Ignoring \
192-
`recompute_jacobian`", cache.verbose, :jacobian_free)
191+
@warn "GeneralizedDFSane is a Jacobian-Free Algorithm. Ignoring \
192+
`recompute_jacobian`"
193193
end
194194

195195
@static_timeit cache.timer "descent" begin

test/verbosity_tests.jl

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,69 +13,60 @@
1313
v_standard = NonlinearVerbosity(SciMLLogging.Standard())
1414
v_detailed = NonlinearVerbosity(SciMLLogging.Detailed())
1515

16-
@test v_none.immutable_u0 isa SciMLLogging.Silent
16+
@test v_none.non_enclosing_interval isa SciMLLogging.Silent
1717
@test v_none.threshold_state isa SciMLLogging.Silent
18-
@test v_none.colorvec_non_sparse isa SciMLLogging.Silent
18+
@test v_none.alias_u0_immutable isa SciMLLogging.Silent
1919

20-
@test v_minimal.immutable_u0 isa SciMLLogging.WarnLevel
21-
@test v_minimal.colorvec_non_sparse isa SciMLLogging.Silent
22-
@test v_minimal.non_forward_mode isa SciMLLogging.Silent
20+
@test v_minimal.non_enclosing_interval isa SciMLLogging.WarnLevel
21+
@test v_minimal.alias_u0_immutable isa SciMLLogging.Silent
22+
@test v_minimal.termination_condition isa SciMLLogging.Silent
2323

24-
@test v_standard.immutable_u0 isa SciMLLogging.WarnLevel
24+
@test v_standard.non_enclosing_interval isa SciMLLogging.WarnLevel
2525
@test v_standard.threshold_state isa SciMLLogging.WarnLevel
2626

27-
@test v_detailed.colorvec_non_sparse isa SciMLLogging.InfoLevel
28-
@test v_detailed.non_forward_mode isa SciMLLogging.InfoLevel
29-
@test v_detailed.jacobian_free isa SciMLLogging.InfoLevel
27+
@test v_detailed.alias_u0_immutable isa SciMLLogging.WarnLevel
28+
@test v_detailed.termination_condition isa SciMLLogging.WarnLevel
3029

31-
@test v_all.colorvec_non_sparse isa SciMLLogging.InfoLevel
30+
@test v_all.linsolve_failed_noncurrent isa SciMLLogging.WarnLevel
3231
@test v_all.threshold_state isa SciMLLogging.InfoLevel
3332
end
3433

3534
@testset "Group-level keyword constructors" begin
3635
v_error = NonlinearVerbosity(error_control = SciMLLogging.ErrorLevel())
37-
@test v_error.immutable_u0 isa SciMLLogging.ErrorLevel
36+
@test v_error.alias_u0_immutable isa SciMLLogging.ErrorLevel
3837
@test v_error.non_enclosing_interval isa SciMLLogging.ErrorLevel
3938
@test v_error.termination_condition isa SciMLLogging.ErrorLevel
39+
@test v_error.linsolve_failed_noncurrent isa SciMLLogging.ErrorLevel
4040

4141
v_numerical = NonlinearVerbosity(numerical = SciMLLogging.Silent())
4242
@test v_numerical.threshold_state isa SciMLLogging.Silent
43-
@test v_numerical.pinv_undefined isa SciMLLogging.Silent
44-
45-
v_performance = NonlinearVerbosity(performance = SciMLLogging.InfoLevel())
46-
@test v_performance.colorvec_non_sparse isa SciMLLogging.InfoLevel
47-
@test v_performance.colorvec_no_prototype isa SciMLLogging.InfoLevel
48-
@test v_performance.sparsity_using_jac_prototype isa SciMLLogging.InfoLevel
49-
@test v_performance.sparse_matrixcolorings_not_loaded isa SciMLLogging.InfoLevel
5043
end
5144

5245
@testset "Mixed group and individual settings" begin
5346
v_mixed = NonlinearVerbosity(
5447
numerical = SciMLLogging.Silent(),
5548
threshold_state = SciMLLogging.WarnLevel(),
56-
performance = SciMLLogging.InfoLevel()
49+
error_control = SciMLLogging.InfoLevel()
5750
)
5851
# Individual override should take precedence
5952
@test v_mixed.threshold_state isa SciMLLogging.WarnLevel
60-
# Other numerical options should use group setting
61-
@test v_mixed.pinv_undefined isa SciMLLogging.Silent
62-
# Performance group setting should apply
63-
@test v_mixed.colorvec_non_sparse isa SciMLLogging.InfoLevel
64-
@test v_mixed.colorvec_no_prototype isa SciMLLogging.InfoLevel
53+
# Error control group setting should apply
54+
@test v_mixed.alias_u0_immutable isa SciMLLogging.InfoLevel
55+
@test v_mixed.linsolve_failed_noncurrent isa SciMLLogging.InfoLevel
6556
end
6657

6758
@testset "Individual keyword arguments" begin
6859
v_individual = NonlinearVerbosity(
69-
immutable_u0 = SciMLLogging.ErrorLevel(),
60+
alias_u0_immutable = SciMLLogging.ErrorLevel(),
7061
threshold_state = SciMLLogging.InfoLevel(),
71-
colorvec_non_sparse = SciMLLogging.Silent()
62+
termination_condition = SciMLLogging.Silent()
7263
)
73-
@test v_individual.immutable_u0 isa SciMLLogging.ErrorLevel
64+
@test v_individual.alias_u0_immutable isa SciMLLogging.ErrorLevel
7465
@test v_individual.threshold_state isa SciMLLogging.InfoLevel
75-
@test v_individual.colorvec_non_sparse isa SciMLLogging.Silent
66+
@test v_individual.termination_condition isa SciMLLogging.Silent
7667
# Unspecified options should use defaults
7768
@test v_individual.non_enclosing_interval isa SciMLLogging.WarnLevel
78-
@test v_individual.pinv_undefined isa SciMLLogging.WarnLevel
69+
@test v_individual.linsolve_failed_noncurrent isa SciMLLogging.WarnLevel
7970
end
8071

8172
g(u, p) = u^2 - 4

0 commit comments

Comments
 (0)