RFdiffusion
RFdiffusion copied to clipboard
Fix: Conditionally pass idx_pdb to writepdb to avoid AttributeError with SelfConditioning/ScaffoldedSampler
This PR resolves an AttributeError that occurs when running the example script design_macrocyclic_binder.sh using the SelfConditioning or ScaffoldedSampler samplers. After PR #348, the code attempted to pass sampler.idx_pdb to the writepdb function, but certain sampler classes (such as SelfConditioning and ScaffoldedSampler) do not always define the idx_pdb attribute. This resulted in a runtime error.
With this change, idx_pdb is only passed to writepdb if the sampler object actually has the attribute.
Hi @woodsh17 thanks for preparing the fix, can this PR be merged?