risk-network 0.0.9b16__tar.gz → 0.0.9b18__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.
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/PKG-INFO +1 -1
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/__init__.py +1 -1
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/plot/contour.py +7 -21
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/plot/labels.py +30 -36
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/stats/permutation/permutation.py +3 -1
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk_network.egg-info/PKG-INFO +1 -1
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/LICENSE +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/MANIFEST.in +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/README.md +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/pyproject.toml +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/annotations/__init__.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/annotations/annotations.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/annotations/io.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/constants.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/log/__init__.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/log/console.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/log/parameters.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/neighborhoods/__init__.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/neighborhoods/community.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/neighborhoods/domains.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/neighborhoods/neighborhoods.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/__init__.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/geometry.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/graph/__init__.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/graph/network.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/graph/summary.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/io.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/plot/__init__.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/plot/canvas.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/plot/network.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/plot/plotter.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/plot/utils/colors.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/network/plot/utils/layout.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/risk.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/stats/__init__.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/stats/hypergeom.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/stats/permutation/__init__.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/stats/permutation/test_functions.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/stats/poisson.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk/stats/stats.py +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk_network.egg-info/SOURCES.txt +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk_network.egg-info/dependency_links.txt +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk_network.egg-info/requires.txt +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/risk_network.egg-info/top_level.txt +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/setup.cfg +0 -0
- {risk_network-0.0.9b16 → risk_network-0.0.9b18}/setup.py +0 -0
@@ -242,7 +242,7 @@ class Contour:
|
|
242
242
|
logger.error("Contour levels must be strictly increasing. Skipping contour plot.")
|
243
243
|
return None
|
244
244
|
|
245
|
-
# Set the contour color and linestyle
|
245
|
+
# Set the contour color, fill, and linestyle
|
246
246
|
contour_colors = [color for _ in range(levels - 1)]
|
247
247
|
# Plot the filled contours using fill_alpha for transparency
|
248
248
|
if fill_alpha and fill_alpha > 0:
|
@@ -258,33 +258,19 @@ class Contour:
|
|
258
258
|
alpha=fill_alpha,
|
259
259
|
)
|
260
260
|
|
261
|
-
# Plot the contour
|
262
|
-
|
261
|
+
# Plot the base contour line with the specified RGBA alpha for transparency
|
262
|
+
base_contour_color = [color]
|
263
|
+
base_contour_level = [contour_levels[0]]
|
264
|
+
ax.contour(
|
263
265
|
x,
|
264
266
|
y,
|
265
267
|
z,
|
266
|
-
levels=
|
267
|
-
colors=
|
268
|
+
levels=base_contour_level,
|
269
|
+
colors=base_contour_color,
|
268
270
|
linestyles=linestyle,
|
269
271
|
linewidths=linewidth,
|
270
272
|
)
|
271
273
|
|
272
|
-
# Set linewidth for the contour lines to 0 for levels other than the base level
|
273
|
-
c.set_linewidth(0)
|
274
|
-
try:
|
275
|
-
# Try setting linewidth directly on the QuadContourSet
|
276
|
-
c.set_linewidth(0)
|
277
|
-
except AttributeError:
|
278
|
-
# Fallback: Iterate over collections if the direct method fails
|
279
|
-
if hasattr(c, "collections"):
|
280
|
-
for i, collection in enumerate(c.collections):
|
281
|
-
collection.set_linewidth(0)
|
282
|
-
else:
|
283
|
-
# Raise an error if 'collections' is also not available
|
284
|
-
raise AttributeError(
|
285
|
-
"'QuadContourSet' object has neither 'set_linewidth' nor 'collections'"
|
286
|
-
)
|
287
|
-
|
288
274
|
def get_annotated_contour_colors(
|
289
275
|
self,
|
290
276
|
cmap: str = "gist_rainbow",
|
@@ -564,39 +564,39 @@ class Labels:
|
|
564
564
|
|
565
565
|
Returns:
|
566
566
|
bool: True if the domain is valid and added to the filtered dictionaries, False otherwise.
|
567
|
-
|
568
|
-
Note:
|
569
|
-
The `filtered_domain_centroids`, `filtered_domain_terms`, and `valid_indices` are modified in-place.
|
570
567
|
"""
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
568
|
+
if ids_to_labels and domain in ids_to_labels:
|
569
|
+
# Directly use custom labels without filtering
|
570
|
+
domain_terms = ids_to_labels[domain]
|
571
|
+
else:
|
572
|
+
# Process the domain terms automatically
|
573
|
+
domain_terms = self._process_terms(
|
574
|
+
domain=domain,
|
575
|
+
words_to_omit=words_to_omit,
|
576
|
+
max_label_lines=max_label_lines,
|
577
|
+
min_chars_per_line=min_chars_per_line,
|
578
|
+
max_chars_per_line=max_chars_per_line,
|
579
|
+
)
|
580
|
+
# If no valid terms are generated, skip further processing
|
581
|
+
if not domain_terms:
|
582
|
+
return False
|
583
|
+
|
584
|
+
# Split the terms by TERM_DELIMITER and count the number of lines
|
585
|
+
num_domain_lines = len(domain_terms.split(TERM_DELIMITER))
|
586
|
+
# Check if the number of lines meets the minimum requirement
|
587
|
+
if num_domain_lines < min_label_lines:
|
588
|
+
return False
|
589
|
+
|
590
|
+
# Store the valid terms and centroids
|
591
|
+
filtered_domain_centroids[domain] = domain_centroid
|
592
|
+
filtered_domain_terms[domain] = domain_terms
|
593
|
+
valid_indices.append(list(domain_id_to_centroid_map.keys()).index(domain))
|
594
|
+
|
595
|
+
return True
|
595
596
|
|
596
597
|
def _process_terms(
|
597
598
|
self,
|
598
599
|
domain: str,
|
599
|
-
ids_to_labels: Union[Dict[int, str], None],
|
600
600
|
words_to_omit: Union[List[str], None],
|
601
601
|
max_label_lines: int,
|
602
602
|
min_chars_per_line: int,
|
@@ -606,7 +606,6 @@ class Labels:
|
|
606
606
|
|
607
607
|
Args:
|
608
608
|
domain (str): The domain being processed.
|
609
|
-
ids_to_labels (Dict[int, str], None): Dictionary mapping domain IDs to custom labels.
|
610
609
|
words_to_omit (List[str], None): List of words to omit from the labels.
|
611
610
|
max_label_lines (int): Maximum number of lines in a label.
|
612
611
|
min_chars_per_line (int): Minimum number of characters in a line to display.
|
@@ -615,13 +614,8 @@ class Labels:
|
|
615
614
|
Returns:
|
616
615
|
str: Processed terms separated by TERM_DELIMITER, with words combined if necessary to fit within constraints.
|
617
616
|
"""
|
618
|
-
#
|
619
|
-
|
620
|
-
return ids_to_labels[domain]
|
621
|
-
|
622
|
-
else:
|
623
|
-
terms = self.graph.domain_id_to_domain_terms_map[domain].split(" ")
|
624
|
-
|
617
|
+
# Set custom labels from significant terms
|
618
|
+
terms = self.graph.domain_id_to_domain_terms_map[domain].split(" ")
|
625
619
|
# Apply words_to_omit and word length constraints
|
626
620
|
if words_to_omit:
|
627
621
|
terms = [
|
@@ -192,7 +192,9 @@ def _permutation_process_subset(
|
|
192
192
|
local_counts_depletion = np.zeros(observed_neighborhood_scores.shape)
|
193
193
|
local_counts_enrichment = np.zeros(observed_neighborhood_scores.shape)
|
194
194
|
|
195
|
-
#
|
195
|
+
# Limit the number of threads used by NumPy's BLAS implementation to 1 when more than one worker is used
|
196
|
+
# NOTE: This does not work for Mac M chips due to a bug in the threadpoolctl package
|
197
|
+
# This is currently a known issue and is being addressed by the maintainers [https://github.com/joblib/threadpoolctl/issues/135]
|
196
198
|
limits = None if max_workers == 1 else 1
|
197
199
|
with threadpool_limits(limits=limits, user_api="blas"):
|
198
200
|
# Initialize a local counter for batched progress updates
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|