首页 \ 问答 \ 图形工具:如何访问复制图形的属性(Graph-tool: How to access properties of a copied graph)

图形工具:如何访问复制图形的属性(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
更新时间:2024-02-03 11:02

最满意答案

根据您的日志,似乎您的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 SDKDrive 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 ...
  • 问题是由于使用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 ...
  • 编辑:对不起,我只是意识到,我们可以使用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 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。