Conversation
…le is used in from_input_file method
Memory benchmark result| Test Name | %Δ | Master (MB) | PR (MB) | Δ (MB) | Time PR (s) | Time Master (s) |
| -------------------------------------- | ------------ | ------------------ | ------------------ | ------------ | ------------------ | ------------------ |
test_objective_jac_w7x | 0.59 % | 4.107e+03 | 4.131e+03 | 24.38 | 43.66 | 39.15 |
test_proximal_jac_w7x_with_eq_update | -0.16 % | 6.664e+03 | 6.653e+03 | -10.80 | 160.32 | 160.25 |
test_proximal_freeb_jac | -0.04 % | 1.340e+04 | 1.340e+04 | -5.49 | 88.74 | 89.24 |
test_proximal_freeb_jac_blocked | -0.17 % | 7.785e+03 | 7.771e+03 | -13.37 | 78.19 | 77.91 |
test_proximal_freeb_jac_batched | -0.21 % | 7.719e+03 | 7.703e+03 | -16.37 | 77.30 | 77.30 |
test_proximal_jac_ripple | -0.04 % | 3.671e+03 | 3.670e+03 | -1.34 | 66.18 | 67.10 |
test_proximal_jac_ripple_bounce1d | 2.07 % | 3.843e+03 | 3.923e+03 | 79.57 | 78.65 | 78.44 |
test_eq_solve | 1.13 % | 2.211e+03 | 2.237e+03 | 25.07 | 98.03 | 98.74 |For the memory plots, go to the summary of |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2148 +/- ##
=======================================
Coverage 94.48% 94.48%
=======================================
Files 102 102
Lines 28721 28724 +3
=======================================
+ Hits 27137 27141 +4
+ Misses 1584 1583 -1
🚀 New features to boost your workflow:
|
| print("Converting VMEC input to DESC input") | ||
| path = self.input_path + "_desc" | ||
| basename = os.path.basename(self.input_path) + "_desc" | ||
| tmpdir = tempfile.mkdtemp() |
There was a problem hiding this comment.
When does the delete operation occur on tmpdir? Does it do so automatically when the function ends?
Another option is to use with, i.e.
with tempfile.TemporaryDirectory() as tmpdir:
path = os.path.join(tmpdir, basename = os.path.basename(self.input_path) + "_desc")
though it could be essentially the same.
There was a problem hiding this comment.
I think it should be cleared after the python process is terminated or the session on the cluster is closed or the system is rebooted on personal laptop, not immediately after the function call. These are the options listed on the web for "when the tmp is cleared?".
|
When I ran the test, the temp directory still existed after the code ran. |
|
Add a flag for tmp file option |
|
Try to pass a file-like object |
Resolves #2139
InputReader.parse_inputsmethod now writes the DESC input file to a temporary file where users have write access.