Skip to content

fix: improve error handling when no designed residues found#174

Open
buerbaumer wants to merge 1 commit into
HannesStark:mainfrom
buerbaumer:fix/empty-design-mask-error-handling
Open

fix: improve error handling when no designed residues found#174
buerbaumer wants to merge 1 commit into
HannesStark:mainfrom
buerbaumer:fix/empty-design-mask-error-handling

Conversation

@buerbaumer
Copy link
Copy Markdown
Contributor

Summary

Add validation in analyze.py to gracefully handle empty design masks.

Problem

When users run BoltzGen with a YAML configuration that has zero designed residues, the analysis step crashes with:

  • IndexError: index 0 is out of bounds for dimension 0 with size 0

This provides no guidance on what went wrong or how to fix it.

Solution

Add early validation in compute_metrics() that detects empty design masks and returns a helpful error message:

Skipping {file}: No designed residues found. The design_mask has 0 marked residues...
Please check your design specification YAML file:

Ensure you have a 'design:' block specifying residues to redesign
Verify chain IDs and residue indices are correct
Run 'boltzgen check your_file.yaml' to validate your configuration

Test plan

  • Verified patched code imports correctly
  • Verified normal 6-step pipeline completes with valid YAML (1brs.yaml)
  • Verified helpful error message appears with 0 designed residues
  • Tested on EC2 with NVIDIA A10G GPU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant