stencil.py 文件源码

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

项目:optimize-stencil 作者: Ablinne 项目源码 文件源码
def convert(self, other):
        """Convert a :class:`numpy.recarray` to a :class:`numpy.recarray` with additional fields, filling the additional fields with 0.

        :param other: The :class:`numpy.recarray` to be converted.
        :type other: :class:`numpy.recarray`"""

        a = self(np.zeros(self._nfields))
        if npv < (1,13,0):
            a[other.dtype.names] = other
        elif npv < (1,14,0):
            with warnings.catch_warnings():
                warnings.simplefilter('ignore', FutureWarning)
                a[:] = other
        else:
            for field_name in self._fields:
                a[field_name] = other[field_name]
        return a
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号