Repository navigation
WP0 0.6/0.7: golden data and coverage for structures (WP3) and Fourier (WP4) - #37
Merged
Merged
Conversation
…r (WP4) Tests checked against independent references where possible: - test_wp3_structures.py: space-group expansion of 10 structures agrees site by site with gemmi; supercells; save/read, CIF and RMCProfile export/import round trips; DISCUS CIF read by gemmi; VASP export parsed. SHELX round trip is a strict known failure. - test_wp4_fourier.py: fcc extinctions, Debye-Waller factor, X-ray form factors vs IT92, anomalous dispersion (Friedel pairs in ZnSe match the structure-factor prediction; nickel stays symmetric), energy = wvle, golden maps for X-ray/neutron/electron and moa1 dispersion, seeded lots repeat exactly (golden). NUFFT agrees for the 50x50 layer; for small crystals it is a strict known failure. - Crystal.atoms() now skips the molecule blocks of saved .stru files. - tests/requirements.txt (gemmi); CI runs pytest and the docs from one venv with it. Findings, documented in the WP0 log and the coverage-gap document: NUFFT gives wrong maps for small crystals; SHELX export writes the whole cell with the symmetry; 'disp on' does not switch on dispersion (only 'anom'); fractions like 1./3. in .cell files are misread; export.mac has outdated references, typos and two false passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Yw8KkfPLawp8Po4f5Bc9v
The comma format with a column header ('atoms x, y, z, Biso') runs atom
values through the interpreter, so 1./3. is evaluated. Only the legacy
format (bare 'atoms', blank-separated values) uses a list-directed read
that stops at '/' and silently reads 1./3. as 1.; mixing the two formats
gives an error. New test for the comma format; the legacy test and the
WP0 log / coverage notes say this precisely.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yw8KkfPLawp8Po4f5Bc9v
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.
Merges into
claude-python-app(notmaster).Step 1 of finishing WP0: the safety net for the first two work packages that get rewired (WP3 structures and I/O, WP4 single-crystal Fourier). Wherever possible the tests compare DISCUS with an independent reference (gemmi's space groups and form factors, or physics), not only with an earlier DISCUS run.
New tests
tests/python/test_wp3_structures.py(27 tests)save→read stru, CIF and RMCProfile export → import round trips; DISCUS's CIF read by gemmi; VASP export parsed and checked..cellatom formats: expressions such as1./3.in the comma format; the legacy-format behaviour (finding 4).tests/python/test_wp4_fourier.py(16 tests)moa1values (golden).energy=wvle.lotsrepeat exactly with 1 and 4 threads (golden).04.sro3grid; strict known failure for small crystals.Also:
Crystal.atoms()now handles structures with molecules (it crashed on them);tests/requirements.txtadds gemmi, and CI runs pytest and the docs from one virtual environment with it.Findings (details in
migration/WP0_Test_Coverage_Gaps.mdand the WP0 log)04.sro3, which uses NUFFT.disp ondoes not switch on anomalous dispersion; onlydisp anomdoes, so macros usingdisp onsilently get none..cellatom format are silently misread. The comma format with a column header (atoms x, y, z, Biso) evaluates expressions such as1./3.correctly. The legacy format (bareatoms, blank-separated values) stops reading at/, so1./3.becomes 1. without a warning; mixing the two formats gives an error.01.Simulation/calculate.celluses the legacy format and gets Co at (0,0,0) instead of (1/3,2/3,0).01.Simulation/export.mac: most failures are outdated reference files and typos; two checks pass falsely becausecompare_files.mactreats a missing file as "no differences".Known failures are marked
xfail(strict=True): they turn red when the bug is fixed, so the mark gets removed.Checked
pytest tests/python: 81 passed, 2 known failures (33 legacy macro tests skipped withoutDISCUS_SUITE); the same withOMP_NUM_THREADS1 and 4, and on repeat.-W: clean.🤖 Generated with Claude Code
https://claude.ai/code/session_018Yw8KkfPLawp8Po4f5Bc9v