distribution.py 文件源码

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

项目:CAAPR 作者: Stargrazer82301 项目源码 文件源码
def add_value(self, value):

        """
        This function ...
        :param value:
        :return:
        """

        # Add the value to the list
        self.values.append(value)

        # Create the new (normalized) distribution
        new_distribution = Distribution.from_values(self.values)
        new_distribution.normalize(1.0, method="max")
        buf = io.BytesIO()

        # Add the reference distributions
        for label in self.reference_distributions: self._plotter.add_distribution(self.reference_distributions[label], label)

        # Add the new distribution
        self._plotter.add_distribution(new_distribution, self.label)
        self._plotter.set_variable_name(self.variable_name)
        self._plotter.run(buf, format="png", min_value=self.min_value, max_value=self.max_value, max_count=1., logscale=True)
        buf.seek(0)
        im = imageio.imread(buf)
        buf.close()
        self.add_frame(im)

        # Clear the plotter
        self._plotter.clear()

    # -----------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号