cytoscape / py2cytoscape

Python utilities for Cytoscape and Cytoscape.js
https://py2cytoscape.readthedocs.io
MIT License
178 stars 45 forks source link

Add the omitted __get_view_df #22

Closed dwgoon closed 8 years ago

dwgoon commented 8 years ago

The methods of CyNetworkView

_get_node_views_asdataframe() _get_edge_views_asdataframe()

do not work properly as follows:

df = view.get_edge_views_as_dataframe()
Traceback (most recent call last):

  File "<ipython-input-21-690d42d5378f>", line 1, in <module>
    df = view.get_edge_views_as_dataframe()

  File "C:\Anaconda\envs\py35\lib\site-packages\py2cytoscape\data\network_view.py", line 66, in get_edge_views_as_dataframe
    return self.__get_views('edges', format='df')

  File "C:\Anaconda\envs\py35\lib\site-packages\py2cytoscape\data\network_view.py", line 81, in __get_views
    raise ValueError('Format not supported: ' + format)

ValueError: Format not supported: df

The problem stems from the reason CyNetworkView.__get_views method does not handle the case of DataFrame format (represented as 'df') . I am wondering whether the omission was deliberate for the purpose of a development or maintenance.

keiono commented 8 years ago

@dwgoon Thanks for the fix. This looks good to me and will be merged in the next release.

dwgoon commented 8 years ago

Thanks for merging it! :)