During parameter estimation, for some models, there are loads of log messages that one may want to ignore or redirect to some separate log file. Demonstrate how to filter or redirect amici sundials simulation logs.
Consider using a dedicated logger for simulation warnings/errors (not the current swig_wrappers.py logger).
EDIT:
For now, here an outdated snippet for filtering specific errors/warnings. To be integrated into the documentation.
class AmiciLogFilter(logging.Filter):
def filter(self, record):
msg = record.getMessage()
if "[BACKTRACE]" in msg:
return False
if "Inf value for ts[0]" in msg:
return False
return True
amici.swig_wrappers.logger.addFilter(AmiciLogFilter())
During parameter estimation, for some models, there are loads of log messages that one may want to ignore or redirect to some separate log file. Demonstrate how to filter or redirect amici sundials simulation logs.
Consider using a dedicated logger for simulation warnings/errors (not the current
swig_wrappers.pylogger).EDIT:
For now, here an outdated snippet for filtering specific errors/warnings. To be integrated into the documentation.