Open jtrakk opened 3 years ago
This is a fair comment. We should not fail hard here.
I don't currently have an opinion about whether an error should be thrown versus another strategy. Just that if an error is thrown I'd rather it not be AssertionError
because I like to be able to interpret @assert(p)
statically as "p is always true" eg as here.
I don't currently have an opinion about whether an error should be thrown versus another strategy. Just that if an error is thrown I'd rather it not be
AssertionError
because I like to be able to interpret@assert(p)
statically as "p is always true" eg as here.
Fair, I understand the distinction. I still agree that an assertion is not appropriate here.
Has this changed? I am still getting this error. How can one get around this? I am optimizing a function using Oprim package, which uses LineSearch.jl for the linesearch.
This line https://github.com/JuliaNLSolvers/LineSearches.jl/blob/62ffafe6f4dd68032e42b11c31b8e4e24c4c9ae4/src/hagerzhang.jl#L503
is raising an
AssertionError
in my code.The Julia docs state
I find this a useful convention so that assertion statements help to reason statically about the behavior of code. If LineSearches.jl needs a macro for runtime validation, perhaps a different macro could be used?