Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected output to STDOUT when iterating over iterable returned by graph_from_networkx #14

Closed
bushidocodes opened this issue Apr 4, 2019 · 1 comment

Comments

@bushidocodes
Copy link

Thank you so much for your work on this library. I'm a graduate student just getting into this technique, and your framework and documentation has been quite helpful! πŸ™‡β€β™‚οΈπŸ‘

I'm doing a project involving callgraphs of Android malware (~40k vertices), which are currently in gml format. I've been converting them into grakel graphs by way of networkx, as below:

gml_paths = [os.path.join(root, file) for root, directories, files in os.walk(path) for file in files if file.endswith(".gml")]
networkx_graphs = [nx.read_gml(path) for path in gml_paths]
grakel_graphs = graph_from_networkx(networkx_graphs, as_Graph=True)

The thing that is surprising to me is that the second I use grakel_graphs, for example, be coercing into a list list(grakel_graphs), a string representation of the graph gets dumped to STDOUT.

When I work in Jupyter Notebook, this results in the following error:
image

Is this a logging feature or is there some way to disable this functionality to silently convert to lists?

Apologies in advance if there is a naive Python issue on my end. I'm an experienced developer, but new to the language ecosystem.

Thanks!

@ysig
Copy link
Owner

ysig commented Apr 11, 2019

The graph_from_networkx function was a feature that was added at the last moment on the version 0.1.5. There was a dangling print which was removed in the upcoming version 0.1.6.
Please Install the latest grakel: https://github.com/ysig/GraKeL/tree/0.1a6
or remove it yourself by commenting lines: https://github.com/ysig/GraKeL/blob/develop/grakel/utils.py#L330
and 331 on your current version.

Sorry for the inconvenience :(

@ysig ysig closed this as completed Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants