firedrakeproject / fiat

This is FIAT. FIAT was previously maintained as part of the FEniCS project (https://github.com/fenics/fiat)
GNU Lesser General Public License v3.0
5 stars 7 forks source link

Don't reset all warning filters on element construction #59

Closed angus-g closed 11 months ago

angus-g commented 11 months ago

I guess the code here was trying to make any warnings related to the enclosed LU factorisation/solve into errors, but it was then resetting the entire warnings filter. This shouldn't be done from library code, the pattern should be to use the catch_warnings context manager to ensure the previous state is restored.

(I don't know if PRs should go here, or upstream?)