Skip to content
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 docstring example for directed tree. #7449

Merged
merged 1 commit into from
May 21, 2024

Conversation

rossbar
Copy link
Contributor

@rossbar rossbar commented May 15, 2024

Closes #7410

Copy link
Member

@dschult dschult left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to create what was provided prior to #7410 we could add another example like:

DG = nx.DiGraph(nx.dfs_edges(G, source=0))

But I think we decided that this approach did not produce uniformly random directed trees on pretty much any set of directed trees one might consider.

So, I put that example here in the PR instead of in the doc_string. A dedicated user who wants to reproduce the previous behavior badly enough can use that one-liner. But we're not going to advertise it for general (or new) users.

My only suggestion is maybe we should use G.edges inside nx.DiGraph.

Thanks @rossbar

@dschult dschult merged commit e0e7c7d into networkx:main May 21, 2024
43 checks passed
@jarrodmillman jarrodmillman added this to the 3.4 milestone May 21, 2024
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Can't replicate directed functionality of deprecated random_tree
3 participants