Add --force-superseded collator option (issue #87) - #88
Merged
Conversation
Force all otherwise-unchanged crystals to 'superseded' status so they are re-processed and included in the next upload. This is needed when something that matters (e.g. assemblies.yaml) has changed but the PDB files have not. The flag is honoured both when determining status (_get_xtal_status) and when copying crystallographic files (_copy_files) so that the forced entries have their files re-copied into the current version dir and their metadata paths updated, rather than continuing to reference the previous upload. Includes unit tests for status determination and an integration test that excludes a dataset from upload_1, re-introduces it in upload_2 with --force-superseded, and checks the resulting status values, metadata file paths and copied files. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #87.
What
Adds a per-run
--force-supersededflag to the collator that forces every crystal which would otherwise beunchangedtosupersededstatus, so it is re-processed and included in the next upload.This is needed when something that matters has changed but the PDB files have not — for example an edit to
assemblies.yaml. Normally such crystals are markedunchanged(based on a PDB SHA256 comparison), left out of the upload, and skipped by the aligner.How
The flag is honoured in two places:
_get_xtal_status— an otherwise-unchangedcrystal is promoted tosuperseded.newcrystals staynew; rejected crystals staydeprecated._copy_files— the PDB/MTZ/CIF/event-map copy decisions (previously driven solely by per-file SHA256 comparison, independent of status) also honour the flag, so the forced entries have their files re-copied into the current version dir and their metadata paths updated. Without this, the status flipped tosupersededbut the files stayed in the previous upload and the metadata kept pointing there.Tests
tests/test_collator_status.py— unit tests for_get_xtal_status(unchanged / superseded / force-promoted / rejected-stays-deprecated).tests/test_force_superseded.py— integration test: excludes a dataset from upload_1, re-introduces it in upload_2 withforce_superseded=True, and asserts the resulting status values, metadata file paths (upload_2/...) and that the files were actually copied.Full suite: 70 passed.
Docs
docs/source/USER-GUIDE.mdgains a "Forcing structures into an upload" subsection documenting the flag.🤖 Generated with Claude Code