How to get the checkpoint path?

I believe this still does not answer the original question.
When on_save_checkpoint is called, how do I tell if the checkpoint will be saved in self.best_model_path or self.last_model_path?
(In the very common case where we are saving both the best and the last model)

For my use-case, I’m using the following:

def on_save_checkpoint(self, checkpoint):
    filepath = reach("filepath")

where reach is defined as:

def reach(name):
    for f in inspect.stack():
        if name in f[0].f_locals:
            return f[0].f_locals[name]
    return None 

As seen in: https://stackoverflow.com/questions/15608987/how-can-i-access-variables-from-the-caller-even-if-it-isnt-an-enclosing-scope