Repository navigation
FEAT: Add a describe method for some basic info about graphs - #8338
Conversation
dschult
left a comment
There was a problem hiding this comment.
Nice!! :)
I like the ability to add your own description functions 🎉
Should this function return the info_dict? Then users can add/remove.
Or should we allow removal of some from the default report? Something like a kwarg show_hook_without_defaults=False. Or another option would be a kwarg that doesn't print and returns the info_dict. Okay! Just Stop Dan! :}
Maybe make the private helper function public?
| self.DGnodes = list(range(5)) | ||
| self.DGedges = [(0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2)] | ||
|
|
||
| def test_describe_info_dict(self): |
There was a problem hiding this comment.
Have you considered using this for testing the print logic? https://docs.python.org/3/library/contextlib.html#contextlib.redirect_stdout
There was a problem hiding this comment.
I think the doc_string acts to test the exact format of the output.
So in this case we might not need to test by capturing stdout.
I feel like the doc_strings are an integral part of our test suite.
If others feel like stdout should be tested in both places I'm willing to back off on this.
There was a problem hiding this comment.
Yeah, I was also using the doctest as the test for testing the print logic.
|
I dont see any problem with adding a new function to the release that is not in the RC. Will that mess up anything? It will still appear in the release notes right? It won't mix up any users because it is adding something --- not changing/removing. So as long as this doesn't mess up maintenance or release processes I would say we are good to go. |
Fixes #5326
I think 3 years is the perfect time to get this done 😄
This adds a new function which computes some couple of stats as proposed in #5326, users can also hook into the describe function if they want to calculate more properties.