risk-network 0.0.5b2__py3-none-any.whl → 0.0.5b3__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.
- risk/__init__.py +1 -1
- risk/network/plot.py +10 -2
- {risk_network-0.0.5b2.dist-info → risk_network-0.0.5b3.dist-info}/METADATA +1 -1
- {risk_network-0.0.5b2.dist-info → risk_network-0.0.5b3.dist-info}/RECORD +7 -7
- {risk_network-0.0.5b2.dist-info → risk_network-0.0.5b3.dist-info}/LICENSE +0 -0
- {risk_network-0.0.5b2.dist-info → risk_network-0.0.5b3.dist-info}/WHEEL +0 -0
- {risk_network-0.0.5b2.dist-info → risk_network-0.0.5b3.dist-info}/top_level.txt +0 -0
risk/__init__.py
CHANGED
risk/network/plot.py
CHANGED
@@ -413,6 +413,8 @@ class NetworkPlotter:
|
|
413
413
|
max_labels: Union[int, None] = None,
|
414
414
|
max_words: int = 10,
|
415
415
|
min_words: int = 1,
|
416
|
+
max_word_length: int = 20,
|
417
|
+
min_word_length: int = 1,
|
416
418
|
words_to_omit: Union[List[str], None] = None,
|
417
419
|
) -> None:
|
418
420
|
"""Annotate the network graph with labels for different domains, positioned around the network for clarity.
|
@@ -428,6 +430,8 @@ class NetworkPlotter:
|
|
428
430
|
max_labels (int, optional): Maximum number of labels to plot. Defaults to None (no limit).
|
429
431
|
max_words (int, optional): Maximum number of words in a label. Defaults to 10.
|
430
432
|
min_words (int, optional): Minimum number of words required to display a label. Defaults to 1.
|
433
|
+
max_word_length (int, optional): Maximum number of characters in a word to display. Defaults to 20.
|
434
|
+
min_word_length (int, optional): Minimum number of characters in a word to display. Defaults to 1.
|
431
435
|
words_to_omit (List[str], optional): List of words to omit from the labels. Defaults to None.
|
432
436
|
"""
|
433
437
|
# Log the plotting parameters
|
@@ -442,7 +446,9 @@ class NetworkPlotter:
|
|
442
446
|
label_max_labels=max_labels,
|
443
447
|
label_max_words=max_words,
|
444
448
|
label_min_words=min_words,
|
445
|
-
|
449
|
+
label_max_word_length=max_word_length,
|
450
|
+
label_min_word_length=min_word_length,
|
451
|
+
label_words_to_omit=words_to_omit,
|
446
452
|
)
|
447
453
|
|
448
454
|
# Convert color strings to RGBA arrays if necessary
|
@@ -471,13 +477,15 @@ class NetworkPlotter:
|
|
471
477
|
# Remove words_to_omit
|
472
478
|
if words_to_omit:
|
473
479
|
terms = [term for term in terms if term.lower() not in words_to_omit]
|
480
|
+
# Filter words based on length
|
481
|
+
terms = [term for term in terms if min_word_length <= len(term) <= max_word_length]
|
474
482
|
# Trim to max_words
|
475
483
|
terms = terms[:max_words]
|
476
484
|
# Check if the domain passes the word count condition
|
477
485
|
if len(terms) >= min_words:
|
478
486
|
# Add to filtered_domain_centroids
|
479
487
|
filtered_domain_centroids[domain] = centroid
|
480
|
-
# Store the trimmed terms
|
488
|
+
# Store the filtered and trimmed terms
|
481
489
|
filtered_domain_terms[domain] = " ".join(terms)
|
482
490
|
# Keep track of the valid index
|
483
491
|
valid_indices.append(idx)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
risk/__init__.py,sha256=
|
1
|
+
risk/__init__.py,sha256=hkNuyHvspGpQZXzClmw2D5DznJwi1PUZ7T57uemJkcY,112
|
2
2
|
risk/constants.py,sha256=AICk3x5qRQhls_ijTb4VdbdxU6mZ1aLGbAjLEdBwfJI,550
|
3
3
|
risk/risk.py,sha256=UYM_Pf2Db-lbf4O5T2v5zKutz_GLXK-f43PgYT6xRyY,21328
|
4
4
|
risk/annotations/__init__.py,sha256=vUpVvMRE5if01Ic8QY6M2Ae3EFGJHdugEe9PdEkAW4Y,138
|
@@ -15,7 +15,7 @@ risk/network/__init__.py,sha256=iEPeJdZfqp0toxtbElryB8jbz9_t_k4QQ3iDvKE8C_0,126
|
|
15
15
|
risk/network/geometry.py,sha256=H1yGVVqgbfpzBzJwEheDLfvGLSA284jGQQTn612L4Vc,6759
|
16
16
|
risk/network/graph.py,sha256=F_SY7nZev6XZuHwkJnVdeow-oMSmR4u8AUiFCrh6yvk,11543
|
17
17
|
risk/network/io.py,sha256=otiRG6uT6HLgbbJql7X2wjYxab8OFJSgRoWJlcDoyu4,20291
|
18
|
-
risk/network/plot.py,sha256=
|
18
|
+
risk/network/plot.py,sha256=ZABvLKr1ORCWWnHymRJz6g8z7v5kCKsMThUSLAKUCtU,40782
|
19
19
|
risk/stats/__init__.py,sha256=e-BE_Dr_jgiK6hKM-T-tlG4yvHnId8e5qjnM0pdwNVc,230
|
20
20
|
risk/stats/fisher_exact.py,sha256=-bPwzu76-ob0HzrTV20mXUTot7v-MLuqFaAoab-QxPg,4966
|
21
21
|
risk/stats/hypergeom.py,sha256=lrIFdhCWRjvM4apYw1MlOKqT_IY5OjtCwrjdtJdt6Tg,4954
|
@@ -23,8 +23,8 @@ risk/stats/stats.py,sha256=kvShov-94W6ffgDUTb522vB9hDJQSyTsYif_UIaFfSM,7059
|
|
23
23
|
risk/stats/permutation/__init__.py,sha256=neJp7FENC-zg_CGOXqv-iIvz1r5XUKI9Ruxhmq7kDOI,105
|
24
24
|
risk/stats/permutation/permutation.py,sha256=qLWdwxEY6nmkYPxpM8HLDcd2mbqYv9Qr7CKtJvhLqIM,9220
|
25
25
|
risk/stats/permutation/test_functions.py,sha256=HuDIM-V1jkkfE1rlaIqrWWBSKZt3dQ1f-YEDjWpnLSE,2343
|
26
|
-
risk_network-0.0.
|
27
|
-
risk_network-0.0.
|
28
|
-
risk_network-0.0.
|
29
|
-
risk_network-0.0.
|
30
|
-
risk_network-0.0.
|
26
|
+
risk_network-0.0.5b3.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
27
|
+
risk_network-0.0.5b3.dist-info/METADATA,sha256=189cCFcKnA56wLM1qZ4XcJfkPY6NfZYXyxUYeNwhbas,43236
|
28
|
+
risk_network-0.0.5b3.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
29
|
+
risk_network-0.0.5b3.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
|
30
|
+
risk_network-0.0.5b3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|