roman-corgi / corgidrp

Data Reduction Pipeline for the Roman Coronagraph Instrument
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Local file writes will fail when the repo is used in the official GSW docker image #194

Closed ajeldorado closed 2 months ago

ajeldorado commented 2 months ago

Describe the bug In various files, there are local file writes for directories such as with os.mkdir and for files such as with plt.savefig. The repo will eventually be used in a docker image that does not allow writing files within the repo, so the unit test suite will fail in that situation. In the other GSW repos, we have used tempfile.mkstemp() to avoid this problem.

To Reproduce Steps to reproduce the behavior: This behavior cannot be replicated until after the code has been delivered and packaged into a docker image.

Expected behavior The unit tests are all expected to pass.

corgidrp version:

Additional context

semaphoreP commented 2 months ago

When we delivered the interim release of corgidrp to the CTC, the unit tests ran and we didn't have this issue. What would be different in a future release?

ajeldorado commented 2 months ago

OK, that's good then. Going through the PRs and Issues for the other GSW repos, it looks I had the problem stated wrong. The file writing worked OK, but we had a problem with the files written during the unit test persisting. So the solution there was to make sure to delete the created files once they were done. That was likely a problem with the tests that wrote hundreds or thousands of full sized frames. If the unit tests in corgidrp only write a handful of small files, then it might be OK to leave them as is.

semaphoreP commented 2 months ago

Ok, closing the issue for now then. Please re-open if needed.