OpenMDAO / pyCycle

Thermodynamic cycle modeling library, built on top of OpenMDAO
Other
78 stars 53 forks source link

changed several places where np.seterr was being called in order to keep the changes localized. #58

Closed naylor-b closed 1 year ago

naylor-b commented 1 year ago

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.