-
Notifications
You must be signed in to change notification settings - Fork 94
Import export #32
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
Import export #32
Conversation
Export from PyGSP to external libraries. Work in progress, the exports methods haven't been tested yet
change tempoary implemented in @classmethods and still not tested. Futhermore some optimization could be done especialy on the import from graph tool
The test create a graph in pygsp, convert it into the lib and load it back A random graph from the lib si created as well and loaded then exported again
The documentation for the import and export methods have been started
Work in progress. not tested but the 'gml' format has been implemented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work @cgallay! :)
I like the implementation in general. I've played with it and it works.
In the end I like the classmethod for the from_*
methods. At some point we may also transition the graph constructors to class methods, and move the Graph
object down to the pygsp
namespace, i.e., we'd use pygsp.Graph.from_*
instead of pygsp.graphs.Graph.from_*
.
Some general comments:
- Travis CI fails with
ModuleNotFoundError: No module named 'graph_tool'
, as graph-tool needs to be installed. It might however be painful to install on Travis. Maybe it's easier to start using conda for CI. Or is there a way to conditionally ignore some tests? Please look into it and advise. - Use intersphinx to refer to the documentation of networkx and graph-tool. Look how it is done for pyunlocbox. Configuration in doc/conf.py.
- Add the new features to doc/history.rst.
- In general, use
make lint
to check style. Or have a style checker / static analyzer in your text editor. There's many errors prior to your change. Ignore those, but fix yours. - In docstrings, have an Examples section that shows how to use the function. That's of great help to the users!
- Trim white space. There should be no spaces at the end of lines or on empty lines.
- When importing and exporting signals and adjacency matrices, be sure that the node ordering corresponds.
There's many inline comments. But don't worry, that's training! As you learn, there will be less of them for the next PRs. :)
If you execute the below code, you can open
The export to gml and gexf does however not work. Can you investigate why?
The three works with graph-tool, but the graphml seems broken.
I would suggest to export with all combinations of library and format, then look with a text editor if the files are fine. Then open them in gephi and cytoscape and look if everything (number of nodes, edges, edge weight, node properties, directed/undirected) is fine. Another observation: |
Importing seems to work with networkx and graphml:
For graph-tool, it works with graphml and gml, but not dot:
Loading graph_gt.dot raises Exporting with networkx and importing with graph-tool works (i.e., |
Accept change Co-Authored-By: cgallay <[email protected]>
Accept change Co-Authored-By: cgallay <[email protected]>
accept change Co-Authored-By: cgallay <[email protected]>
Hi @mdeff ,
Here is the PR for the "issue31" So that we can talk directly about it. Let me know what's need to be improved or any other comment.