Skip to content

Safely close reporter and clear GPU contexts to avoid UnboundLocalErrors#1846

Open
IAlibay wants to merge 4 commits intomainfrom
del-safety
Open

Safely close reporter and clear GPU contexts to avoid UnboundLocalErrors#1846
IAlibay wants to merge 4 commits intomainfrom
del-safety

Conversation

@IAlibay
Copy link
Member

@IAlibay IAlibay commented Feb 14, 2026

Fixes #1845

Added try/except block to safely close things in case there's an unbound variable.

Checklist

  • All new code is appropriately documented (user-facing code must have complete docstrings).
  • Added a news entry, or the changes are not user-facing.
  • Ran pre-commit: you can run pre-commit locally or comment on this PR with pre-commit.ci autofix.

Manual Tests: these are slow so don't need to be run every commit, only before merging and when relevant changes are made (generally at reviewer-discretion).

Developers certificate of origin

Added try/except block to safely close things in case there's an unbound variable.
small fix
Added error handling for reporter closure and context clearing.
@IAlibay
Copy link
Member Author

IAlibay commented Feb 14, 2026

pre-commit.ci autofix

@github-actions
Copy link

No API break detected ✅

@IAlibay IAlibay requested a review from atravitz February 14, 2026 22:56
@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

❌ Patch coverage is 53.84615% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.96%. Comparing base (89d1948) to head (6eea84d).

Files with missing lines Patch % Lines
src/openfe/protocols/openmm_afe/base_afe_units.py 53.84% 6 Missing ⚠️
src/openfe/protocols/openmm_rfe/hybridtop_units.py 53.84% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1846      +/-   ##
==========================================
- Coverage   95.22%   92.96%   -2.27%     
==========================================
  Files         204      204              
  Lines       17623    17629       +6     
==========================================
- Hits        16781    16388     -393     
- Misses        842     1241     +399     
Flag Coverage Δ
fast-tests 92.96% <53.84%> (?)
slow-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

UnboundLocalErrors popping up when Protocols fail

1 participant