当前位置: 首页>>代码示例>>Python>>正文


Python Datacube.variablesWithRoles方法代码示例

本文整理汇总了Python中pyview.lib.datacube.Datacube.variablesWithRoles方法的典型用法代码示例。如果您正苦于以下问题:Python Datacube.variablesWithRoles方法的具体用法?Python Datacube.variablesWithRoles怎么用?Python Datacube.variablesWithRoles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyview.lib.datacube.Datacube的用法示例。


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

示例1: TestDatacubeManipulation

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import variablesWithRoles [as 别名]
class TestDatacubeManipulation(unittest.TestCase):

  """
  Tests the data manipulation functions of the datacube class.
  """
  
  def setUp(self):
    self._cube = Datacube()
    self._cube.addVariables(["x","y","z"])
  
  def tearDown(self):
    pass
    
  def test_set(self):
    pass
    
  def test_commit(self):
    pass
    
  def test_get_column(self):
    pass
    
  def test_create_column(self):
    pass
    
  def test_goto(self):
    pass
    
  def test_insert(self):
    pass
    
  def test_description(self):
    pass
    
  def test_name(self):
    pass
    
  def test_tags(self):
    pass
    
  def test_parameters(self):
    pass
    
  def test_table_geometry(self):
    pass
    
  def test_children(self):
    pass
    
  def test_addRoles(self):
    roles = ["somerole","anotherrole"]
    self._cube.addRoles("x",roles)
    self.assertEqual(self._cube.roles("x"),roles)
    
  def test_setRoles(self):
    roles = ["somerole","anotherrole"]
    self._cube.addRoles("x",["garbage"])
    self._cube.setRoles("x",roles)
    self.assertEqual(self._cube.roles("x"),roles)
    
  def test_variablesWithRoles(self):
    self._cube.setRoles("x",["1","2","3"])
    self._cube.setRoles("y",["2","3","4"])
    self._cube.setRoles("z",["3","4","5"])
    
    self.assertEqual(self._cube.variablesWithRoles(["1"]),["x"])
    self.assertEqual(self._cube.variablesWithRoles(["2"]),["x","y"])
    self.assertEqual(self._cube.variablesWithRoles(["3"]),["x","y","z"])
    self.assertEqual(self._cube.variablesWithRoles(["3","4"]),["y","z"])
    self.assertEqual(self._cube.variablesWithRoles(["3","4","5"]),["z"])
开发者ID:adewes,项目名称:pyview,代码行数:72,代码来源:test_datacube.py


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