Skip to content

Commit 54943e8

Browse files
committed
Proper assert
1 parent 93ea85a commit 54943e8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

  • lib

lib/BoundaryValueDiffEqFIRK/src/firk.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function init_nested(
107107
@set! alg.jac_alg = concrete_jacobian_algorithm(alg.jac_alg, prob, alg)
108108

109109
iip = isinplace(prob)
110-
@assert (!iip & !isnothing(alg.optimize)) "Out-of-place constraints don't allow optimization solvers "
110+
@assert (iip || isnothing(alg.optimize)) "Out-of-place constraints don't allow optimization solvers "
111111
if adaptive && isa(alg, FIRKNoAdaptivity)
112112
error("Algorithm doesn't support adaptivity. Please choose a higher order algorithm.")
113113
end
@@ -219,7 +219,7 @@ function init_expanded(
219219
optimize_kwargs = (; abstol = abstol), kwargs...)
220220
@set! alg.jac_alg = concrete_jacobian_algorithm(alg.jac_alg, prob, alg)
221221
iip = isinplace(prob)
222-
@assert (!iip & !isnothing(alg.optimize)) "Out-of-place constraints don't allow optimization solvers "
222+
@assert (iip || isnothing(alg.optimize)) "Out-of-place constraints don't allow optimization solvers "
223223
if adaptive && isa(alg, FIRKNoAdaptivity)
224224
error("Algorithm $(alg) doesn't support adaptivity. Please choose a higher order algorithm.")
225225
end

lib/BoundaryValueDiffEqMIRK/src/mirk.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function SciMLBase.__init(
4141
@set! alg.jac_alg = concrete_jacobian_algorithm(alg.jac_alg, prob, alg)
4242
iip = isinplace(prob)
4343
diffcache = __cache_trait(alg.jac_alg)
44-
@assert (!iip & !isnothing(alg.optimize)) "Out-of-place constraints don't allow optimization solvers "
44+
@assert (iip || isnothing(alg.optimize)) "Out-of-place constraints don't allow optimization solvers "
4545
fit_parameters = haskey(prob.kwargs, :fit_parameters)
4646

4747
t₀, t₁ = prob.tspan

0 commit comments

Comments
 (0)