result.py 文件源码

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

项目:smrt 作者: smrt-model 项目源码 文件源码
def concat_results(result_list, coord):
    """Concatenate several results from :py:meth:`smrt.core.model.Model.run` (of type :py:class:`Result`) into a single result (of type :py:class:`Result`). This extends
    the number of dimension in the xarray hold by the instance. The new dimension is specified with coord

    :param result_list: list of results returned by :py:meth:`smrt.core.model.Model.run` or other functions.
    :param coord: a tuple (dimension_name, dimension_values) for the new dimension. Dimension_values must be a sequence or array with the same length as result_list.

    :returns: :py:class:`Result` instance

    """

    dim_name, dim_value = coord

    return Result(xr.concat([result.data for result in result_list], pd.Index(dim_value, name=dim_name)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号