Open ceball opened 9 years ago
How this has been addressed in topographica (I guess):
# Create new logger to ensure param logging shows in notebooks
iplogger = logging.getLogger('ip-param')
iplogger.addHandler(logging.StreamHandler(stream=sys.stderr))
iplogger.propagate = False
param.parameterized.logger = iplogger
Does that seem like something that could go into param instead? If so, I'm happy to see things move out of Topographica and into lower-level libraries where they make sense...
You can move this to param if you like.
This was added because param logging behaved badly in IPython Notebooks without it. If you have a better idea of how info messages should behave in notebooks, go ahead and implement it.
Check if this is still a problem
Not sure if this is the right ticket, but it seems not possible to hide param
warnings in a notebook with
import warnings
warnings.filterwarnings('ignore')
Only the following hack at the end of the execution works:
%%javascript
$('div.output_stderr').hide();
Not sure if this is the right ticket, but it seems not possible to hide param warnings in a notebook with
Indeed param warnings are using Python's logging
to cannot be filtered via the warnings
module. You have to manipulate param
's logger to hide the warnings.
I think the Aug 11, 2020 issue is the opposite of this one; both are worth addressing, but separately (e.g. by making Param warnings use warnings
rather than logging
, and making the fix in this issue).
Logging seems to behave differently under ipython notebook vs. python
Python:
In a notebook, however, I only get the warning message (not the info):