File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.
2424* Preserve molecule name when reading from SDF format and on conversion to RDKit.
2525* Handle missing velocity data for ``AMBER `` RST7 files with only a few atoms.
2626* Preserve SDF metadata when converting to ``RDKIt `` format.
27+ * Fixed unbound local variable when simulation lambda value is not in ``lambda_windows `` array.
2728
2829`2024.4.0 <https://github.com/openbiosim/sire/compare/2024.3.1...2024.4.0 >`__ - Feb 2025
2930----------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -437,15 +437,18 @@ def _exit_dynamics_block(
437437 # lambda windows list
438438 try :
439439 lambda_index = lambda_windows .index (sim_lambda_value )
440+ has_lambda_index = True
440441 except :
441- num_energy_neighbours = num_lambda_windows
442- lambda_index = i
442+ has_lambda_index = False
443443
444444 for i , (lambda_value , rest2_scale ) in enumerate (
445445 zip (lambda_windows , rest2_scale_factors )
446446 ):
447447 if lambda_value != sim_lambda_value :
448- if abs (lambda_index - i ) <= num_energy_neighbours :
448+ if (
449+ not has_lambda_index
450+ or abs (lambda_index - i ) <= num_energy_neighbours
451+ ):
449452 self ._omm_mols .set_lambda (
450453 lambda_value ,
451454 rest2_scale = rest2_scale ,
You can’t perform that action at this time.
0 commit comments