Here are some changes that I think address all issues raised in the original PR #72:
I am creating the checkpoint dir using tempfile.mkdtemp, as suggested in this comment
Instead of the checkpoint file name, save_checkpoint and load_checkpoint now take the checkpoint file path as an argument. The main reason for this is to tidy up the code since I don't really see a benefit of doing it the other way around. I also think it was confusing. But I'm happy to revert this!
I moved get_checkpoint_dir from utility.py to checkpointing.py. I'm not sure why we'd have checkpointing-related things outside of checkpointing.py? :)
Added a test for attempting to load a checkpoint file that doesn't exist
Here are some changes that I think address all issues raised in the original PR #72:
tempfile.mkdtemp
, as suggested in this commentsave_checkpoint
andload_checkpoint
now take the checkpoint file path as an argument. The main reason for this is to tidy up the code since I don't really see a benefit of doing it the other way around. I also think it was confusing. But I'm happy to revert this!get_checkpoint_dir
fromutility.py
tocheckpointing.py
. I'm not sure why we'd have checkpointing-related things outside ofcheckpointing.py
? :)