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

Python pydal.dalDataset函数代码示例

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

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



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

示例1: test_dataset_createTable

    def test_dataset_createTable(self):
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	tab = ds.createTable("table1")
    	tab = ds.createTable("table2")
    	tab = ds.createTable("table3")
	ds.close()
    	self.assertEqual(type(tab),pydal.dalTable)
开发者ID:SterVeen,项目名称:DAL1,代码行数:7,代码来源:dal_tests.py


示例2: test_table_appendRow

    def test_table_appendRow(self):  # modifies table1
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
    	for x in range(BIGNUM):
    	  ret = table.appendRow([6,2.6,36])
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:7,代码来源:dal_tests.py


示例3: test_table_readRows

    def test_table_readRows(self):
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
    	aa = table.readRows(0,1)
    	print aa
	ds.close()
    	self.assertTrue()
开发者ID:SterVeen,项目名称:DAL1,代码行数:7,代码来源:dal_tests.py


示例4: test_dataset_getAttribute_float_list

    def test_dataset_getAttribute_float_list(self):	# float
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	a = numpy.array([1.111,2.222,3.333])
    	b = ds.getAttribute_float("float_list_attribute")
    	# should be updated to compare expected with returned vals,
    	#  but needs the same precision.  Otherwise assertEqual fails.
	ds.close()
    	self.assertTrue(type(b)==numpy.ndarray)
开发者ID:SterVeen,项目名称:DAL1,代码行数:8,代码来源:dal_tests.py


示例5: test_table_write_col_data_by_index

    def test_table_write_col_data_by_index(self):  # modifies table3
	ds = pydal.dalDataset("testfile.h5","HDF5")
        t3 = ds.openTable("table3")
	# first create the rows in the table with appendRows
	ret = t3.appendRows([0 for x in range(BIGNUM*3)],BIGNUM)
        # then fill them with data using write_col_by_index
    	t3.write_col_by_index_boost(numpy.ones(BIGNUM,numpy.int16),0,0,BIGNUM)
    	t3.write_col_by_index_boost(numpy.ones(BIGNUM,numpy.float32),1,0,BIGNUM)
    	t3.write_col_by_index_boost(numpy.random.randint(0,100,BIGNUM),2,0,BIGNUM)
	ds.close()
    	self.assertTrue(t3)
开发者ID:SterVeen,项目名称:DAL1,代码行数:11,代码来源:dal_tests.py


示例6: test_table_addColumns

    def test_table_addColumns(self):
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
    	table.addColumn("col1", "dalINT", 1 )
    	table.addColumn("col2", "dalFLOAT", 1 )
    	table.addColumn("col3", "dalSHORT", 1 )
    	t2 = ds.openTable("table2")
    	t2.addColumn("col1", "dalFLOAT", 1 )
    	t2.addColumn("col2", "dalFLOAT", 1 )
    	t2.addColumn("col3", "dalFLOAT", 1 )
    	t3 = ds.openTable("table3")
    	t3.addColumn("col1", "dalSHORT", 1 )
    	t3.addColumn("col2", "dalFLOAT", 1 )
    	t3.addColumn("col3", "dalINT", 1 )
    	cols = table.listColumns()
	ds.close()
    	self.assertEqual(cols,['col1','col2','col3'])
开发者ID:SterVeen,项目名称:DAL1,代码行数:17,代码来源:dal_tests.py


示例7: test_table_appendRows

    def test_table_appendRows(self):  # modifies table2
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table2")
    	ret = table.appendRows([ 1.0 for x in range(BIGNUM*3)],BIGNUM)
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例8: test_table_setAttribute_short_list

    def test_table_setAttribute_short_list(self):	# list of shorts
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
	ret = table.setAttribute_short("short_attribute_list",[-3872, -330, 3840])
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例9: test_table_setAttribute_short

    def test_table_setAttribute_short(self):	# short
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
	ret = table.setAttribute_short("short_attribute",-3872)
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例10: test_table_setAttribute_uint_list

    def test_table_setAttribute_uint_list(self):	# list of uints
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
	ret = table.setAttribute_uint("uint_attribute_list",[92834, 6646, 333399])
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例11: len

