Skip to content

Commit 5477e72

Browse files
committed
fix(mtnetwork): add import check
try to import HyPhy before use in transmission_network.fit_degree_distribution closes veg#40
1 parent f585f98 commit 5477e72

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hivclustering/mtnetwork.py

+5
Original file line numberDiff line numberDiff line change
@@ -2496,6 +2496,11 @@ def test_edge_support(self, sequence_records, cycles, adjacency_set, hy_instance
24962496

24972497
def fit_degree_distribution(self, degree_option=None, hy_instance=None):
24982498
if hy_instance is None:
2499+
try:
2500+
import hppy as hy
2501+
except ImportError:
2502+
raise ImportError(
2503+
"Optional dependencies not found. Please install the 'edgefiltering' extras to use this function: pip install hivclustering[edgefiltering]")
24992504
hy_instance = hy.HyphyInterface()
25002505
script_path = os.path.realpath(__file__)
25012506
hbl_path = os.path.join(os.path.dirname(script_path), "data", "HBL", "DegreeDistributions.bf")

0 commit comments

Comments
 (0)