Skip to content

Add --force-superseded collator option (issue #87) - #88

Merged
tdudgeon merged 1 commit into
masterfrom
feature/force-superseded-collator-option
Jul 3, 2026
Merged

Add --force-superseded collator option (issue #87)#88
tdudgeon merged 1 commit into
masterfrom
feature/force-superseded-collator-option

Conversation

@tdudgeon

@tdudgeon tdudgeon commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Closes #87.

What

Adds a per-run --force-superseded flag to the collator that forces every crystal which would otherwise be unchanged to superseded status, 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 marked unchanged (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-unchanged crystal is promoted to superseded. new crystals stay new; rejected crystals stay deprecated.
  • _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 to superseded but 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 with force_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.md gains a "Forcing structures into an upload" subsection documenting the flag.

🤖 Generated with Claude Code

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>
@tdudgeon
tdudgeon merged commit d10aa86 into master Jul 3, 2026
6 checks passed
@tdudgeon
tdudgeon deleted the feature/force-superseded-collator-option branch July 3, 2026 08:50
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.

Add option to force all structures to superceded status

1 participant