choderalab / assaytools

Modeling and Bayesian analysis of fluorescence and absorbance assays.
http://assaytools.readthedocs.org
GNU Lesser General Public License v2.1
18 stars 11 forks source link

Quickmodel should explicitly close figures after writing them to disk #100

Closed jchodera closed 7 years ago

jchodera commented 7 years ago

This warning appears when running quickbayes.sh:

/Users/choderaj/miniconda3/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
sonyahanson commented 7 years ago

I can add plt.clf() after this line in the current PR: https://github.com/choderalab/assaytools/blob/master/scripts/quickmodel.py#L422

Think this will be sufficient?

jchodera commented 7 years ago

I believe the error message is explicitly telling you to close the figure with plt.close(), so no, I don't think clearing the figure immediately before creating a new one with plt.figure() would do the trick. You should plt.close(fig1) after the fig1.savefig() call if you don't need the figure anymore.

sonyahanson commented 7 years ago

This line was added in the most recent PR, so hopefully this is not an issue anymore?

https://github.com/choderalab/assaytools/blob/master/scripts/quickmodel.py#L164

Sorry, should have referred to this issue.

sonyahanson commented 7 years ago

@jchodera Can we close this?

jchodera commented 7 years ago

Sure!