Skip to content

Commit ccd648a

Browse files
committed
Python 3.11 compatibility
1 parent f585f98 commit ccd648a

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

hivclustering/mtnetwork.py

+16
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def _test_edge_support(cycles, sequence_records, hy_instance, p_value_cutoff, te
132132
except ImportError:
133133
raise ImportError("Optional dependencies not found. Please install the 'edgefiltering' extras to use this function: pip install hivclustering[edgefiltering]")
134134
hy_instance = hy.HyphyInterface()
135+
135136
script_path = os.path.realpath(__file__)
136137

137138
cycle_spec = []
@@ -173,6 +174,10 @@ def _batch_sequence_sim(spec):
173174

174175
def _simulate_HIV_sequences(sequence, tree_matrix, hy_instance):
175176
if hy_instance is None:
177+
try:
178+
import hppy as hy
179+
except ImportError:
180+
raise ImportError("Optional dependencies not found. Please install the 'edgefiltering' extras to use this function: pip install hivclustering[edgefiltering]")
176181
hy_instance = hy.HyphyInterface()
177182

178183
script_path = os.path.realpath(__file__)
@@ -930,6 +935,11 @@ def simulate_sequence_evolution(self, founders, founder_sequences, rate_per_year
930935
if self.adjacency_list is None:
931936
self.compute_adjacency()
932937

938+
try:
939+
import hppy as hy
940+
except ImportError:
941+
raise ImportError("Optional dependencies not found. Please install the 'edgefiltering' extras to use this function: pip install hivclustering[edgefiltering]")
942+
933943
hy_instance = hy.HyphyInterface()
934944
already_simulated = set()
935945

@@ -2496,7 +2506,13 @@ def test_edge_support(self, sequence_records, cycles, adjacency_set, hy_instance
24962506

24972507
def fit_degree_distribution(self, degree_option=None, hy_instance=None):
24982508
if hy_instance is None:
2509+
try:
2510+
import hppy as hy
2511+
except ImportError:
2512+
raise ImportError("Optional dependencies not found. please install the 'edgefiltering' extras to use this function: pip install hivclustering[edgefiltering]")
2513+
24992514
hy_instance = hy.HyphyInterface()
2515+
25002516
script_path = os.path.realpath(__file__)
25012517
hbl_path = os.path.join(os.path.dirname(script_path), "data", "HBL", "DegreeDistributions.bf")
25022518
if degree_option == 'indegree':

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
sys.path.insert(0, join(split(abspath(__file__))[0], 'lib'))
99

1010
setup(name='hivclustering',
11-
version="1.6.7",
11+
version="1.6.8",
1212
description='HIV molecular clustering tools',
1313
author='Sergei Kosakovsky Pond',
1414
author_email='[email protected]',
@@ -19,7 +19,7 @@
1919
'data/HBL/*.bf',
2020
]},
2121
extras_require={
22-
'edgefiltering': ['bioext >= 0.19.0','hyphy-python >= 0.1.11','hppy >= 0.9.9'],
22+
'edgefiltering': ['bioext >= 0.21.0','hyphy-python >= 0.1.11','hppy >= 0.9.9'],
2323
},
2424
scripts=[
2525
'scripts/hivnetworkcsv',

0 commit comments

Comments
 (0)