Skip to content

Replace maybe_regular_expander with maybe_regular_expander_graph - #8050

Merged
dschult merged 6 commits into
networkx:mainfrom
Peiffap:deprecate_maybe_regular_expander
Jul 8, 2025
Merged

dschult merged 6 commits into
networkx:mainfrom
Peiffap:deprecate_maybe_regular_expander

Conversation

@Peiffap

@Peiffap Peiffap commented May 18, 2025

Copy link
Copy Markdown
Member

This adds the _graph suffix to the function name. I hope I got all the places the old function was used!

Follow-up to a comment by @dschult in #8048 (review)

@amcandio amcandio left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved. Would be cool to have a test that checks all returns graph methods are suffixed with "graph"

@dschult dschult changed the title Deprecate maybe_regular_expander Replace maybe_regular_expander with maybe_regular_expander_graph May 19, 2025

@rossbar rossbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm +1 for this renaming - IMO the added clarity from the _graph suffix is worth the deprecation cycle!

I think this will also need an additional warnings filter in conftest.py in addition to the merge conflict resolution, but LGTM - thanks @Peiffap !

Comment thread networkx/generators/expanders.py Resolved
Comment thread networkx/generators/expanders.py Resolved
@Peiffap

Peiffap commented Jul 8, 2025

Copy link
Copy Markdown
Member Author

Thanks for the review, @rossbar. I resolved the merge conflict (and moved the deprecation to 3.6), added your spacing suggestion, and added a filter for the warning.

@dschult dschult 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.

The name change looks good. The deprecation looks good.

Is this a candidate for our recent creation of getattr with some deprecated function names in networkx/__init__.py? I guess that is a question for when the old name gets removed.

I approve this PR

@dschult
dschult merged commit 9001c9e into networkx:main Jul 8, 2025
@Peiffap
Peiffap deleted the deprecate_maybe_regular_expander branch July 8, 2025 22:54
amcandio pushed a commit to amcandio/networkx that referenced this pull request Jul 20, 2025
…etworkx#8050)

* Deprecate `maybe_regular_expander`

* Add backticks

* Spacing after comma

Co-authored-by: Ross Barnowski <[email protected]>

* Change deprecation version

* Ignore `maybe_regular_expander` deprecation warning

---------

Co-authored-by: Ross Barnowski <[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