Confusing error message when no optimization package is loaded #68
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Consider the following code snippet:
This throws
MethodError: no method matching iterate(::Nothing)
. The actual issue here, it appears, is that the necessary optimization package is not loaded; addingusing Optim
at the start fixes the problem. However, the error that is thrown obviously does not describe this problem accurately, making the problem difficult to debug for users unfamiliar with how DensityRatioEstimation.jl works.Perhaps it would be convenient to throw a more descriptive error when this occurs. I have found this package super useful and I think this could be a good quality-of-life addition.
The text was updated successfully, but these errors were encountered: