ngnrsaa / qflex

Flexible Quantum Circuit Simulator (qFlex) implements an efficient tensor network, CPU-based simulator of large quantum circuits.
Apache License 2.0
96 stars 24 forks source link

does pytest close and remove mkstemp file handles? #132

Closed alexandrupaler closed 4 years ago

alexandrupaler commented 4 years ago

The simulation_test.py script uses temporary files. https://github.com/ngnrsaa/qflex/blob/c7038b0e06d2f9312a3b5db41dcd9a244f276220/tests/python/simulation_test.py#L268

The documentation of mkstemp mentions that the user is responsible for removing the files. The handles are not removed with something like below

os.close(fd)
os.unlink(path)

Is this intended behaviour?

s-mandra commented 4 years ago

Now that pybind can read from vector of strings, I don't need tempfiles anymore.

alexandrupaler commented 4 years ago

Yes, but this is unfortunate, because the last eight hours I designed everything around tmpfiles. Please keep the interface consistent for the moment, because it makes a merge very difficult by the deadline.

s-mandra commented 4 years ago

I understand, I just needed time to complete the interface. And again, I'm sorry you had to rewrite part of your code.

kkissell commented 4 years ago

This is fixed in the patch I uploaded in #289. mkstemp isn't optimal for this use case.