if len(sys.argv) < 8:  range_plot = [0]
elif len((sys.argv[7]).split(':')) > 1:
        range_plot = list(range(int((sys.argv[7]).split(':')[0]),int((sys.argv[7]).split(':')[1])))
else: range_plot = [int(sys.argv[7])]
if len(sys.argv) < 9:  pol = 0
else:	pol = int(sys.argv[8])
if pol > 3:
        pol2 = pol-3
        pol = 0
        print("plotting pols %i and %i" % (pol, pol2))
else:
        pol2 = 0
        print("plotting pol %i" % (pol))

# open file
msds= dal.dalDataset()
if ( True != msds.open(sys.argv[1]) ):
        print("ERROR: Could not open file: " + sys.argv[1])
        print("       Please check the file and try again.")
        sys.exit(1)

# open tables
tablename = "MAIN";
msds.setFilter( "TIME," + data_name, \
        "ANTENNA1 = " + sys.argv[2] + " AND ANTENNA2 = " + sys.argv[3] + \
        " AND DATA_DESC_ID = " + subband )
table12 = msds.openTable( tablename );

msds.setFilter( "TIME," + data_name, \
        "ANTENNA1 = " + sys.argv[3] + " AND ANTENNA2 = " + sys.argv[4] + \
        " AND DATA_DESC_ID = " + subband )
开发者ID:revoltek,项目名称:scripts,代码行数:31,代码来源:closure_phase.py


示例12: test_dataset_createFloatArray_with_numpy_array

    def test_dataset_createFloatArray_with_numpy_array(self):
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	arr = ds.createFloatArray("floatarray1_numpy_array",[2,2],numpy.array([1.0,2.0,3.0,4.0]),[2,2])
	ds.close()
    	self.assertEqual(type(arr),pydal.dalArray)
开发者ID:SterVeen,项目名称:DAL1,代码行数:5,代码来源:dal_tests.py


示例13: test_table_setAttribute_int_list

    def test_table_setAttribute_int_list(self):		# list of ints
	ds = pydal.dalDataset("testfile.h5","HDF5")
	table = ds.openTable("table1")
	ret = table.setAttribute_int("int_attribute_list",[-23637, 0, 24898, 665557])
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例14: test_table_setAttribute_float_list

    def test_table_setAttribute_float_list(self):	# list of floats
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
	ret = table.setAttribute_float( "float_attribute_list", [87323.234, 998989.77777, -929292.521] )
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例15: test_table_setAttribute_double

    def test_table_setAttribute_double(self):	# double
	ds = pydal.dalDataset("testfile.h5","HDF5")
	table = ds.openTable("table1")
	ret = table.setAttribute_double( "double_attribute", 324.9287364 )
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例16: test_table_setAttribute_float

    def test_table_setAttribute_float(self):	# float
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
	ret = table.setAttribute_float( "float_attribute", 87323.234 )
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例17: test_table_setAttribute_long_list

    def test_table_setAttribute_long_list(self):	# list of longs
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
	ret = table.setAttribute_long("long_attribute_list",[2398226, 49895458, 5895869586958989])
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例18: test_table_setAttribute_long

    def test_table_setAttribute_long(self):	# long
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
	ret = table.setAttribute_long("long_attribute",2398226)
	ds.close()
    	self.assertTrue(ret)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例19: test_table_getNumberOfRows

    def test_table_getNumberOfRows(self): # depends on test_table_appendRows
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	table = ds.openTable("table1")
	num_rows = table.getNumberOfRows()
	ds.close()
    	self.assertEqual(num_rows,BIGNUM)
开发者ID:SterVeen,项目名称:DAL1,代码行数:6,代码来源:dal_tests.py


示例20: test_dataset_listTables

    def test_dataset_listTables(self):  # depends on test_createTable
	ds = pydal.dalDataset("testfile.h5","HDF5")
    	tabs = ds.listTables()
	ds.close()
    	self.assertEqual(tabs,[1])
开发者ID:SterVeen,项目名称:DAL1,代码行数:5,代码来源:dal_tests.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python pydal.DAL类代码示例发布时间:2022-05-25
下一篇:
Python _cffi.Z类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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