test_plotter.py 文件源码

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

项目:psyplot 作者: Chilipp 项目源码 文件源码
def test_data_props_list(self):
        """Test the data properties of Formatoptions with an InteractiveList"""
        data = psyd.InteractiveList([xr.DataArray([]), xr.DataArray([])])
        plot_data = data.copy(True)
        plot_data.extend([xr.DataArray([]), xr.DataArray([])],
                         new_name=True)
        plotter = TestPlotter(data)
        plotter.plot_data = plot_data
        plot_data = plotter.plot_data  # the data might have been copied

        self.assertIs(plotter.fmt1.raw_data, data)
        self.assertIs(plotter.fmt1.data, plot_data)

        # test with index in list
        plotter.fmt1.index_in_list = 1
        self.assertIs(plotter.fmt1.raw_data, data[1])
        self.assertIs(plotter.fmt1.data, plot_data[1])

        # test with index in list of plot_data outside raw_data
        plotter.fmt1.index_in_list = 3
        self.assertIs(plotter.fmt1.data, plot_data[3])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号