import copy


def trim_last_gridpoint(gridpoints):
    """Remove the last gridpoint for each dimension. 
        This is done so that the first and last point are one bin away for periodic grids.  
    
    Parameters
    ----------
    gridpoints: list of numpy arrays
        Gridpoints to be trimmed.
        
    Returns
    -------
    list of numpy arrays
        List of trimmed gridpoints. None the original grids are not modified.
    
    """
    
    new_gridpoints = copy.copy(gridpoints)
    for i in range(len(new_gridpoints)):
        new_gridpoints[i] = new_gridpoints[i][:-1]
        
    return new_gridpoints