コード例 #1
0
ファイル: test_plot.py プロジェクト: shyams2/pychebfun
 def test_plot_complex(self):
     c = np.exp(1j * Chebfun.identity(domain=[-np.pi, np.pi]))
     xs, ys, xi, yi, d = plot_data(c, plot_res)
     self.assertEqual(d, 2, "dimension is two for complex chebfun")
     for X, Y in [(xs, ys), (xi, yi)]:
         dist = np.square(X) + np.square(Y)
         npt.assert_allclose(dist, 1, err_msg="The plot should be a circle")
     plot(c)
コード例 #2
0
ファイル: test_plot.py プロジェクト: olivierverdier/pychebfun
 def test_plot_complex(self):
     c = np.exp(1j*Chebfun.identity(domain=[-np.pi,np.pi]))
     xs,ys,xi,yi,d = plot_data(c, plot_res)
     self.assertEqual(d, 2, "dimension is two for complex chebfun")
     for X,Y in [(xs,ys), (xi,yi)]:
         dist = np.square(X) + np.square(Y)
         npt.assert_allclose(dist, 1, err_msg="The plot should be a circle")
     plot(c)
コード例 #3
0
ファイル: test_plot.py プロジェクト: olivierverdier/pychebfun
 def test_plot_circle(self):
     T = .5
     def cirper(x):
         return tools.circle(x, period=T)
     c = Chebfun.from_function(cirper, domain=[0,T])
     xs,ys,xi,yi,d = plot_data(c, plot_res)
     self.assertEqual(d, 2,)
     for X,Y in [(xs,ys), (xi,yi)]:
         dist = np.square(X) + np.square(Y)
         npt.assert_allclose(dist, 1, err_msg="The plot should be a circle")
     plot(c)
コード例 #4
0
ファイル: test_plot.py プロジェクト: shyams2/pychebfun
    def test_plot_circle(self):
        T = .5

        def cirper(x):
            return tools.circle(x, period=T)

        c = Chebfun.from_function(cirper, domain=[0, T])
        xs, ys, xi, yi, d = plot_data(c, plot_res)
        self.assertEqual(
            d,
            2,
        )
        for X, Y in [(xs, ys), (xi, yi)]:
            dist = np.square(X) + np.square(Y)
            npt.assert_allclose(dist, 1, err_msg="The plot should be a circle")
        plot(c)
コード例 #5
0
ファイル: test_plot.py プロジェクト: olivierverdier/pychebfun
 def test_too_many_dimensions(self):
     c = Chebfun.from_data(np.random.random_sample([3,4]))
     with self.assertRaises(ValueError):
         plot(c)
コード例 #6
0
ファイル: test_plot.py プロジェクト: olivierverdier/pychebfun
 def setUp(self):
     # Constuct the O(dx^-16) "spectrally accurate" chebfun p
     self.p = Chebfun.from_function(tools.f)
コード例 #7
0
ファイル: test_plot.py プロジェクト: shyams2/pychebfun
 def test_too_many_dimensions(self):
     c = Chebfun.from_data(np.random.random_sample([3, 4]))
     with self.assertRaises(ValueError):
         plot(c)
コード例 #8
0
ファイル: test_plot.py プロジェクト: shyams2/pychebfun
 def setUp(self):
     # Constuct the O(dx^-16) "spectrally accurate" chebfun p
     self.p = Chebfun.from_function(tools.f)