modularitypruning 1.4.0__py3-none-any.whl → 1.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- modularitypruning/champ_utilities.py +8 -6
- modularitypruning/leiden_utilities.py +3 -4
- modularitypruning/louvain_utilities.py +6 -4
- modularitypruning/parameter_estimation.py +2 -1
- modularitypruning/parameter_estimation_utilities.py +7 -5
- modularitypruning/partition_utilities.py +1 -0
- modularitypruning/plotting.py +6 -4
- {modularitypruning-1.4.0.dist-info → modularitypruning-1.5.0.dist-info}/METADATA +12 -8
- modularitypruning-1.5.0.dist-info/RECORD +14 -0
- {modularitypruning-1.4.0.dist-info → modularitypruning-1.5.0.dist-info}/WHEEL +1 -1
- modularitypruning-1.4.0.dist-info/RECORD +0 -14
- {modularitypruning-1.4.0.dist-info → modularitypruning-1.5.0.dist-info/licenses}/LICENSE +0 -0
- {modularitypruning-1.4.0.dist-info → modularitypruning-1.5.0.dist-info}/top_level.txt +0 -0
@@ -1,14 +1,16 @@
|
|
1
|
-
|
2
|
-
membership_to_layered_communities
|
1
|
+
import warnings
|
3
2
|
from collections import defaultdict
|
4
|
-
import numpy as np
|
5
|
-
from numpy.random import choice
|
6
3
|
from math import floor
|
7
4
|
from multiprocessing import Pool, cpu_count
|
8
|
-
|
5
|
+
|
6
|
+
import numpy as np
|
7
|
+
from numpy.random import choice
|
9
8
|
from scipy.linalg import LinAlgWarning
|
10
9
|
from scipy.optimize import linprog, OptimizeWarning
|
11
|
-
import
|
10
|
+
from scipy.spatial import HalfspaceIntersection
|
11
|
+
|
12
|
+
from .partition_utilities import all_degrees, in_degrees, out_degrees, membership_to_communities, \
|
13
|
+
membership_to_layered_communities
|
12
14
|
|
13
15
|
|
14
16
|
def get_interior_point(halfspaces, initial_num_sampled=50, full_retry_limit=10):
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import functools
|
2
|
+
from multiprocessing import Pool, cpu_count
|
3
|
+
|
2
4
|
import igraph as ig
|
3
5
|
import leidenalg
|
4
|
-
from math import ceil
|
5
|
-
from multiprocessing import Pool, cpu_count
|
6
|
-
from tqdm import tqdm
|
7
6
|
import numpy as np
|
8
|
-
import
|
7
|
+
from tqdm import tqdm
|
9
8
|
|
10
9
|
LOW_MEMORY_THRESHOLD = 1e9 # 1 GB
|
11
10
|
|
@@ -6,14 +6,16 @@ module ``modularitypruning.louvain_utilities`` now shims single-layer functions
|
|
6
6
|
in ``modularitypruning.leiden_utilities`` (though it still contains the legacy multi-layer functions since they can be
|
7
7
|
faster in general -- leidenalg does not efficiently implement multilayer optimization).
|
8
8
|
"""
|
9
|
-
|
10
|
-
from .leiden_utilities import sorted_tuple, LOW_MEMORY_THRESHOLD
|
11
|
-
from .progress import Progress
|
9
|
+
import warnings
|
12
10
|
from math import ceil
|
13
11
|
from multiprocessing import Pool, cpu_count
|
12
|
+
|
14
13
|
import numpy as np
|
15
14
|
import psutil
|
16
|
-
|
15
|
+
|
16
|
+
from . import leiden_utilities
|
17
|
+
from .leiden_utilities import sorted_tuple, LOW_MEMORY_THRESHOLD
|
18
|
+
from .progress import Progress
|
17
19
|
|
18
20
|
try:
|
19
21
|
import louvain # import louvain if possible
|
@@ -1,8 +1,9 @@
|
|
1
|
+
import leidenalg
|
2
|
+
|
1
3
|
from .leiden_utilities import singlelayer_leiden, multilayer_leiden
|
2
4
|
from .parameter_estimation_utilities import leiden_part_with_membership, estimate_singlelayer_SBM_parameters, \
|
3
5
|
gamma_estimate_from_parameters, omega_function_from_model, estimate_multilayer_SBM_parameters
|
4
6
|
from .partition_utilities import in_degrees
|
5
|
-
import leidenalg
|
6
7
|
|
7
8
|
|
8
9
|
def iterative_monolayer_resolution_parameter_estimation(G, gamma=1.0, tol=1e-2, max_iter=25, verbose=False,
|
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
from
|
3
|
-
|
1
|
+
import warnings
|
2
|
+
from math import log
|
3
|
+
|
4
4
|
import igraph as ig
|
5
5
|
import leidenalg
|
6
|
-
from math import log
|
7
6
|
import numpy as np
|
8
7
|
from scipy.optimize import fsolve
|
9
|
-
|
8
|
+
|
9
|
+
from .champ_utilities import CHAMP_2D, CHAMP_3D
|
10
|
+
from .leiden_utilities import leiden_part_with_membership, sorted_tuple
|
11
|
+
from .partition_utilities import num_communities
|
10
12
|
|
11
13
|
|
12
14
|
def estimate_singlelayer_SBM_parameters(G, partition, m=None):
|
modularitypruning/plotting.py
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
from .partition_utilities import num_communities, ami
|
2
1
|
from collections import defaultdict
|
3
2
|
from random import sample, shuffle
|
4
|
-
|
3
|
+
|
5
4
|
import matplotlib
|
6
|
-
from matplotlib.patches import Polygon
|
7
|
-
from matplotlib.collections import PatchCollection
|
8
5
|
import matplotlib.pyplot as plt
|
6
|
+
import numpy as np
|
9
7
|
import seaborn as sbn
|
8
|
+
from matplotlib.collections import PatchCollection
|
9
|
+
from matplotlib.patches import Polygon
|
10
|
+
|
11
|
+
from .partition_utilities import num_communities, ami
|
10
12
|
|
11
13
|
|
12
14
|
def plot_adjacency(adj):
|
@@ -1,10 +1,9 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: modularitypruning
|
3
|
-
Version: 1.
|
4
|
-
Summary: Pruning tool to identify small subsets of network partitions that are significant from the perspective
|
5
|
-
|
6
|
-
|
7
|
-
Author-email: ryan.alex.gibson@gmail.com
|
3
|
+
Version: 1.5.0
|
4
|
+
Summary: Pruning tool to identify small subsets of network partitions that are significant from the perspective
|
5
|
+
Author-email: Ryan Gibson <ryan.alex.gibson@gmail.com>
|
6
|
+
License: MIT
|
8
7
|
Classifier: Development Status :: 5 - Production/Stable
|
9
8
|
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
10
9
|
Classifier: Programming Language :: Python :: 3
|
@@ -13,9 +12,11 @@ Classifier: Programming Language :: Python :: 3.9
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
16
17
|
Classifier: Programming Language :: Python :: 3 :: Only
|
17
18
|
Classifier: License :: OSI Approved :: MIT License
|
18
|
-
Requires-Python: >=3.8
|
19
|
+
Requires-Python: >=3.8
|
19
20
|
Description-Content-Type: text/markdown
|
20
21
|
License-File: LICENSE
|
21
22
|
Requires-Dist: leidenalg
|
@@ -24,9 +25,10 @@ Requires-Dist: numpy
|
|
24
25
|
Requires-Dist: psutil
|
25
26
|
Requires-Dist: igraph
|
26
27
|
Requires-Dist: scikit-learn
|
27
|
-
Requires-Dist: scipy
|
28
|
+
Requires-Dist: scipy>=1.7
|
28
29
|
Requires-Dist: seaborn
|
29
30
|
Requires-Dist: tqdm
|
31
|
+
Dynamic: license-file
|
30
32
|
|
31
33
|
# ModularityPruning
|
32
34
|
|
@@ -47,6 +49,7 @@ https://static-content.springer.com/esm/art%3A10.1038%2Fs41598-022-20142-6/Media
|
|
47
49
|
).
|
48
50
|
|
49
51
|
## Installation
|
52
|
+
|
50
53
|
This project is on [PyPI](https://pypi.org/project/modularitypruning/) and can
|
51
54
|
be installed with
|
52
55
|
|
@@ -61,6 +64,7 @@ Alternatively, you can install it from this repository directly:
|
|
61
64
|
python3 setup.py install
|
62
65
|
|
63
66
|
<a name = "Basic Usage"></a>
|
67
|
+
|
64
68
|
## Basic Usage
|
65
69
|
|
66
70
|
This package interfaces directly with python-igraph. A simple example of its
|
@@ -0,0 +1,14 @@
|
|
1
|
+
modularitypruning/__init__.py,sha256=U1iz51AVVzHw0aBZeJicxVg_L6TWq5pmv8Ep_bYyySU,238
|
2
|
+
modularitypruning/champ_utilities.py,sha256=yRLng9KciNxJst3Ybp24qlRnYvIEIe5Y-ZVsfSijkqc,16350
|
3
|
+
modularitypruning/leiden_utilities.py,sha256=kHHYFj30Ezl_YUhgmwEm-vPZ4K7658MqTGegra_4V_8,10360
|
4
|
+
modularitypruning/louvain_utilities.py,sha256=duGAK0PlIJvtpo689dNuRNixNXvLIWAPf-5ELGhEHZ4,8233
|
5
|
+
modularitypruning/parameter_estimation.py,sha256=n0_VPXa6QvFZqVEKhHSBUrnqQPTLRNGgNLDTsVymYT4,10480
|
6
|
+
modularitypruning/parameter_estimation_utilities.py,sha256=teJvq_w1gSjmA2weV9PDKTLN2xgCWgsIQhiY6ZlJ_xU,28152
|
7
|
+
modularitypruning/partition_utilities.py,sha256=0hPEftbV6xcYWdusiE65UZG99kqIrALH7Nwo_44KO-Q,957
|
8
|
+
modularitypruning/plotting.py,sha256=48yRl0--q1adi415pps1MbTtKtBMQxKVOXoRjPOxu-w,10570
|
9
|
+
modularitypruning/progress.py,sha256=XxkEVx8L9BoFnWtvUPg-kWtxUmE1RHqs5p5HPiTExUQ,971
|
10
|
+
modularitypruning-1.5.0.dist-info/licenses/LICENSE,sha256=eWz3HIQQxg7p1iSpUOUDKdDhGcuMPuVDDlcXf9F12D8,1068
|
11
|
+
modularitypruning-1.5.0.dist-info/METADATA,sha256=Vlq4_S_RBr4nUUuDwPw1n_jYZg4iI2tVP6xrDkCzwGk,3454
|
12
|
+
modularitypruning-1.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
13
|
+
modularitypruning-1.5.0.dist-info/top_level.txt,sha256=ZPOx3a-ek0Ge0ZMq-uvbySSaAL9MZ-t23-JkuHZXo9E,18
|
14
|
+
modularitypruning-1.5.0.dist-info/RECORD,,
|
@@ -1,14 +0,0 @@
|
|
1
|
-
modularitypruning/__init__.py,sha256=U1iz51AVVzHw0aBZeJicxVg_L6TWq5pmv8Ep_bYyySU,238
|
2
|
-
modularitypruning/champ_utilities.py,sha256=VveP8N9CvMODk3dPtVMRfNLji1pktaolA6iNoW6Fy-A,16348
|
3
|
-
modularitypruning/leiden_utilities.py,sha256=sV3BkYONzVmKlpy-gUUUoL8XfKhwpytMRmCcijbsAiA,10395
|
4
|
-
modularitypruning/louvain_utilities.py,sha256=Zt58Wl4hgu6-zejdl-N_NW04UC4rbYmSHgpfoGDC2Ws,8231
|
5
|
-
modularitypruning/parameter_estimation.py,sha256=EPU5BDDauToPbAdG1lZc9p5Rl_oDqiC7bltfnjs5tg8,10479
|
6
|
-
modularitypruning/parameter_estimation_utilities.py,sha256=OzgJT4jOo2ovoHzUbS0m40l2cqqOk9tBU9cF35Tmm_M,28150
|
7
|
-
modularitypruning/partition_utilities.py,sha256=Fizqd0JuODL8W4BP2h8iV0WhZMK6HoKjH_QFNVDZkaI,956
|
8
|
-
modularitypruning/plotting.py,sha256=3JqJOpfoq_Vj_6y8nqrYHhkSqDdI56iAb4pSAMcgEmI,10568
|
9
|
-
modularitypruning/progress.py,sha256=XxkEVx8L9BoFnWtvUPg-kWtxUmE1RHqs5p5HPiTExUQ,971
|
10
|
-
modularitypruning-1.4.0.dist-info/LICENSE,sha256=eWz3HIQQxg7p1iSpUOUDKdDhGcuMPuVDDlcXf9F12D8,1068
|
11
|
-
modularitypruning-1.4.0.dist-info/METADATA,sha256=ZtLw4-g6NiP2r4G3Wcfk_ND_5wTjrNCn8etyjOkx5QM,3420
|
12
|
-
modularitypruning-1.4.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
13
|
-
modularitypruning-1.4.0.dist-info/top_level.txt,sha256=ZPOx3a-ek0Ge0ZMq-uvbySSaAL9MZ-t23-JkuHZXo9E,18
|
14
|
-
modularitypruning-1.4.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|