boltz icon indicating copy to clipboard operation
boltz copied to clipboard

UnboundLocalError: cannot access local variable 'binder' where it is not associated with a value

Open timpalpant opened this issue 6 months ago • 1 comments

When trying to use contact constraints as described here

I get the following error:

  File "/usr/local/micromamba/envs/boltz/lib/python3.11/site-packages/boltz/main.py", line 499, in process_input
    target = parse_yaml(path, ccd, mol_dir, boltz2)                                     
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                     
  File "/usr/local/micromamba/envs/boltz/lib/python3.11/site-packages/boltz/data/parse/yaml.py", line 68, in parse_yaml
    return parse_boltz_schema(name, data, ccd, mol_dir, boltz2)                         
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                         
  File "/usr/local/micromamba/envs/boltz/lib/python3.11/site-packages/boltz/data/parse/schema.py", line 1539, in parse_boltz_schema
    pocket_constraints.append((binder, contacts, max_distance))                         
                               ^^^^^^                                                   
UnboundLocalError: cannot access local variable 'binder' where it is not associated with a value

which appears to be due to a coding error here: https://github.com/jwohlwend/boltz/blob/main/src/boltz/data/parse/schema.py#L1539

timpalpant avatar Jun 06 '25 19:06 timpalpant

Yep, sorry we're working on fixing this!

jwohlwend avatar Jun 08 '25 19:06 jwohlwend

Hi @timpalpant, this, along with the rest of the pocket and contact conditioning support, is now merged in the public repo (new release coming soon). On top of it, you can now force the constraint to be satisfied using inference-time potentials. Let us know if you find any other issues!

gcorso avatar Jul 13 '25 20:07 gcorso