In plot_result_maps (postprocessing.py:189-271) plt.close(f) is called only inside the grensvlak loop. The model-grid (doorsnedelijnen), drain-elevation (oppervlaktewater), freshwater-head and concentration-at-surface figures are created, saved and then left open.
With the default matplotlib backend that is a steadily growing set of live figures for the rest of the process, and matplotlib warns once more than 20 are open. In 09pwnmodel2 the function is called once so the practical cost is small, but any loop over stress periods or scenarios accumulates them.
Fix: close every figure after _save, or wrap the body so each figure is closed in a finally.
Found while writing the test suite (the tests close figures in an autouse fixture, which is why this does not surface as a test failure).
In
plot_result_maps(postprocessing.py:189-271)plt.close(f)is called only inside the grensvlak loop. The model-grid (doorsnedelijnen), drain-elevation (oppervlaktewater), freshwater-head and concentration-at-surface figures are created, saved and then left open.With the default matplotlib backend that is a steadily growing set of live figures for the rest of the process, and matplotlib warns once more than 20 are open. In 09pwnmodel2 the function is called once so the practical cost is small, but any loop over stress periods or scenarios accumulates them.
Fix: close every figure after
_save, or wrap the body so each figure is closed in afinally.Found while writing the test suite (the tests close figures in an autouse fixture, which is why this does not surface as a test failure).