deepsnap icon indicating copy to clipboard operation
deepsnap copied to clipboard

mostly cosmetic, adding some type hints, and clarifying comments

Open amirziai opened this issue 4 years ago • 4 comments

amirziai avatar Feb 22 '21 02:02 amirziai

thanks @zechengz . i see, looks like snapx comes as a part of snap which is the pypi package snap-stanford?

what do you think about this:

GraphType = Union[nx.Graph, sx.Graph]

...

def __init__(self, G: Optional[GraphType] = None, netlib=None, **kwargs):

also again totally ok if you prefer it the way it is. adding the type hint makes it more clear for me when i'm reading the code but i understand if it's in the way.

amirziai avatar Feb 24 '21 09:02 amirziai

@zechengz lmk if you like the suggestion above, otherwise i can drop the type params and we can merge this. thanks!

amirziai avatar Mar 02 '21 18:03 amirziai

thanks @zechengz . i see, looks like snapx comes as a part of snap which is the pypi package snap-stanford?

what do you think about this:

GraphType = Union[nx.Graph, sx.Graph]

...

def __init__(self, G: Optional[GraphType] = None, netlib=None, **kwargs):

also again totally ok if you prefer it the way it is. adding the type hint makes it more clear for me when i'm reading the code but i understand if it's in the way.

Sorry about the late reply. Thanks, it looks good to me. Yes, currently snapx is part of the the pypi package snap-stanford, which has a similar interface with the networkx. If you are interested, one example deepsnap supports snapx is https://github.com/snap-stanford/deepsnap/blob/master/examples/node_classification_cora.py

zechengz avatar Mar 08 '21 07:03 zechengz

thanks @zechengz , just made the change. lmk if you have any other feedback i should consider.

amirziai avatar Mar 08 '21 21:03 amirziai