Save disk space by cleaning up decompressed files independently from legacy Fortran code succeeding or crashing.
Moved deleting the decompressed files from the shell script to the method LegacyWeightSolver.solve() so deletion takes place independently of any errors that might occur in the shell script and/or the legacy executables called by that script.
Safer removal of nn_orbmat.out: check for existing file before deleting.
Suggestion for testing:
Provoke an error in LegacyWeightSolver.solve(), right after executing the shell script (this simulates a script error). For example, this can be done in weight_solvers.py by changing line 316 from if not p.stdout.decode("UTF-8"): to if not p.stdout.decode("UTF-8") and False:.
Run any example using the LegacyWeightSolver.
Verify that after DYNAMITE crashes, there are no surviving orblib_*.dat files in any of the datfil/ folders (those would be the uncompressed files).
Optional: in line 314, change os.remove(f_name) to pass and re-run. The orblib_*.dat files should still be there in the datfil/ folder(s) after DYNAMITE crashes.
So far, tested successfully with test_nnls.py (after changing to the LegacyWeightSolver in its config file).
Save disk space by cleaning up decompressed files independently from legacy Fortran code succeeding or crashing.
LegacyWeightSolver.solve()
so deletion takes place independently of any errors that might occur in the shell script and/or the legacy executables called by that script.Safer removal of
nn_orbmat.out
: check for existing file before deleting.Suggestion for testing:
LegacyWeightSolver.solve()
, right after executing the shell script (this simulates a script error). For example, this can be done inweight_solvers.py
by changing line 316 fromif not p.stdout.decode("UTF-8"):
toif not p.stdout.decode("UTF-8") and False:
.LegacyWeightSolver
.orblib_*.dat
files in any of thedatfil/
folders (those would be the uncompressed files).os.remove(f_name)
topass
and re-run. Theorblib_*.dat
files should still be there in thedatfil/
folder(s) after DYNAMITE crashes.So far, tested successfully with
test_nnls.py
(after changing to theLegacyWeightSolver
in its config file).