• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python space.space函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中space.space函数的典型用法代码示例。如果您正苦于以下问题:Python space函数的具体用法?Python space怎么用?Python space使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了space函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_constructors

    def test_constructors(self):

        """Test space constructors"""

        a = space.space()
        self.assertEqual(a.x, 0)
        self.assertEqual(a.y, 0)
        self.assertEqual(a.z, 0)
        self.assertSpaceAreEqual(a, space.Uo)

        a = space.space(self.x1)
        self.assertEqual(a.x, self.x1)
        self.assertEqual(a.y, 0)
        self.assertEqual(a.z, 0)

        a = space.space(self.x1, self.y1)
        self.assertEqual(a.x, self.x1)
        self.assertEqual(a.y, self.y1)
        self.assertEqual(a.z, 0)

        a = space.space(self.x1, self.y1, self.z1)
        self.assertSpaceAreEqual(self.space1, a)

        a = space.space(z=self.z2, x=self.x2, y=self.y2)
        self.assertSpaceAreEqual(self.space2, a)
开发者ID:vmlaker,项目名称:CartesianSpace,代码行数:25,代码来源:test_space.py


示例2: test_add

 def test_add(self):
     """Test add"""
     a = space.space(self.A, self.B, self.C)
     b = space.space(-self.A, -self.B, -self.C)
     c = a + b
     self.assertEqual(0, c.x)
     self.assertEqual(0, c.y)
     self.assertEqual(0, c.z)
开发者ID:vmlaker,项目名称:CartesianSpace,代码行数:8,代码来源:test_space.py


示例3: test_space_noop_richcompare_space

 def test_space_noop_richcompare_space(self):
     """Test space >, >=, <, <= space"""
     a = space.space(1, 2, 3)
     b = space.space(4, 5, 5)
     self.assertRaises(TypeError, lambda a, b: a > b)
     self.assertRaises(TypeError, lambda a, b: a >= b)
     self.assertRaises(TypeError, lambda a, b: a < b)
     self.assertRaises(TypeError, lambda a, b: a <= b)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:8,代码来源:test_space.py


示例4: test_copy_constructor

    def test_copy_constructor(self):
        """Test space copy constructor"""

        a = space.space(self.A, self.B, self.C)
        b = space.space(a)
        self.assertEqual(self.A, b.x)
        self.assertEqual(self.B, b.y)
        self.assertEqual(self.C, b.z)
开发者ID:vmlaker,项目名称:CartesianSpace,代码行数:8,代码来源:test_space.py


示例5: test_subtract

 def test_subtract(self):
     """Test subtract"""
     a = space.space(self.A, self.B, self.C)
     b = space.space(self.A, self.B, self.C)
     c = a - b
     self.assertEqual(c.x, 0)
     self.assertEqual(c.y, 0)
     self.assertEqual(c.z, 0)
开发者ID:vmlaker,项目名称:CartesianSpace,代码行数:8,代码来源:test_space.py


示例6: test_prints

    def test_prints(self):
        """Test space print and repr"""

        a = space.space(self.x2, self.y2, self.z2)

        self.assertEqual(self.two_as_str, str(a))
        self.assertEqual(self.two_as_repr, repr(a))
开发者ID:vmlaker,项目名称:CartesianSpace,代码行数:7,代码来源:test_space.py


示例7: test_copy_assign_2

 def test_copy_assign_2(self):
     """Test copy assignment operator is shallow"""
     a = space.space(1,2,3)
     b = a
     b.x(4.0)
     self.assertTrue(a == b)
     self.assertEqual(4, b.x())
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:7,代码来源:test_space.py


示例8: test_xyz_assignments

 def test_xyz_assignments(self):
     """Test space xyz assignment operators"""
     a = space.space()
     a.x(self.p1.x())
     a.y(self.p1.y())
     a.z(self.p1.z())
     self.assertTrue(self.p1 == a)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:7,代码来源:test_space.py


