Repository navigation
Docs: add nx-neptune backend documentation - #8258
Conversation
|
@acarbonetto thanks for this! It's nice to see more backends implemented in the wild :) NetworkX has weekly community meetings and I think it would be great to get a quick demo of this if possible! We meet 9am Vancouver time weekly on Thursdays. Link to the .ics https://scientific-python.org/calendars/networkx.ics. It's okay if you can't make it, no pressure :) I would just need to go fiddle around with AWS then. |
Yes. I would love to give a demo! I've tried to attend a couple of times at 8am PST on Fridays but there was nobody there. I must have had an old calendar event. I'll do my absolute best to be there tomorrow at 9am with an AWS setup. |
There was a problem hiding this comment.
Thanks @acarbonetto !
the nx-neptune's additional docs are not showing up in the networkx's docs: https://output.circle-artifacts.com/output/job/1caf1279-a381-4f13-9e53-d8b9a28c50a8/artifacts/0/doc/build/html/search.html?q=neptune -- but not a blocker for this PR-- smthng to be done on nx-neptune's side. For reference, nx-parallel's get_info : https://github.com/networkx/nx-parallel/blob/main/_nx_parallel/__init__.py
Thank you! |
rossbar
left a comment
There was a problem hiding this comment.
@acarbonetto - very cool stuff, thanks for putting this together and taking the time to demo at the meeting!
AFAIK there's no "official" policy laying out criteria for linking to backends from the NX docs. Absent that, here's my personal take:
I'm generally in favor of adding links to doc/backends.md for projects that make good-faith attempts at bringing functionality to users! So I'd be +1 on adding that change right now.
There also exists the infrastructure for auto-generating cross-links to backend implementations of some functions: see e.g. the bottom of the pagerank docs page for an example of the rendered output. For this cross-linking IMO the bar should be a little higher - namely it'd be important (to me at least) that the backend have a test suite in place that for the subset of NX functionality that the backend implements. In principal the process for doing so is documented though I've never actually gone through it myself!
Does that seem reasonable? I'm very open to others' thoughts! Either way, AIUI (and maybe @eriknw can double-check my understanding) this PR would essentially just add nx-neptune to the backends page, which I'd be in favor of, even if it's still in alpha/beta/pre-release phase. Assuming my mental model for things isn't completely off base, I approve!
I've added an issue on the nx-neptune side to make sure that testing suites are hooked up (awslabs/nx-neptune#29). It can be a problem to have a CI /automatic github action to test the suite because the AWS offering has to be setup to test with (including authentication). We can add a test suite that runs locally - at least until an alternative is discovered. |
Signed-off-by: Andrew Carbonetto <[email protected]>
|
Thanks @acarbonetto - looking at the rendered docs my initial impression is that the "additional parameters" bit is too much extra information for the docstring. My preference would be to limit the additional docs to a link to the related backend docs as is done with the other backends. In an ideal world, the link target would take you straight to the neptune docs page for the linked function, but I'm not sure whether the infrastructure is in place to make that easy. Just my 2 cents. Since this PR now also includes the doc cross-linking, I'm going to go ahead and remove my approval until we've had time to discuss that! |
Change in scope for PR: need to evaluate the doc cross-linking and what should be in place for doing so!
You can add a "Source" Also, additional parameters (like |
The idea of including them as additional arguments is that they are available at a high-level to users. So anyone who's looking at the documentation will know that the Amazon-algorithm parameters are available. I agree that the amount of details may be too specific for this documentation. I'm going to propose moving the details to a separate .md in the nx-neptune repo. I'll build an example and let you all take a look. |
|
Nice! I like how function-specific notes are still included in the docstring and also having a link for more details. Some of the additional docstrings are rendered oddly. Note that networkx doesn't use dedent or any sort of cleaning of these inputs (maybe we should?): networkx/networkx/utils/backends.py Lines 1886 to 1891 in 2f56b65 See how And see how The additional docstrings are defined here: Maybe we should try to have NetworkX clean up these strings to be more accommodating. This isn't something I've put much effort into. Oh, and my two cents are having tests--especially running networkx tests--is best practice even if only run locally, but I understand this may be more difficult, inconvenient, or costly for some backends. As long as backends are striving to do well and making an honest effort--and respond to user feedback--I'm okay with including them. |
|
Thanks for your feedback! I'll see if I can clean up the docs. I'm concerned about adding inline formatting in case there's any formatting done on the nx side. So I'll keep it limited.
These are run locally against an instance of Neptune in the cloud. Unfortunately, there's no good way to run these in github actions right now as CI (not without a full account set up at least). That being said, we have an issue to investigate an alternative (e.g. using a mock): awslabs/nx-neptune#29. |
dschult
left a comment
There was a problem hiding this comment.
This all seems to be working, and generally looks good to me.
As far as timing goes, we plan to release networkx 3.6 in October. So the docs would become public then. It looks like nx-neptune is in an Alpha release phase based on the Readme. Do you want the NX public links to be available while in Alpha? Or should we hold off until after 3.6 release and then merge (once we merge it will be on our "latest" docs -- then when we make the release they show up in our "stable" docs.
We should probably build a set of guidelines for backend doc inclusion, style, testing etc.
By the way, the testing is set up so you set some environment variables and then run all the networkx test suite. For functions not provided by neptune get run in NetworkX while the provided functions (including when other networkx function call that function) use the neptune backend. In your case you still need to set up the resource to make it run. But you don't need to worry about which tests to run -- just run them all and rely on the fallback to allow the tests to pass.
I'm going to approve this PR with the idea that follow-up changes and our guidelines, etc should come in separate PRs. Thanks @acarbonetto!
Correct. I can run these locally, as we don't yet have a set of resources to run against in CI. This is partially why we are labelling the release as "alpha".
As mentioned during the demo, the other reason for the "alpha" label is to get usage data before a v1.0 release. The preview library is stable, within the test scenarios that we've run - but we'd like to get more pipelines and use cases before declaring it stable. Regardless, the backend is out in the wild and we want people to use it. |
|
@rossbar @eriknw @Schefflera-Arboricola would you have a chance to take a look at the latest documentation? |
|
@rossbar |
Adds nx-neptune to backend.md list of compatible integration clients.
References:
Install from pypi:
Some notable changes: