armi icon indicating copy to clipboard operation
armi copied to clipboard

Closing all the plots that ARMI opens

Open john-science opened this issue 1 year ago • 2 comments

What is the change?

This PR makes sure that matplotlib plots in ARMI are closed.

Why is the change being made?

Someone recently complained to me that during their recent ARMI Application runs, they were getting matplotlib warnings that they had more than 20 plots open at a time.

I believe this is the result of an old design idea that ARMI should traffic in figure objects, passing them around freely. Maybe it was a nice idea, we could discuss, but I think it leaves open the real possibility that plots aren't closed when they should be.


Checklist

  • [X] The release notes have been updated if necessary.
  • [X] The documentation is still up-to-date in the doc folder.
  • [X] The dependencies are still up-to-date in pyproject.toml.

john-science avatar May 03 '24 23:05 john-science

I think a lot of ARMI PRs are failing right now because the unit tests aren't cleaning up after themselves.

In particular, after all the tests are run, a file named armiRun.h5 appears to be left in the base dir of the working area.

This should be remedied.

john-science avatar May 03 '24 23:05 john-science

I think a lot of ARMI PRs are failing right now because the unit tests aren't cleaning up after themselves.

In particular, after all the tests are run, a file named armiRun.h5 appears to be left in the base dir of the working area.

This should be remedied.

Interesting that it looks like it's only happening on windows and not linux

opotowsky avatar May 07 '24 18:05 opotowsky

So, matplotlib released a new version to PyPI.org today. This removed (or changed?) the old color map logic we are using:

https://github.com/terrapower/armi/blob/872e2dac316d937d06a9d3a7a314c48075204a2b/armi/utils/reportPlotting.py#L732

You will see get_cmap() in matplotlib==3.7.5, but not in matplotlib==3.8.4.

john-science avatar May 16 '24 15:05 john-science