WillianFuks / tfcausalimpact

Python Causal Impact Implementation Based on Google's R Package. Built using TensorFlow Probability.
Apache License 2.0
613 stars 71 forks source link

Read summary templates via context manager to avoid unclosed files #102

Closed fedtf closed 3 months ago

fedtf commented 3 months ago

Missing explicit close call on template files sometimes leads to the file descriptors left unclosed. In some cases, this can manifest itself in tests if warnings are treated as errors. Using context managers fixes the issue