Allow "debug" mode for running time consuming safety/sanity checks
During the set up of a model it can be useful to do typical checks to see if you made a mistake.
Possible things to keep in mind when implementing this:
- Allow timeouts of operations (if they are too expensive, don't hang but just fail and go on to the next one).
- Always do error checks that are simple and take nanoseconds to complete (and scale well with nr. of goals, constraints, states etc). Do not put these behind a debug flag
- Use filtering lambdas, or integers to specify what classes/types of debug tests the user wants to run. A simple boolean may not be sufficient. (Or it may be for now, but should be forward compatible with more generic options).
Suggestions: self.debug
, self.debug_mode
, self.run_checks
?
Edited by Tjerk Vreeken