-
Notifications
You must be signed in to change notification settings - Fork 310
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
Add entry point to tell NetworkX about nx-cugraph without importing it. #3848
Add entry point to tell NetworkX about nx-cugraph without importing it. #3848
Conversation
This allows NetworkX docstrings to be updated. This needs a companion PR in NetworkX.
Companion networkx PR is up: networkx/networkx#6911 |
"functions": { | ||
# BEGIN: functions | ||
"betweenness_centrality", | ||
"edge_betweenness_centrality", | ||
"louvain_communities", | ||
# END: functions | ||
}, | ||
"extra_docstrings": { | ||
# BEGIN: extra_docstrings | ||
"betweenness_centrality": "`weight` parameter is not yet supported.", | ||
"edge_betweenness_centrality": "`weight` parameter is not yet supported.", | ||
"louvain_communities": "`threshold` and `seed` parameters are currently ignored.", | ||
# END: extra_docstrings | ||
}, | ||
"extra_parameters": { | ||
# BEGIN: extra_parameters | ||
"louvain_communities": { | ||
"max_level : int, optional": "Upper limit of the number of macro-iterations.", | ||
}, | ||
# END: extra_parameters | ||
}, |
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.
Alternatively, we could organize info like:
"functions": {
# BEGIN: functions
"betweenness_centrality": {
"extra_docstring": "`weight` parameter is not yet supported.",
},
"edge_betweenness_centrality" : {
"extra_docstring": "`weight` parameter is not yet supported.",
},
"louvain_communities": {
"extra_docstring": "louvain_communities": "`threshold` and `seed` parameters are currently ignored.",
"extra_parameters": {
"max_level : int, optional": "Upper limit of the number of macro-iterations.",
},
},
# END: functions
},
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.
Looked good, nothing jumped out. I had a couple of questions though.
# from . import convert_matrix | ||
# from .convert_matrix import * | ||
|
||
# from . import generators | ||
# from .generators import * |
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.
Is this dead code we can remove?
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.
It is future code, yet to be born
/merge |
This allows NetworkX docstrings to be updated (among other things).
This will have a companion PR in NetworkX. We still need to determine (and agree) on the dict returned by this entry point, and NetworkX doesn't need to use everything I have here. We should probably add a string for
"description"
that gives a very short description of the backend, and maybe"url"
or"homepage"
or whatever so online docs can have links.Here's how to use the entry point (Python >= 3.10) after installing it:
CC @rlratzel @betochimas