Skip to content

Improve temp file and error handling when resolving mixed hetatm altlocs. #339

Description

@marcuscollins

Regarding the use of resolve_mixed_hetatm_atom_altlocs, from PR 336:

Temporary CIF cleanup can be skipped if load_any(safe_reference_path) throws: resolve_mixed_hetatm_atom_altlocs() creates a delete=False tempfile, but the current unlink() only runs after a successful load_any(). Also, a cleanup unlink() failure currently aborts patching and is reported as a parse failure. Wrapping the load + subsequent parsing in a try/finally and swallowing unlink errors avoids leaking temp files and avoids false negatives.

We should fix this not in that PR but in all locations. One way to handle this would be to encapsulate all the required logic in resolve_mixed_hetatm_atom_altlocs directly.

Metadata

Metadata

Assignees

Labels

P1engineeringTask that is best suited to software engineers, not research scientists

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions