In several places in pyCycle the global error handling behavior was being set via np.seterr and was either not reset at all after the numerical operation was complete or was reset to some specific behavior like 'warn' which would override any previous settings. This made it impossible to set the global error behavior while debugging a specific model that has pyCycle systems in it. This PR puts a try..finally block around the numerical operation(s) and restores the previous behavior of np.seterr afterward.
In several places in pyCycle the global error handling behavior was being set via np.seterr and was either not reset at all after the numerical operation was complete or was reset to some specific behavior like 'warn' which would override any previous settings. This made it impossible to set the global error behavior while debugging a specific model that has pyCycle systems in it. This PR puts a try..finally block around the numerical operation(s) and restores the previous behavior of np.seterr afterward.