diff options
| author | Mridul Seth <seth.mridul@gmail.com> | 2022-05-31 22:24:18 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-31 11:24:18 -0700 |
| commit | 2a05ccdb07cff88e56661dee8a9271859354027f (patch) | |
| tree | 545f85bbbd99987845fa5fab08cb61fccbf510df /networkx/algorithms/swap.py | |
| parent | 9c29872a6358cb24b80765a25891dc75ca4379aa (diff) | |
| download | networkx-2a05ccdb07cff88e56661dee8a9271859354027f.tar.gz | |
Remove redundant py2 numeric conversions (#5661)
* Remove redundant float conversion
* Remove redundant int conversion
* Use integer division
Co-authored-by: Miroslav Šedivý <6774676+eumiro@users.noreply.github.com>
Diffstat (limited to 'networkx/algorithms/swap.py')
| -rw-r--r-- | networkx/algorithms/swap.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/networkx/algorithms/swap.py b/networkx/algorithms/swap.py index 8a06a5f3..208022ef 100644 --- a/networkx/algorithms/swap.py +++ b/networkx/algorithms/swap.py @@ -220,7 +220,7 @@ def connected_double_edge_swap(G, nswap=1, _window_threshold=3, seed=None): fail = True # If one of the swaps failed, reduce the window size. if fail: - window = int(math.ceil(window / 2)) + window = math.ceil(window / 2) else: window += 1 # If the window is large, then there is a good chance that a bunch of @@ -265,5 +265,5 @@ def connected_double_edge_swap(G, nswap=1, _window_threshold=3, seed=None): G.remove_edge(u, x) G.remove_edge(v, y) swapcount -= 1 - window = int(math.ceil(window / 2)) + window = math.ceil(window / 2) return swapcount |