示例9: test_space_minus_space

 def test_space_minus_space(self):
     """Test space - space"""
     result = space.space(self.p1.x() - self.p2.x(),
                          self.p1.y() - self.p2.y(),
                          self.p1.z() - self.p2.z())
     a = self.p1 - self.p2
     self.assertTrue(result == a)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:7,代码来源:test_space.py


示例10: test_space_plus_space

 def test_space_plus_space(self):
     """Test space + space"""
     result = space.space(self.p1.x() + self.p2.x(),
                          self.p1.y() + self.p2.y(),
                          self.p1.z() + self.p2.z())
     a = self.p1 + self.p2
     self.assertTrue(result == a)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:7,代码来源:test_space.py


示例11: test_divide

 def test_divide(self):
     """Test divide (scale)"""
     result = space.space(self.p1.x / 2.0,
                          self.p1.y / 2.0,
                          self.p1.z / 2.0)
     a = self.p1 / 2.0
     self.assertTrue(result == a)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:7,代码来源:test_space.py


示例12: test_unitary_minus

 def test_unitary_minus(self):
     """Test space = -space"""
     result = space.space(-self.p1.x,
                          -self.p1.y,
                          -self.p1.z)
     a = -self.p1
     self.assertTrue(result == a)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:7,代码来源:test_space.py


示例13: test_space_eq_space

 def test_space_eq_space(self):
     """Test space == space"""
     result = space.space(self.p1.x + self.p2.x,
                          self.p1.y + self.p2.y,
                          self.p1.z + self.p2.z)
     a = self.p1 + self.p2
     self.assertTrue(result == a)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:7,代码来源:test_space.py


示例14: test_default_constructor

 def test_default_constructor(self):
     """Test default constructor"""
     a = space.space()
     self.assertEqual(0, a.x)
     self.assertEqual(0, a.y)
     self.assertEqual(0, a.z)
     self.assertTrue(space.Uo == a)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:7,代码来源:test_space.py


示例15: createSpaces

 def createSpaces(self):
     for x in range(8):
         List = []
         for y in range(8):
             List.append(space(y,x))
         self.spaces.append(List)
     self.spaces.reverse()
开发者ID:seebreeze35,项目名称:Chameleon-Checkers,代码行数:7,代码来源:board.py


示例16: test_inplace_subtract

 def test_inplace_subtract(self):
     """Test space -="""
     result = space.space(self.p1.x - self.p2.x,
                          self.p1.y - self.p2.y,
                          self.p1.z - self.p2.z)
     a = self.p1
     a -= self.p2
     self.assertSpacesAreEqual(result, a)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:8,代码来源:test_space.py


示例17: test_inplace_add

 def test_inplace_add(self):
     """Test space +="""
     result = space.space(self.p1.x + self.p2.x,
                          self.p1.y + self.p2.y,
                          self.p1.z + self.p2.z)
     a = self.p1
     a += self.p2
     self.assertSpacesAreEqual(result, a)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:8,代码来源:test_space.py


示例18: test_copy_assign_3

 def test_copy_assign_3(self):
     """Test copy assignment operator can use deep copy"""
     import copy
     a = space.space(1,2,3)
     b = copy.deepcopy(a)
     b.x = 4.0
     self.assertEqual(1, a.x)
     self.assertEqual(4, b.x)
开发者ID:lrmcfarland,项目名称:CartesianSpace,代码行数:8,代码来源:test_space.py


示例19: test_copy_assign

    def test_copy_assign(self):
        """Test space copy assign"""

        a = space.space(self.A, self.B, self.C)
        b = a
        self.assertEqual(self.A, b.x)
        self.assertEqual(self.B, b.y)
        self.assertEqual(self.C, b.z)
开发者ID:vmlaker,项目名称:CartesianSpace,代码行数:8,代码来源:test_space.py



注:本文中的space.space函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python space.unwind函数代码示例发布时间:2022-05-27
下一篇:
Python soya.set_root_widget函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap