risk-network 0.0.8b6__py3-none-any.whl → 0.0.8b7__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 → plot/base.py} +3 -1
- risk/risk.py +5 -1
- {risk_network-0.0.8b6.dist-info → risk_network-0.0.8b7.dist-info}/METADATA +1 -1
- {risk_network-0.0.8b6.dist-info → risk_network-0.0.8b7.dist-info}/RECORD +8 -8
- {risk_network-0.0.8b6.dist-info → risk_network-0.0.8b7.dist-info}/LICENSE +0 -0
- {risk_network-0.0.8b6.dist-info → risk_network-0.0.8b7.dist-info}/WHEEL +0 -0
- {risk_network-0.0.8b6.dist-info → risk_network-0.0.8b7.dist-info}/top_level.txt +0 -0
risk/__init__.py
CHANGED
@@ -213,6 +213,8 @@ class NetworkPlotter:
|
|
213
213
|
|
214
214
|
# Convert color to RGBA using the _to_rgba helper function - use outline_alpha for the perimeter
|
215
215
|
color = _to_rgba(color=color, alpha=outline_alpha)
|
216
|
+
# Set the fill_alpha to 0 if not provided
|
217
|
+
fill_alpha = fill_alpha if fill_alpha is not None else 0.0
|
216
218
|
# Extract node coordinates from the network graph
|
217
219
|
node_coordinates = self.graph.node_coordinates
|
218
220
|
# Calculate the center and radius of the bounding box around the network
|
@@ -676,7 +678,7 @@ class NetworkPlotter:
|
|
676
678
|
# Set the contour color and linestyle
|
677
679
|
contour_colors = [color for _ in range(levels - 1)]
|
678
680
|
# Plot the filled contours using fill_alpha for transparency
|
679
|
-
if fill_alpha > 0:
|
681
|
+
if fill_alpha and fill_alpha > 0:
|
680
682
|
ax.contourf(
|
681
683
|
x,
|
682
684
|
y,
|
risk/risk.py
CHANGED
@@ -3,7 +3,7 @@ risk/risk
|
|
3
3
|
~~~~~~~~~
|
4
4
|
"""
|
5
5
|
|
6
|
-
from typing import Any, Dict, Tuple
|
6
|
+
from typing import Any, Dict, Tuple, Union
|
7
7
|
|
8
8
|
import networkx as nx
|
9
9
|
import numpy as np
|
@@ -355,6 +355,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
355
355
|
graph: NetworkGraph,
|
356
356
|
figsize: Tuple = (10, 10),
|
357
357
|
background_color: str = "white",
|
358
|
+
background_alpha: Union[float, None] = 1.0,
|
358
359
|
) -> NetworkPlotter:
|
359
360
|
"""Get a NetworkPlotter object for plotting.
|
360
361
|
|
@@ -362,6 +363,8 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
362
363
|
graph (NetworkGraph): The graph to plot.
|
363
364
|
figsize (tuple, optional): Size of the figure. Defaults to (10, 10).
|
364
365
|
background_color (str, optional): Background color of the plot. Defaults to "white".
|
366
|
+
background_alpha (float, None, optional): Transparency level of the background color. If provided, it overrides
|
367
|
+
any existing alpha values found in background_color. Defaults to 1.0.
|
365
368
|
|
366
369
|
Returns:
|
367
370
|
NetworkPlotter: A NetworkPlotter object configured with the given parameters.
|
@@ -378,6 +381,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
378
381
|
graph,
|
379
382
|
figsize=figsize,
|
380
383
|
background_color=background_color,
|
384
|
+
background_alpha=background_alpha,
|
381
385
|
)
|
382
386
|
|
383
387
|
def _load_neighborhoods(
|
@@ -1,6 +1,6 @@
|
|
1
|
-
risk/__init__.py,sha256=
|
1
|
+
risk/__init__.py,sha256=Ld6-5HUuOVDCaSGqPvt7caqDuDx8YQ6yDSV1MrTjnCQ,112
|
2
2
|
risk/constants.py,sha256=XInRaH78Slnw_sWgAsBFbUHkyA0h0jL0DKGuQNbOvjM,550
|
3
|
-
risk/risk.py,sha256=
|
3
|
+
risk/risk.py,sha256=uZH7GuADCAAkDIx-rPlS6O_is6tUU2Hg28P8xpR-d9g,21240
|
4
4
|
risk/annotations/__init__.py,sha256=vUpVvMRE5if01Ic8QY6M2Ae3EFGJHdugEe9PdEkAW4Y,138
|
5
5
|
risk/annotations/annotations.py,sha256=ySc_N3nXnKx5RnOpFaEkM6zvTbswbrRcfFLzM0KdOck,11391
|
6
6
|
risk/annotations/io.py,sha256=TTXVJQgUGAlKpnGBcx7Dow146IGyozA03nSbl3S7M5M,9475
|
@@ -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=EwD4-1THC5YNdP6PY01Oe35k2QYYqtZpxWraPVH6wa4,16426
|
17
17
|
risk/network/io.py,sha256=kY7HqmL3wa1NnqHu61_G8IpT21qpBijpAZ4ixmsseJA,22911
|
18
|
-
risk/network/plot.py,sha256=
|
18
|
+
risk/network/plot/base.py,sha256=8Wbrm2Es8cGYGGGOoJqzeUfuDlNlgJ4_6IEIIfMShN8,85611
|
19
19
|
risk/stats/__init__.py,sha256=WcgoETQ-hS0LQqKRsAMIPtP15xZ-4eul6VUBuUx4Wzc,220
|
20
20
|
risk/stats/hypergeom.py,sha256=o6Qnj31gCAKxr2uQirXrbv7XvdDJGEq69MFW-ubx_hA,2272
|
21
21
|
risk/stats/poisson.py,sha256=8x9hB4DCukq4gNIlIKO-c_jYG1-BTwTX53oLauFyfj8,1793
|
@@ -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=D84Rcpt6iTQniK0PfQGcw9bLcHbMt9p-ARcurUnIXZQ,10095
|
25
25
|
risk/stats/permutation/test_functions.py,sha256=lftOude6hee0pyR80HlBD32522JkDoN5hrKQ9VEbuoY,2345
|
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.8b7.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
27
|
+
risk_network-0.0.8b7.dist-info/METADATA,sha256=wOm-_aHavf5zpMp_UjqIBx2NPl4nR_2YtS1cfFn6UBA,47450
|
28
|
+
risk_network-0.0.8b7.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
29
|
+
risk_network-0.0.8b7.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
|
30
|
+
risk_network-0.0.8b7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|