图形工具:如何访问复制图形的属性(Graph-tool: How to access properties of a copied graph)
我创建了图g的过滤图,并希望将其用作新图。 据我所知,属性也被复制,但我怎样才能访问它们? 如果我使用“重量”,它将是g而不是sub的属性映射。
weight = g.new_edge_property('float') vfilt = g.new_vertex_property('bool') ... old_sub = gt.GraphView(g, vfilt) sub = gt.Graph(old_sub, directed=False, prune=True)
如果属性没有复制到sub,那怎么办呢。 由于新图形具有相同数量的顶点,因此顶点的索引已更改。
非常感谢
I created a filtered graph of the graph g and would like to use it as a new graph. As far as I know the properties are also copied, but how can I access them? If I use "weight" it would be the property map of g not sub.
weight = g.new_edge_property('float') vfilt = g.new_vertex_property('bool') ... old_sub = gt.GraphView(g, vfilt) sub = gt.Graph(old_sub, directed=False, prune=True)
If the properties are not copied to sub, how can a do that. Since the new graph has not the same number of vertices, the index of the vertices has changed.
Thanks a lot
原文:https://stackoverflow.com/questions/44646647
最满意答案
根据您的日志,似乎您的404错误是由Drive API请求上返回的403错误引起的。
来自Google API的错误通常在其正文中包含解释。 在你的情况下:
"error": { "errors": [ { "domain": "usageLimits", "reason": "dailyLimitExceededUnreg", "message": "Daily Limit Exceeded. Please sign up", "extendedHelp": "https://code.google.com/apis/console" } ], "code": 403, "message": "Daily Limit Exceeded. Please sign up" } }
这通常意味着您尚未在Google API控制台项目中启用对Google Drive API的访问权限。 为此:
- 在Google API控制台中打开您的项目
- 转到服务部分
- 单击开/关切换启用Drive SDK和Drive API
- 不要忘了在Drive SDK部分配置您的应用程序,并在** API Access部分配置您的OAuth设置
这一切都在我们的文档的入门>注册应用程序部分中描述。 您还应该确保您阅读“ 入门”的其他小节。
I eventually managed to get it working. I'm not sure what was the problem before, but here are some tips for those who are facing similar problems:
The "Client ID for web applications" and the "Client ID for Drive SDK" confused me. Unfortunately the documentation doesn't tell you which one to use at which place, but it seems like you only need the "Client ID for web applications".
If you update your Chrome extension or the API console it could take some time until Drive recognizes those changes. For example, changing the OAuth Client ID in the API console could take some time until it takes effect, since everybody's caching. If you are testing your application, deleting cache and cookies helps speed up the process.
Good luck with your applications, and thanks to everybody who helped me!
相关问答
更多-
看起来像是在步骤3.8中引起的。 添加云端硬盘服务文件时,您还需要确保所有目标都已选中。 当我重试它时,我注意到只有* Tests目标被默认选中,所以在构建应用程序时这些文件不会被编译。 上一步中的.xib文件可能会发生类似的情况。 因此,在步骤3.7和3.8中,确保在“添加到目标”列表中选择“复制项目...”选项以及两个目标。 让我知道,如果这可以解决它,我会更新快速入门更具体一点。 Looks like that was caused at step 3.8. When adding the Drive ...
-
我今天也遇到了麻烦 - 我们看到的错误信息是误导性的。 我使用自己的代码遇到的一个问题是没有初始化授权程序并将其分配给GTLServiceDrive实例,但是如果您已经完全遵循了该示例代码,那么就为您完成了(在viewDidLoad中)。 您更有可能未在Google API控制台的“服务”标签中启用“云端硬盘API”。 我错误地启用了“Drive SDK”(可能只是绘制到唯一的Drive图标......) I had trouble with this as well today - the error m ...
-
我想回复自己,因为谷歌已经解决了这个问题。 :-) I want to reply myself, becuase the issue has been fixed by Google. :-)
-
我认为您使用的是错误的oauth范围,可能是https://www.googleapis.com/auth/drive.file ,它限制了您的应用访问由您的应用创建或打开的文件,当您应该使用https://www.googleapis.com/auth/drive可以完全控制您的应用。 I think you are using the wrong oauth scope, probably https://www.googleapis.com/auth/drive.file which restrict ...
-
Google Drive SDK(java)对文件列表的查询请求速度较慢(Google Drive SDK (java) slow on query request for Files List)[2022-06-16]
问题是由于使用ApacheHttpTransport而不是推荐的GoogleNetHttpTransport.newTrustedTransport()。 Issue was due to using ApacheHttpTransport, instead of the recommended GoogleNetHttpTransport.newTrustedTransport(). -
我找到了答案。 为了设置请求正文参数,Google Drive SDK会在每个请求对象上提供一个地图。 所以打电话 Files.Patch patchRequest = service.files().patch(fileId, file); patchRequest.set("key", "value"); 将为请求设置请求正文参数。 I found the answer for this. In order to set request body parameters, the Google Drive ...
-
Google Drive SDK例外(Google Drive SDK Exception)[2023-08-17]
编辑:对不起,我只是意识到,我们可以使用debug.keystore在调试模式下签署apk。 所以最重要的是在您的Google API控制台中插入正确的SHA1密钥。 (使用Stephen Wylie在其Google+信息中提到的JRE7工具生成) 另请参阅(developer.android.com/tools/publishing/app-signing.html#debugmode)以获取密钥库密码 经过一些试验和错误,我终于能够列出我的谷歌驱动器中的文件虽然我不确定这是否是最正确的答案,但至少我现在 ... -
根据您的日志,似乎您的404错误是由Drive API请求上返回的403错误引起的。 来自Google API的错误通常在其正文中包含解释。 在你的情况下: "error": { "errors": [ { "domain": "usageLimits", "reason": "dailyLimitExceededUnreg", "message": "Daily Limit Exceeded. Please sign up", "extendedHelp": "h ...
-
1)Android示例使用Google Play服务,我刚刚意识到它还没有推出。 2)虽然存在完全驱动器访问的授权范围https://developers.google.com/drive/scopes#requesting_full_drive_scope_for_an_app但是所有的Drive API似乎都是基于Web的,我认为设备OAuth令牌不会起作用,尤其是此页面上的警告https://developers.google.com/drive/register : 重要提示:在标有OAuth客户端 ...
-
我找到了解决方案。 Google文档忽略了一些重要的事情: 观看Google视频而不是阅读Google教程(文本),因为某些拖放操作可能会破坏Xcode建筑物偏好设置 在Project> Build Phases> Compile Sources中添加GTLDrive_Sources.m 将GTL项目iOS部署目标选项切换到5.1(或其他)。 通过这三个步骤,你可以避免一些无聊的错误信息。 即使Google工程师在视频中也会遇到同样的错误! :-) I've found the solution. The ...