Skip to content

DOC: Add missing params to bfs_layout docstring. - #8086

Merged
Schefflera-Arboricola merged 3 commits into
networkx:mainfrom
rossbar:bfs_layout_missing_param
Jun 8, 2025
Merged

Schefflera-Arboricola merged 3 commits into
networkx:mainfrom
rossbar:bfs_layout_missing_param

Conversation

@rossbar

@rossbar rossbar commented Jun 2, 2025

Copy link
Copy Markdown
Contributor

Another minor thing I noticed while working on an nx guide: the bfs_layout docstring was missing a couple of parameters from the signature.

@Peiffap Peiffap left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Some suggestions below.

The alignment of nodes within a layer, either `"vertical"` or
`"horizontal"`

scale : number (default: 1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Both are correct, but I think we use x=y in most places.

Suggested change
scale : number (default: 1)
scale : number (default=1)

Comment thread networkx/drawing/layout.py Resolved
start : node in `G`
Starting node for bfs

align : string (default='vertical')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very minor nit but this uses single quotes as string delimiters whereas the rest of the description uses double quotes.

@rossbar rossbar left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I copied/pasted these directly from the multipartite_layout docstring - the only thing changed is the description of align - so adding more changes here will just increase inconsistency. Let's handle that separately!

@Schefflera-Arboricola
Schefflera-Arboricola merged commit f32dd40 into networkx:main Jun 8, 2025
amcandio pushed a commit to amcandio/networkx that referenced this pull request Jul 20, 2025
* DOC: Add missing params to bfs_layout docstring.

* Update networkx/drawing/layout.py

Co-authored-by: Gilles Peiffer <[email protected]>

---------

Co-authored-by: Gilles Peiffer <[email protected]>
Co-authored-by: Aditi Juneja <[email protected]>
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.

4 participants