From bf82a682dc5fdac07372eb9706c80c6094b1bc84 Mon Sep 17 00:00:00 2001 From: finlayclark Date: Mon, 13 Nov 2023 15:26:08 +0000 Subject: [PATCH] Avoid inserting pair into boresch_dof_data until after try except block This avoids adding pairs which then fail, resulting in empty dict entries. --- .../Sandpit/Exscientia/FreeEnergy/_restraint_search.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/BioSimSpace/Sandpit/Exscientia/FreeEnergy/_restraint_search.py b/python/BioSimSpace/Sandpit/Exscientia/FreeEnergy/_restraint_search.py index 1eb666d1a..b4da8e8d3 100644 --- a/python/BioSimSpace/Sandpit/Exscientia/FreeEnergy/_restraint_search.py +++ b/python/BioSimSpace/Sandpit/Exscientia/FreeEnergy/_restraint_search.py @@ -1374,7 +1374,6 @@ def _findOrderedBoresch( pair_list[:no_pairs], desc="Scoring candidate Boresch anchor points. Anchor set no: ", ): - boresch_dof_data[pair] = {} l1_idx, r1_idx = pair try: _, l2_idx, l3_idx = _getAnchorAts(l1_idx, ligand_selection_str, u) @@ -1383,6 +1382,8 @@ def _findOrderedBoresch( _AnalysisError ): # Failed to find full set of anchor points for this pair continue + + boresch_dof_data[pair] = {} boresch_dof_data[pair]["anchor_ats"] = [ l1_idx, l2_idx,