bug fix in smallworld.py: random_reference and lattice_reference#6151
Merged
MridulS merged 8 commits intonetworkx:mainfrom Dec 20, 2022
Merged
bug fix in smallworld.py: random_reference and lattice_reference#6151MridulS merged 8 commits intonetworkx:mainfrom
MridulS merged 8 commits intonetworkx:mainfrom
Conversation
…d lattice_reference and tested
rossbar
approved these changes
Nov 10, 2022
Contributor
rossbar
left a comment
There was a problem hiding this comment.
This LGTM - this produces a much more informative exception for situations that already raise exceptions. Thanks @paulitapb !
Member
|
@paulitapb could you review the comments by @rossbar? |
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Contributor
|
FWIW the errors here seem to be due to various misspellings in the exception checking - should be an easy fix! |
|
|
||
| for o in omegas: | ||
| assert -1 <= o <= 1 | ||
|
|
Contributor
There was a problem hiding this comment.
Suggested change
The tests will need separation by two blank lines.
MridulS
pushed a commit
to MridulS/networkx
that referenced
this pull request
Feb 4, 2023
…workx#6151) * raise exception if graph has less than 2 edges in random_reference and lattice_reference and tested * Updated lattice_reference doc * Update networkx/algorithms/smallworld.py Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * Update networkx/algorithms/tests/test_smallworld.py Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * Added some suggestions * Added some final suggestions Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
cvanelteren
pushed a commit
to cvanelteren/networkx
that referenced
this pull request
Apr 22, 2024
…workx#6151) * raise exception if graph has less than 2 edges in random_reference and lattice_reference and tested * Updated lattice_reference doc * Update networkx/algorithms/smallworld.py Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * Update networkx/algorithms/tests/test_smallworld.py Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * Added some suggestions * Added some final suggestions Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6150.
Changed random_reference, and lattice_reference, now an exception is raised if the function is called with a graph with fewer than 2 edges. Also updated the documentation.