modularitypruning 1.4.0__tar.gz → 1.5.0__tar.gz
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-1.4.0 → modularitypruning-1.5.0}/PKG-INFO +11 -7
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/README.md +2 -0
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/modularitypruning.egg-info/PKG-INFO +11 -7
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/modularitypruning.egg-info/SOURCES.txt +1 -1
- modularitypruning-1.5.0/pyproject.toml +47 -0
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_champ_coefficients_2D.py +6 -4
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_champ_coefficients_3D.py +5 -3
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_champ_usage_2D.py +6 -4
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_champ_usage_3D.py +6 -4
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_deprecated_louvain_names.py +2 -1
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_documentation_examples.py +6 -5
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_monolayer_parameter_estimation.py +8 -6
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_multiplex_parameter_estimation.py +8 -6
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_parallel_leiden_performance.py +13 -10
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_temporal_multilevel_parameter_estimation.py +8 -6
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/utilities/champ_utilities.py +8 -6
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/utilities/leiden_utilities.py +3 -4
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/utilities/louvain_utilities.py +6 -4
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/utilities/parameter_estimation.py +2 -1
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/utilities/parameter_estimation_utilities.py +7 -5
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/utilities/partition_utilities.py +1 -0
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/utilities/plotting.py +6 -4
- modularitypruning-1.4.0/setup.py +0 -38
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/LICENSE +0 -0
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/modularitypruning.egg-info/dependency_links.txt +0 -0
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/modularitypruning.egg-info/requires.txt +0 -0
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/modularitypruning.egg-info/top_level.txt +0 -0
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/setup.cfg +0 -0
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/utilities/__init__.py +0 -0
- {modularitypruning-1.4.0 → modularitypruning-1.5.0}/utilities/progress.py +0 -0
@@ -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
|
@@ -27,6 +28,7 @@ Requires-Dist: scikit-learn
|
|
27
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
|
@@ -17,6 +17,7 @@ https://static-content.springer.com/esm/art%3A10.1038%2Fs41598-022-20142-6/Media
|
|
17
17
|
).
|
18
18
|
|
19
19
|
## Installation
|
20
|
+
|
20
21
|
This project is on [PyPI](https://pypi.org/project/modularitypruning/) and can
|
21
22
|
be installed with
|
22
23
|
|
@@ -31,6 +32,7 @@ Alternatively, you can install it from this repository directly:
|
|
31
32
|
python3 setup.py install
|
32
33
|
|
33
34
|
<a name = "Basic Usage"></a>
|
35
|
+
|
34
36
|
## Basic Usage
|
35
37
|
|
36
38
|
This package interfaces directly with python-igraph. A simple example of its
|
@@ -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
|
@@ -27,6 +28,7 @@ Requires-Dist: scikit-learn
|
|
27
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,47 @@
|
|
1
|
+
[build-system]
|
2
|
+
requires = ["setuptools >= 75.3.2"]
|
3
|
+
build-backend = "setuptools.build_meta"
|
4
|
+
|
5
|
+
[project]
|
6
|
+
name = "modularitypruning"
|
7
|
+
version = "1.5.0"
|
8
|
+
description = """Pruning tool to identify small subsets of network partitions that are significant from the perspective
|
9
|
+
of stochastic block model inference."""
|
10
|
+
readme = "README.md"
|
11
|
+
requires-python = ">=3.8"
|
12
|
+
license = { text = "MIT" }
|
13
|
+
authors = [
|
14
|
+
{ name = "Ryan Gibson", email = "ryan.alex.gibson@gmail.com" }
|
15
|
+
]
|
16
|
+
|
17
|
+
classifiers = [
|
18
|
+
"Development Status :: 5 - Production/Stable",
|
19
|
+
"Topic :: Scientific/Engineering :: Information Analysis",
|
20
|
+
"Programming Language :: Python :: 3",
|
21
|
+
"Programming Language :: Python :: 3.8",
|
22
|
+
"Programming Language :: Python :: 3.9",
|
23
|
+
"Programming Language :: Python :: 3.10",
|
24
|
+
"Programming Language :: Python :: 3.11",
|
25
|
+
"Programming Language :: Python :: 3.12",
|
26
|
+
"Programming Language :: Python :: 3.13",
|
27
|
+
"Programming Language :: Python :: 3.14",
|
28
|
+
"Programming Language :: Python :: 3 :: Only",
|
29
|
+
"License :: OSI Approved :: MIT License"
|
30
|
+
]
|
31
|
+
dependencies = [
|
32
|
+
"leidenalg",
|
33
|
+
"matplotlib",
|
34
|
+
"numpy",
|
35
|
+
"psutil",
|
36
|
+
"igraph",
|
37
|
+
"scikit-learn",
|
38
|
+
"scipy>=1.7",
|
39
|
+
"seaborn",
|
40
|
+
"tqdm"
|
41
|
+
]
|
42
|
+
|
43
|
+
[tool.setuptools]
|
44
|
+
packages = ["modularitypruning"]
|
45
|
+
|
46
|
+
[tool.setuptools.package-dir]
|
47
|
+
modularitypruning = "utilities"
|
@@ -1,9 +1,11 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import unittest
|
2
|
+
from random import seed
|
3
|
+
|
3
4
|
from modularitypruning.champ_utilities import partition_coefficients_2D
|
4
5
|
from modularitypruning.leiden_utilities import leiden_part_with_membership, repeated_leiden_from_gammas
|
5
|
-
|
6
|
-
import
|
6
|
+
|
7
|
+
from .shared_testing_functions import generate_connected_ER, generate_random_values, generate_random_partitions, \
|
8
|
+
generate_igraph_famous
|
7
9
|
|
8
10
|
|
9
11
|
class TestCHAMPCoefficients2D(unittest.TestCase):
|
@@ -1,8 +1,10 @@
|
|
1
|
-
|
1
|
+
import unittest
|
2
|
+
from random import seed
|
3
|
+
|
2
4
|
from modularitypruning.champ_utilities import partition_coefficients_3D
|
3
5
|
from modularitypruning.leiden_utilities import multilayer_leiden_part_with_membership, leiden_part_with_membership
|
4
|
-
|
5
|
-
import
|
6
|
+
|
7
|
+
from .shared_testing_functions import generate_connected_multilayer_ER, generate_random_partitions
|
6
8
|
|
7
9
|
|
8
10
|
class TestCHAMPCoefficients3D(unittest.TestCase):
|
@@ -1,9 +1,11 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import unittest
|
2
|
+
from random import seed
|
3
|
+
|
3
4
|
from modularitypruning.champ_utilities import CHAMP_2D
|
4
5
|
from modularitypruning.leiden_utilities import leiden_part_with_membership, repeated_leiden_from_gammas
|
5
|
-
|
6
|
-
import
|
6
|
+
|
7
|
+
from .shared_testing_functions import generate_connected_ER, generate_random_values, generate_random_partitions, \
|
8
|
+
generate_igraph_famous
|
7
9
|
|
8
10
|
|
9
11
|
class TestCHAMP2D(unittest.TestCase):
|
@@ -1,10 +1,12 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import unittest
|
2
|
+
from random import seed
|
3
|
+
|
3
4
|
from modularitypruning.champ_utilities import CHAMP_3D
|
4
5
|
from modularitypruning.leiden_utilities import multilayer_leiden_part_with_membership
|
5
6
|
from numpy import mean
|
6
|
-
|
7
|
-
import
|
7
|
+
|
8
|
+
from .shared_testing_functions import generate_connected_multilayer_ER, generate_random_values, \
|
9
|
+
generate_random_partitions
|
8
10
|
|
9
11
|
|
10
12
|
def point_is_inside_champ_domain(gamma, omega, domain_vertices):
|
@@ -3,6 +3,12 @@ This set of tests checks that the examples from the documentation still work cor
|
|
3
3
|
|
4
4
|
Sometimes this is simply checking that the code produces the intended output or runs without errors.
|
5
5
|
"""
|
6
|
+
import unittest
|
7
|
+
from random import seed, random
|
8
|
+
|
9
|
+
import igraph as ig
|
10
|
+
import matplotlib.pyplot as plt
|
11
|
+
import numpy as np
|
6
12
|
from modularitypruning import prune_to_stable_partitions, prune_to_multilayer_stable_partitions
|
7
13
|
from modularitypruning.champ_utilities import CHAMP_2D, CHAMP_3D
|
8
14
|
from modularitypruning.leiden_utilities import (repeated_parallel_leiden_from_gammas,
|
@@ -11,11 +17,6 @@ from modularitypruning.parameter_estimation_utilities import domains_to_gamma_om
|
|
11
17
|
from modularitypruning.partition_utilities import num_communities
|
12
18
|
from modularitypruning.plotting import (plot_2d_domains_with_estimates, plot_2d_domains, plot_2d_domains_with_ami,
|
13
19
|
plot_2d_domains_with_num_communities, plot_estimates, plot_multiplex_community)
|
14
|
-
from random import seed, random
|
15
|
-
import igraph as ig
|
16
|
-
import matplotlib.pyplot as plt
|
17
|
-
import numpy as np
|
18
|
-
import unittest
|
19
20
|
|
20
21
|
|
21
22
|
class TestDocumentationExamples(unittest.TestCase):
|
{modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_monolayer_parameter_estimation.py
RENAMED
@@ -1,13 +1,15 @@
|
|
1
|
-
|
2
|
-
generate_random_partition
|
3
|
-
import igraph as ig
|
1
|
+
import unittest
|
4
2
|
from math import log
|
5
|
-
from
|
3
|
+
from random import seed
|
4
|
+
|
5
|
+
import igraph as ig
|
6
6
|
from modularitypruning.parameter_estimation import iterative_monolayer_resolution_parameter_estimation
|
7
7
|
from modularitypruning.parameter_estimation_utilities import gamma_estimate
|
8
8
|
from modularitypruning.partition_utilities import all_degrees
|
9
|
-
from
|
10
|
-
|
9
|
+
from numpy import mean
|
10
|
+
|
11
|
+
from .shared_testing_functions import assert_almost_equal_or_both_none_or_nan, generate_igraph_famous, \
|
12
|
+
generate_random_partition
|
11
13
|
|
12
14
|
|
13
15
|
class TestMonolayerParameterEstimation(unittest.TestCase):
|
{modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_multiplex_parameter_estimation.py
RENAMED
@@ -1,14 +1,16 @@
|
|
1
|
-
|
2
|
-
generate_multilayer_intralayer_SBM
|
3
|
-
import igraph as ig
|
1
|
+
import unittest
|
4
2
|
from math import log
|
5
|
-
from
|
3
|
+
from random import seed
|
4
|
+
|
5
|
+
import igraph as ig
|
6
6
|
from modularitypruning.leiden_utilities import repeated_leiden_from_gammas_omegas
|
7
7
|
from modularitypruning.parameter_estimation import iterative_multilayer_resolution_parameter_estimation
|
8
8
|
from modularitypruning.parameter_estimation_utilities import gamma_omega_estimate
|
9
9
|
from modularitypruning.partition_utilities import num_communities, all_degrees
|
10
|
-
from
|
11
|
-
|
10
|
+
from numpy import mean
|
11
|
+
|
12
|
+
from .shared_testing_functions import assert_almost_equal_or_both_none_or_nan, generate_random_partition, \
|
13
|
+
generate_multilayer_intralayer_SBM
|
12
14
|
|
13
15
|
|
14
16
|
class TestMultiplexParameterEstimation(unittest.TestCase):
|
{modularitypruning-1.4.0 → modularitypruning-1.5.0}/tests/test_parallel_leiden_performance.py
RENAMED
@@ -1,16 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
repeated_parallel_leiden_from_gammas_omegas)
|
1
|
+
import functools
|
2
|
+
import unittest
|
3
|
+
import warnings
|
5
4
|
from multiprocessing import Pool, cpu_count
|
6
5
|
from random import seed
|
7
|
-
from time import time
|
8
|
-
|
6
|
+
from time import time
|
7
|
+
|
9
8
|
import igraph as ig
|
10
9
|
import numpy as np
|
11
10
|
import psutil
|
12
|
-
import
|
13
|
-
import
|
11
|
+
import pytest
|
12
|
+
from modularitypruning.leiden_utilities import (repeated_leiden_from_gammas, repeated_parallel_leiden_from_gammas,
|
13
|
+
repeated_leiden_from_gammas_omegas,
|
14
|
+
repeated_parallel_leiden_from_gammas_omegas)
|
15
|
+
|
16
|
+
from .shared_testing_functions import generate_connected_ER, generate_multilayer_intralayer_SBM
|
14
17
|
|
15
18
|
# this set of tests ensures that we achieve >= 75% parallel performance compared to perfect scaling of
|
16
19
|
# single-threaded jobs to multiple cores (with no memory contention). This threshold will be decreased in
|
@@ -38,8 +41,7 @@ def determine_target_parallelization_speedup(num_calculations=32):
|
|
38
41
|
"""
|
39
42
|
global PERFORMANCE_TARGET_RELATIVE_TO_PERFECT_SCALING
|
40
43
|
|
41
|
-
|
42
|
-
cpu_utilization = psutil.cpu_percent()
|
44
|
+
cpu_utilization = psutil.cpu_percent(interval=5)
|
43
45
|
if cpu_utilization > 20:
|
44
46
|
PERFORMANCE_TARGET_RELATIVE_TO_PERFECT_SCALING = 0.5
|
45
47
|
warnings.warn(f"System CPU utilization is non-negligible during parallel performance test! "
|
@@ -60,6 +62,7 @@ def determine_target_parallelization_speedup(num_calculations=32):
|
|
60
62
|
return num_pool_calculations / num_calculations * base_duration / pool_duration
|
61
63
|
|
62
64
|
|
65
|
+
@pytest.mark.serial # these tests have to run serially for the parallel performance comparisons to make sense
|
63
66
|
class TestParallelLeidenPerformance(unittest.TestCase):
|
64
67
|
@staticmethod
|
65
68
|
def run_singlelayer_graph_parallelization(G, gammas):
|
@@ -1,14 +1,16 @@
|
|
1
|
-
|
2
|
-
generate_multilayer_intralayer_SBM
|
3
|
-
import igraph as ig
|
1
|
+
import unittest
|
4
2
|
from math import log
|
5
|
-
from
|
3
|
+
from random import seed
|
4
|
+
|
5
|
+
import igraph as ig
|
6
6
|
from modularitypruning.leiden_utilities import repeated_leiden_from_gammas_omegas
|
7
7
|
from modularitypruning.parameter_estimation import iterative_multilayer_resolution_parameter_estimation
|
8
8
|
from modularitypruning.parameter_estimation_utilities import gamma_omega_estimate
|
9
9
|
from modularitypruning.partition_utilities import num_communities, all_degrees
|
10
|
-
from
|
11
|
-
|
10
|
+
from numpy import mean
|
11
|
+
|
12
|
+
from .shared_testing_functions import assert_almost_equal_or_both_none_or_nan, generate_random_partition, \
|
13
|
+
generate_multilayer_intralayer_SBM
|
12
14
|
|
13
15
|
|
14
16
|
class TestTemporalAndMultilevelParameterEstimation(unittest.TestCase):
|
@@ -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,
|
{modularitypruning-1.4.0 → modularitypruning-1.5.0}/utilities/parameter_estimation_utilities.py
RENAMED
@@ -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):
|
@@ -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):
|
modularitypruning-1.4.0/setup.py
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
from setuptools import setup
|
2
|
-
import os
|
3
|
-
|
4
|
-
here = os.path.abspath(os.path.dirname(__file__))
|
5
|
-
|
6
|
-
# Get the long description from the README file
|
7
|
-
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
|
8
|
-
long_description = f.read()
|
9
|
-
|
10
|
-
setup(
|
11
|
-
name='modularitypruning',
|
12
|
-
version='1.4.0',
|
13
|
-
package_dir={'modularitypruning': 'utilities'},
|
14
|
-
packages=['modularitypruning'],
|
15
|
-
url='https://github.com/ragibson/ModularityPruning',
|
16
|
-
license='',
|
17
|
-
author='Ryan Gibson',
|
18
|
-
author_email='ryan.alex.gibson@gmail.com',
|
19
|
-
description='Pruning tool to identify small subsets of network partitions that are '
|
20
|
-
'significant from the perspective of stochastic block model inference.',
|
21
|
-
long_description=long_description,
|
22
|
-
long_description_content_type='text/markdown',
|
23
|
-
classifiers=[
|
24
|
-
'Development Status :: 5 - Production/Stable',
|
25
|
-
'Topic :: Scientific/Engineering :: Information Analysis',
|
26
|
-
'Programming Language :: Python :: 3',
|
27
|
-
'Programming Language :: Python :: 3.8',
|
28
|
-
'Programming Language :: Python :: 3.9',
|
29
|
-
'Programming Language :: Python :: 3.10',
|
30
|
-
'Programming Language :: Python :: 3.11',
|
31
|
-
'Programming Language :: Python :: 3.12',
|
32
|
-
'Programming Language :: Python :: 3 :: Only',
|
33
|
-
'License :: OSI Approved :: MIT License'
|
34
|
-
],
|
35
|
-
python_requires='>=3.8, <4',
|
36
|
-
install_requires=['leidenalg', 'matplotlib', "numpy", 'psutil', 'igraph',
|
37
|
-
"scikit-learn", "scipy>=1.7", 'seaborn', 'tqdm']
|
38
|
-
)
|
File without changes
|
{modularitypruning-1.4.0 → modularitypruning-1.5.0}/modularitypruning.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
{modularitypruning-1.4.0 → modularitypruning-1.5.0}/modularitypruning.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|