From be68ec6d8c09d1d234502f963fbb9bc24fcd35a4 Mon Sep 17 00:00:00 2001 From: karolamik13 Date: Wed, 18 Dec 2024 10:34:24 +0100 Subject: [PATCH] Additional PY3K in calcChannels --- prody/proteins/channels.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/prody/proteins/channels.py b/prody/proteins/channels.py index 0d73b1849..3fffc9d82 100644 --- a/prody/proteins/channels.py +++ b/prody/proteins/channels.py @@ -470,16 +470,23 @@ def calcChannels(atoms, output_path=None, separate=False, r1=3, r2=1.25, min_dep voro = Voronoi(coords) s_prt = State(dela.simplices, dela.neighbors, voro.vertices) - s_tmp = State(*s_prt.get_state()) - s_prv = State(None, None, None) + + if PY3K: + s_tmp = State(*s_prt.get_state()) + s_prv = State(None, None, None) + else: + s_tmp = apply(State, s_prt.get_state()) + s_prv = State(None, None, None) while True: s_prv.set_state(*s_tmp.get_state()) - #s_tmp.set_state(*calculator.delete_simplices3d(coords, *s_tmp.get_state(), vdw_radii, r1, True)) - state = s_tmp.get_state() - result = calculator.delete_simplices3d(coords, *state, vdw_radii, r1, True) - s_tmp.set_state(*result) + if PY3K: + s_tmp.set_state(*calculator.delete_simplices3d(coords, *s_tmp.get_state(), vdw_radii, r1, True)) + else: + tmp_state = calculator.delete_simplices3d(coords, *s_tmp.get_state(), vdw_radii, r1, True) + s_tmp.set_state(*tmp_state) + if s_tmp == s_prv: break