test_plotter.py 文件源码

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

项目:psyplot 作者: Chilipp 项目源码 文件源码
def test_auto_update(self):
        """Test the :attr:`psyplot.plotter.Plotter.no_auto_update` attribute"""
        data = xr.DataArray([])
        plotter = TestPlotter(data, auto_update=False)
        self.assertFalse(plotter.no_auto_update)
        data.psy.init_accessor(auto_update=False)
        plotter = TestPlotter(data, auto_update=False)
        self.assertTrue(plotter.no_auto_update)

        plotter.update(fmt1=1)
        self.assertEqual(plotter['fmt1'], '')
        self.assertEqual(plotter._registered_updates['fmt1'], 1)

        plotter.start_update()
        self.assertEqual(plotter['fmt1'], '1')
        self.assertFalse(plotter._registered_updates)

        data.psy.no_auto_update = False
        self.assertFalse(plotter.data.psy.no_auto_update)
        self.assertFalse(plotter.no_auto_update)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号