Skip to content

Fixed the return type from an empty dict to an empty set - #7910

Merged
rossbar merged 4 commits into
networkx:mainfrom
akshitasure12:bugfix-for-issue-7907
Mar 20, 2025
Merged

rossbar merged 4 commits into
networkx:mainfrom
akshitasure12:bugfix-for-issue-7907

Conversation

@akshitasure12

@akshitasure12 akshitasure12 commented Mar 18, 2025 •

Copy link
Copy Markdown
Contributor

Addressing issues #7909

This PR involves the suggested changes :

  1. fix the typo {} -> set()
  2. Adding documentation text under the Returns section about when an empty set is returned.

Additional Changes :

  1. Fix test assertion tests_minimum_st_node_cut() by using set() instead of {} for empty set comparison.

dschult
dschult previously approved these changes Mar 19, 2025

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

Thanks very much for this!
And for catching the dict vs set mistake in the tests too. :)

I just have one minor wording suggestion. But it is not a blocker if you like it better the way it is.
Either way, I approve this PR.

@dschult dschult linked an issue Mar 19, 2025 that may be closed by this pull request
@dschult
dschult dismissed their stale review March 19, 2025 14:00

oops -- I reread the issue and we should do more in the docstring here...

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

Sorry for the false start -- I re-read the original issue and would like to implement their suggestion for a docstring comment more directly by mentioning all ways we can get the empty set as output.

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

This looks good to me. Thanks!!

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

Thanks @akshitasure12 and @dschult !

@rossbar
rossbar merged commit 1828ada into networkx:main Mar 20, 2025
@jarrodmillman jarrodmillman added this to the 3.5 milestone May 29, 2025
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.

minimum_st_node_cut returns empty dict instead of empty set

4 participants