Suppress Casadi logging entirely? #2102
-
I am using a (relatively) simple model+experiment+params+solver combination inside of an objective function, all with the goal of optimizing a particular parameter set. In this case, the optimization evaluates the objective function numerous times, and many evaluation positions are infeasible/bad leading to Casadi warnings/errors. I've wrapped this objective evaluation in a try/except that suits my purposes, but the Casadi outputs are overly verbose (see below): I understand these warnings are wanted/needed in a lot of cases, but not in mine - so I'm curious if there is an option I can flag somewhere to completely suppress this logging output? I've searched the documentation, the most likely solution being setting the correct 'extra_options_call' option when setting up the solver (e.g., disable_internal_warnigns), but this did not work. I also looked through other discussions but couldn't find a similar question (apologies if I missed something). If this option isn't available, could I suggest it as a feature in the future? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Yeah, we've never figured out how to do this. It seems there should be some brute force way to divert the terminal output. Would be awesome if you can figure it out. |
Beta Was this translation helpful? Give feedback.
-
depending on how Casadi does its logging, you might want to try |
Beta Was this translation helpful? Give feedback.
-
I'm currently studying PyBaMM, and I have a exactly same question to yours. |
Beta Was this translation helpful? Give feedback.
Yeah, we've never figured out how to do this. It seems there should be some brute force way to divert the terminal output. Would be awesome if you can figure it out.