Closed ggggggggg closed 4 months ago
I don't believe relying on del data
to solve the re-use of filenames is going to work well. I'm closing this in favor of my next PR that fixes usages of the tempfile
API to ensure distinct filenames.
I just fixed this PR two minutes before you closed it!
Fine. You have a better idea that works better on Windows. Will close
We're seeing test failures related to hdf5 files still being open so we can't overwrite them. This is an attempt to fix it by explicitly closing our data objects that have references to hdf5 files, so that they close the hdf5 files. In the projectors script case there is no easy handle to the data object, so I call gc.collect instead.
We should probably re-run the tests on this a few times before merging.
Also it would be "more correct" to use the setup and teardown methods in the test harness to always close the relevant hdf5 files. I didn't want to re-write to use pytest style, or to use add features using the old unittest style. It may also be "more correct" to use temporary directories for each test so they don't try to overwrite each other, Joe objected since that is not standard usage. So
del data
was the remaining solution.