Skip to content

test: CIF headers and pin scripts say what they hold, not which session made them - #42

Merged
Paullo9 merged 4 commits into
mainfrom
issue-40-cif-headers
Oct 31, 2026
Merged

Paullo9 merged 4 commits into
mainfrom
issue-40-cif-headers

Conversation

@Paullo9

@Paullo9 Paullo9 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Requested by Paul · project thread

Fixes #40, together with #41 (this PR does the parts #41 left open). The two branches merge cleanly into each other and into main.

Fixture move: the nine review regression CIF headers (own commit)

The first comment line of alpha_quartz_P1_origin_shifted.cif, magnesium_P1_origin_shifted.cif, polonium_P1_supercell_7x.cif, mixed_centring.cif, rocksalt_P1_origin_shifted.cif, iron_P1_general_position.cif, corundum_P1_rhombohedral.cif, gold_P1_origin_shifted_exact_decimals.cif and magnesium_P63mmc_origin_shifted_loop.cif named a past review session. Each header now says which structure the file holds and what RefuterRegressionTests checks with it (for the 7x supercell, also the conventional-cell pins). Only comment lines change. Tests/Fixtures/README.md has the new sizes.

The pins do not change. These nine CIFs are not sha256-locked anywhere. Neither pymatgen-cells-pins.json nor numpy-structure-factor-pins.json lists them: their cif_file and cif_sha256 entries cover the other CIF fixtures only. To check this, I reran tools/pins/cells/pins.py, tools/pins/structure-factors/pins.py and tools/pins/conventional-cell/pins.py (the only generator that reads one of the nine, the polonium supercell) on the edited files, using the pinned environment (pymatgen 2026.9.24, pymatgen-core 2026.10.16, spglib 2.8.0, NumPy 2.5.4):

  • numpy-structure-factor-pins.json: byte-identical.
  • pymatgen-cells-pins.json and spglib-conventional-cell-pins.json: byte-identical except the generated_at stamp.
  • Every self-check passes (6960, 7138 and 192).

No pin file is committed, so the pinned values and the sha256 values stay as they are.

Pin script comments

The comments, docstrings, READMEs and failure messages in tools/pins (cells/tetragonal-pins.py, structure-factors/pins.py and its README, conventional-cell/pins.py, phase-vectors/pins.py and its README, ring-calibration/ring-pins.py and q-pins.py, ring-indexing/pins.py) and in tools/consumer-check said slice 1, 2, 3a, 3b or 4. They now name the pin file, generator or rule they mean. Variables SLICE1_PINS, slice1, SLICE2_PINS and slice2 are renamed CELLS_PINS, cells_pins, STRUCTURE_FACTOR_PINS and sf_pins. The first docstring lines of the seven scripts that #41 edits are left to #41.

Not changed: strings written into fixtures

These strings are written into fixtures and stay as they are, because no fixture is regenerated here:

Change them the next time those pins are regenerated for another reason.

CHANGELOG

release-please hides test: entries by default. release-please-config.json now shows them under "Fixtures and tests", as in ImagoKit. The override below gives the fixture move its CHANGELOG line.

BEGIN_COMMIT_OVERRIDE
test: the nine review regression CIF headers say which structure each holds and what it tests (comment lines only; no pin or value changes)
END_COMMIT_OVERRIDE

Tests

  • swift test -c release -j 1 --skip DiffractoKitParityTests --filter DiffractoCoreTests: 170 tests in 28 suites passed. This covers RefuterRegressionTests and the tests that read every CIF in the fixtures folder. CI runs the full unit gate.
  • All edited Python scripts compile. The three generators above rerun with byte-identical output (apart from the timestamp). phase-vectors/pins.py was not rerun: it needs the py4DSTEM environment. Its changes are comments, failure messages and the two renamed variables, checked by search.

🤖 Generated with Claude Code

Paullo9 and others added 3 commits October 31, 2026 01:03
Fixture move. The first comment line of the nine origin-shift, supercell,
co-sited and rhombohedral CIFs named a past review session. Each header
now says which structure the file holds and what RefuterRegressionTests
(and, for the 7x supercell, the conventional-cell pins) checks with it.

Only comment lines change. No pin file locks these CIFs by sha256: they
are not in pymatgen-cells-pins.json or numpy-structure-factor-pins.json.
Regenerating cells/pins.py, structure-factors/pins.py and
conventional-cell/pins.py with the pinned pymatgen environment on the
edited files gives byte-identical pins apart from the generated_at
stamp, so no pin file is committed. Tests/Fixtures/README.md carries the
new file sizes.

Part of #40.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comments, docstrings, READMEs and check messages of the pin scripts
and the consumer check said slice 1, slice 2, slice 3a, slice 4. They now
name the pin file, the generator or the rule they mean (the cells pins
and tools/pins/cells/pins.py, the structure-factor pins, the
ring-calibration pins). In conventional-cell/pins.py and
phase-vectors/pins.py the variables SLICE1_PINS, slice1, SLICE2_PINS and
slice2 are now CELLS_PINS, cells_pins, STRUCTURE_FACTOR_PINS and sf_pins.

Strings written into fixtures (the source label slice-1, purpose, the
families and rings descriptions, the vs_slice2 keys) stay: no fixture is
regenerated here. The first docstring lines of seven scripts are left to
PR #41.

Rerunning structure-factors/pins.py and conventional-cell/pins.py with
the pinned environment gives byte-identical pins apart from generated_at;
every edited script compiles.

Part of #40.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
release-please hides test: commits by default, so a fixture move had no
CHANGELOG line. The config now lists the default sections and shows
test: under Fixtures and tests; the hidden sections stay hidden.

Part of #40.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Paullo9 Paullo9 self-assigned this Oct 31, 2026
Tests/Fixtures/README.md conflicted: main added the licence Note column, this branch changed the sizes of the rewritten CIFs. Resolved with the Note column from main and the sizes from this branch (checked with wc -c).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Paullo9
Paullo9 merged commit 8bd454a into main Oct 31, 2026
10 of 11 checks passed
@Paullo9
Paullo9 deleted the issue-40-cif-headers branch October 31, 2026 14:58
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.

Tools, tests and fixture headers still describe work sessions in prose

1 participant