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

DEP : adding not_implemented_for("multigraph”) to k_core, k_shell, k_crust and k_corona #7121

Merged
merged 3 commits into from Nov 30, 2023

Conversation

Schefflera-Arboricola
Copy link
Contributor

@Schefflera-Arboricola Schefflera-Arboricola commented Nov 17, 2023

In the first commit, I have deprecated the behavior of the above four k_ functions to not take a MultiGraph object as an argument.

The above four functions are not defined for a multigraph so it would be appropriate to add a not_implemented_for("multigraph”) decorator and strictly not allow a MultiGraph object to avoid any confusion about multigraph and MultiGraph class.

Also, when the core_number dictionary is not passed as an argument in these functions and a MultiGraph object is passed, then a NetworkXNotImplemented exception is raised. But, when the core_number dictionary is given then the same MultiGraph graph won't raise any exceptions. So, to avoid this kind of inconsistent behavior we should add the decorator.

In the second commit, I have just added some more tests for the other functions in core.py.

origin : #7027

Thank you :)

@Schefflera-Arboricola Schefflera-Arboricola marked this pull request as draft November 17, 2023 20:36
@Schefflera-Arboricola Schefflera-Arboricola marked this pull request as ready for review November 17, 2023 20:50
@MridulS MridulS added this to the 3.3 milestone Nov 29, 2023
Copy link
Member

@MridulS MridulS left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks @Schefflera-Arboricola

@dschult dschult merged commit 6bfea96 into networkx:main Nov 30, 2023
39 checks passed
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request Apr 22, 2024
…l`, `k_crust` and `k_corona` (networkx#7121)

* DEP 4 k_ functions

* added a few more tests

* bug : replaced nx.is_multigraph(G) with G.is_multigraph()
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.

None yet

3 participants