from pathlib import Path


def get_timestep(path):
    """
    Get the timestep from a filename.
    """
    path = Path(path)
    fname = path.stem
    tstep = fname.split('.')[-1]
    return int(tstep)