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


Python DVIDNodeService.get_keys方法代码示例

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


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

示例1: test_keyvalue

# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import get_keys [as 别名]
    def test_keyvalue(self):
        node_service = DVIDNodeService(TEST_DVID_SERVER, self.uuid)
        node_service.create_keyvalue("keyvalue_test")
        node_service.put("keyvalue_test", "key1", "val1")
        readback_value = node_service.get("keyvalue_test", "key1")
        self.assertEqual(readback_value, "val1")

        node_service.put("keyvalue_test", "key2", "val2")
        readback_value = node_service.get("keyvalue_test", "key2")
        self.assertEqual(readback_value, "val2")

        keys = node_service.get_keys("keyvalue_test")
        assert isinstance(keys, collections.Iterable)
        assert set(keys) == set(["key1", "key2"])
  
        with self.assertRaises(ErrMsg):
            node_service.put("keyvalue_test", "key1", 123) # 123 is not a buffer.
开发者ID:podgorskiy,项目名称:libdvid-cpp,代码行数:19,代码来源:test_node_service.py

示例2: DVIDNodeService

# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import get_keys [as 别名]
        print "ex: python ./generate_body_synapses_dvid.py emdata1:8500 44d42 bodies3_annotations mb6_synapses annotations body_synapses_test"
        sys.exit(1)

    dvid_server = sys.argv[1]
    dvid_uuid = sys.argv[2]
    body_annotations_name = sys.argv[3]
    annotations_synapses = sys.argv[4]
    annotations_keyvalue = sys.argv[5]
    body_synapses_key = sys.argv[6]

    # Libdvid has problems with trailing slashes in urls
    if dvid_server.endswith('/'):
        dvid_server = dvid_server[0:-1]
    http_dvid_server = "http://{0}".format(dvid_server)    
    node_service = DVIDNodeService(dvid_server, dvid_uuid, '[email protected]', 'generate body synapses')
    response = node_service.get_keys(body_annotations_name)


    # proxies = {'http': 'http://' + dvid_server + '/'}

    # dvid_get_annotated_bodies = "http://" + dvid_server + "/api/node/" + dvid_uuid + "/" + body_annotations_name + "/keys"

    # print "dvid_url " + dvid_get_annotated_bodies

    # response = urllib.urlopen(dvid_get_annotated_bodies, proxies=proxies).read()


    bodies_annot_data = list(response)

    group_synapses = []
    body_theshold = 0
开发者ID:janelia-flyem,项目名称:DVIDScripts,代码行数:33,代码来源:generate_body_synapses_dvid.py

示例3: open

# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import get_keys [as 别名]
	BLOCK_SIZE = 32
	SUBSTACK_LENGTH = BLOCK_SIZE * args.PARTITION_SIZE

	if args.inputjson:
		with open(args.inputjson) as fh:
			metrics = json.load(fh)
			makeAllSubstacksTable(metrics, "{}_substack_metrics.xls".format(args.roi))
			make3DJSON(metrics, ["edges", "unassigned edges", "assigned edges", "tbars/active volume", "psds/active volume", "tbars/total volume", "psds/total volume", "percent assigned edges"], args.roi)
		print "Completed writing output"
		exit()

	#substacks, packing_factor = ns.get_roi_partition(args.roi, args.PARTITION_SIZE)
	substacks =  getROIPartition(ns, args.roi, args.PARTITION_SIZE)
	bodysizes = {}
	if args.bodyname:
		bodylist = ns.get_keys(args.bodyname)
		bodylist = [int(body) for body in bodylist]
	elif args.bodypath:
		bodylist = []
		with open(args.bodypath) as fh:
			for line in fh:
				bodyid = line.split('\t')[0]
				bodylist.append(int(bodyid))

	print "Substack count: {}".format(len(substacks))
	substack_metrics = []
	for iter1, substack in enumerate(substacks):
		# XYZ coordinates
		z, y, x = substack['z'], substack['y'], substack['x']
		zsize, ysize, xsize = SUBSTACK_LENGTH, SUBSTACK_LENGTH, SUBSTACK_LENGTH
		# TODO make annotations a dictionary for each metric, and then display on graph
开发者ID:janelia-flyem,项目名称:DVIDScripts,代码行数:33,代码来源:metrics_for_substacks.py


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