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

Raise errors as warnings to avoid capture and re-emission of errors during fit #229

Open
dgkf opened this issue Jan 24, 2023 · 1 comment
Labels
discussion enhancement New feature or request

Comments

@dgkf
Copy link
Contributor

dgkf commented Jan 24, 2023

I noticed recently that we capture and re-emit errors during fit, which seems to be a fail-safe for potential failures using different optimizers.

However, this makes debugging challenging since we can't halt execution at a given optimizer failure and makes tracebacks less helpful for end users (maybe not a super common end user need, but would be helpful for bug reports at the very least).

Instead, I propose that we convert any errors into warnings when multiple optimizers are used, which has a few benefits.

  • warnings can be emitted immediately, so if fits take a long time to run the failure of a fit is communicated earlier
  • warnings can still be converted into errors using options(warn = 2), which allows an opportunity to get a useful traceback
  • this would reduce a lot of the complexity of capturing and re-emitting errors
@dgkf dgkf added the enhancement New feature or request label Jan 24, 2023
@danielinteractive
Copy link
Collaborator

Thanks Doug, yeah this part can definitely be improved regarding code logic simplification.
We will have to be careful e.g. regarding:

  • Warnings of failed optimizers would not be helpful if emitted immediately, because another optimizer could work and deliver the result
  • We should check with downstream package tern.mmrm if anything needs to be adapted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants