utils.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:oocgcm 作者: lesommer 项目源码 文件源码
def _grid_location_equals(xarr,grid_location=None):
    """Return True when the xarr grid_location attribute is grid_location

    Parameters
    ----------
    xarr : xarray.DataArray
       xarray dataarray which attributes should be tested.
    grid_location : str
        string describing the grid location : eg 'u','v','t','f'...

    Returns
    -------
    test : bool
        boolean value of the test.

    """
    test = True
    if xarr.attrs.has_key('grid_location'):
        test *= (xarr.attrs['grid_location']==grid_location)
    return test
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号