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)))
评论列表
文章目录