File tree 2 files changed +7
-3
lines changed
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>`__.
24
24
* Preserve molecule name when reading from SDF format and on conversion to RDKit.
25
25
* Handle missing velocity data for ``AMBER `` RST7 files with only a few atoms.
26
26
* Preserve SDF metadata when converting to ``RDKIt `` format.
27
+ * Fixed unbound local variable when simulation lambda value is not in ``lambda_windows `` array.
27
28
28
29
`2024.4.0 <https://github.com/openbiosim/sire/compare/2024.3.1...2024.4.0 >`__ - Feb 2025
29
30
----------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -437,15 +437,18 @@ def _exit_dynamics_block(
437
437
# lambda windows list
438
438
try :
439
439
lambda_index = lambda_windows .index (sim_lambda_value )
440
+ has_lambda_index = True
440
441
except :
441
- num_energy_neighbours = num_lambda_windows
442
- lambda_index = i
442
+ has_lambda_index = False
443
443
444
444
for i , (lambda_value , rest2_scale ) in enumerate (
445
445
zip (lambda_windows , rest2_scale_factors )
446
446
):
447
447
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
+ ):
449
452
self ._omm_mols .set_lambda (
450
453
lambda_value ,
451
454
rest2_scale = rest2_scale ,
You can’t perform that action at this time.
0 commit comments