tjgalvin / flint

BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Create Copy/Temporary context managers #118

Closed tjgalvin closed 4 weeks ago

tjgalvin commented 4 weeks ago

In an effort to nicely handle potential use of SLURM $MEMDIR and $LOCALDIR type local storage mechanisms I have attempted to spec out a couple context managers to help out.

The idea being that on entry to the context the necessarily files are copied over to the compute node local storage space while creating folders along the way, work is performed (e.g. wsclean on the local copy), and output files are copied back.

There are two managers:

Very much a toy at this point, but tests in tests/test_utils.py seem to mock up the expected behaviour with the use cases I have in mind. Likely can be evolved, e.g. add some extra files to place into hold_then_move_into on that folders creation.