-
Notifications
You must be signed in to change notification settings - Fork 354
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
ignore swiglal warnings #4801
base: master
Are you sure you want to change the base?
ignore swiglal warnings #4801
Conversation
I'm not in favour of this. The warning was added once lal solved an issue we (and others) had long complained about, specifically that if a C-level error occurs, we only get some generic warning, with no real idea of what wen wrong, at the python level. This is now enabled by default in notebooks, but doing so does come with a performance penalty. I think PyCBC users might have cases where it is best to use I've no issue with silencing this warning in tutorial notebooks (with a comment), but am not sure it should be put here (silently making this decision for any user that imports PyCBC). |
@spxiwh I don't understand the choice of defaults here. Why is it different between a notebook and a script? A notebook is exactly where I wouldn't care as much about performance, so why the scary message that pops up? I don't think the right solution anytime there are potential user environment choices to have a forced warning. If all packages did this, it would be untenable. Wouldn't the better thing to be do have it off by default, but if an error occurs they get the complement of this message on how to get a more detailed error report? |
"Why is it different between a notebook and a script?" -> A script (or Your suggestion at the end makes sense to me, but I don't know enough about SWIGLAL to comment on why it wasn't done that way, or if it is possible. |
@spxiwh My guess is that it just wasn't suggested, probably not anything deep into any choice. I think the fact that swiglal was already able to raise a RuntimError with a generic "failed" message means that it should be possible. In fact, we could probably implement it ourselves. For example, we could (1) disable the error by default (but have some way to re-eanble?) What do you think? |
@spxiwh I'm getting back to addressing this. Do you have an example where the c-error would not be apparent in a notebook? The obvious example of EOB doesn't seem to be a problem (or possible the disabling of the io redirection doesn't work). For example running the following in a notebook seems to produce a sensible error,
This produces
Am I misunderstanding something or does this only happen for other functions? Do you have an example on hand? |
@ahnitz I don't see this behaviour. For me:
does not show the XLAL error, (although it does appear to globally disable the error messages and not temporarily do it as suggested). |
lal adds a warning now whenever it is imported. This is somewhat annoying especially in a notebook. I think we should just silence these.