Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# provenance: DiffractoKit slice-1 Gate B refuter, 2026-10-14 night (F2e_quartz_shifted.cif); a regression fixture
# provenance: alpha quartz SiO2 (P3_221) as a P1 list of its 9 sites at a shifted origin, 4 decimals. Regression fixture
# (RefuterRegressionTests): the 6 operations of P3_221 and Laue class -3m.
data_F2e_quartz
_symmetry_space_group_name_H-M 'P 1'
_symmetry_Int_Tables_number 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# provenance: DiffractoKit slice-1 Gate B refuter, 2026-10-14 night (corundum_rh_p1.cif); a regression fixture
# provenance: corundum Al2O3 (R-3c) in rhombohedral axes as a P1 list of its 10 sites. Regression fixture
# (RefuterRegressionTests): Laue class -3m with 12 operations, ring names in three indices, not Miller-Bravais.
# generated using pymatgen
data_Al2O3
_symmetry_space_group_name_H-M 'P 1'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# provenance: DiffractoKit slice-1 Gate B refuter, 2026-10-14 night (F2c_Au_shifted_exactdecimals.cif); a regression fixture
# provenance: fcc gold (Fm-3m) as a P1 list shifted by (0.2484, 0.3, 0.07), exact 4-decimal coordinates. Regression fixture
# (RefuterRegressionTests): 192 operations with off-grid translations; the inversion carries 0.4968, not 0.5.
data_F2c
_symmetry_space_group_name_H-M 'P 1'
_symmetry_Int_Tables_number 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# provenance: DiffractoKit slice-1 Gate B refuter, 2026-10-14 night (P1_cubic_1fe.cif); a regression fixture
# provenance: one Fe atom at the general position (0.11, 0.23, 0.31) of a 5 A cube, an origin shift of Pm-3m. Regression fixture
# (RefuterRegressionTests): 48 operations, every reflection allowed, ring {1 1 0} of 12; a fixed k/24 snap had given 43 operations.
data_p1test
_symmetry_space_group_name_H-M 'P 1'
_symmetry_Int_Tables_number 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# provenance: DiffractoKit slice-1 Gate B refuter, 2026-10-14 night (F2a_Mg_shifted.cif); a regression fixture
# provenance: hcp magnesium (P6_3/mmc) as a P1 list shifted by (0.1, 0.2, 0.3), written to 8 decimals. Regression fixture
# (RefuterRegressionTests): a detected translation of 0.20000001 must still pass the absence test, 282 of 324 allowed at 1.2 1/A.
data_F2a
_symmetry_space_group_name_H-M 'P 1'
_symmetry_Int_Tables_number 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# provenance: DiffractoKit slice-1 Gate B refuter, 2026-10-14 night (F2f_Mg_loop_0.37.cif); a regression fixture
# provenance: hcp magnesium (P6_3/mmc) at a shifted origin with its 24 operations as exact rational translations in the loop.
# Regression fixture (RefuterRegressionTests): the file operations are symmetries and give 282 of 324 allowed at 1.2 1/A.
# generated using pymatgen
data_Mg
_symmetry_space_group_name_H-M P6_3/mmc
Expand Down
3 changes: 2 additions & 1 deletion Tests/DiffractoCoreTests/Fixtures/mixed_centring.cif
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# provenance: DiffractoKit slice-1 Gate B refuter, 2026-10-14 night (mixed_centred.cif); a regression fixture
# provenance: an F-centred cubic oxide with Fe2+ 0.5 and Fe3+ 0.5 sharing the origin, centring written as a P1 operation loop.
# Regression fixture (RefuterRegressionTests): co-sited species keep their own rows, 8 Fe sites of 0.5 and 4 O after expansion.
data_mixed_centred
_cell_length_a 8.39
_cell_length_b 8.39
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# provenance: DiffractoKit slice-1 Gate B refuter, 2026-10-14 night (F3_super7.cif); a regression fixture
# provenance: simple cubic polonium (a 3.35) as a 1 x 1 x 7 supercell in P1, z written to 8 decimals. Regression fixture
# (RefuterRegressionTests, conventional-cell pins): translations of k/7 lie off the 1/24 grid; 112 operations, 122 of 782 allowed at 0.9 1/A.
data_F3
_symmetry_space_group_name_H-M 'P 1'
_symmetry_Int_Tables_number 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# provenance: DiffractoKit slice-1 Gate B refuter, 2026-10-14 night (F2d_NaCl_shifted.cif); a regression fixture
# provenance: rock salt NaCl (Fm-3m) as a P1 list shifted by (0.9172, 0.6292, 0.5141), exact 4-decimal coordinates. Regression
# fixture (RefuterRegressionTests): 192 operations and the absences and rings of the unshifted structure.
data_F2d_NaCl
_symmetry_space_group_name_H-M 'P 1'
_symmetry_Int_Tables_number 1
Expand Down
18 changes: 9 additions & 9 deletions Tests/Fixtures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,35 @@ No fixture is copied from the test data of pymatgen, orix or py4DSTEM.

| File | Size | Generated by | Note |
|---|---|---|---|
| `DiffractoCoreTests/Fixtures/alpha_quartz_P1_origin_shifted.cif` | 747 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/alpha_quartz_P1_origin_shifted.cif` | 828 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/alpha_quartz_P3221.cif` | 924 B | `tools/pins/cells/pins.py`, `tools/pins/structure-factors/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/alpha_quartz_P3221_as_seeded.cif` | 712 B | `tools/pins/cells/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/calcite_R-3c_hex.cif` | 1.4 KB | `tools/pins/cells/pins.py`, `tools/pins/structure-factors/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/cdi2_P-3m1.cif` | 462 B | `tools/pins/cells/pins.py`, `tools/pins/structure-factors/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/cif-symmetry-pins.json` | 19.4 KB | `tools/pins/cif-symmetry/pins.py` | |
| `DiffractoCoreTests/Fixtures/corundum_P1_rhombohedral.cif` | 1.3 KB | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only), with pymatgen `CifWriter` |
| `DiffractoCoreTests/Fixtures/corundum_P1_rhombohedral.cif` | 1.4 KB | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only), with pymatgen `CifWriter` |
| `DiffractoCoreTests/Fixtures/fluorapatite_P63m.cif` | 781 B | `tools/pins/cells/pins.py`, `tools/pins/structure-factors/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/gold_P1.cif` | 396 B | `tools/pins/cells/pins.py`, `tools/pins/structure-factors/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/gold_P1_origin_shifted_exact_decimals.cif` | 588 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/gold_P1_origin_shifted_exact_decimals.cif` | 697 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/gold_centring_ops.cif` | 440 B | `tools/pins/cells/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/ideal_hcp_P1.cif` | 504 B | `tools/pins/cells/pins.py` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/iron_P1_general_position.cif` | 470 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/magnesium_P1_origin_shifted.cif` | 529 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/iron_P1_general_position.cif` | 622 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/magnesium_P1_origin_shifted.cif` | 670 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/magnesium_P63mmc.cif` | 401 B | `tools/pins/phase-vectors/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/magnesium_P63mmc_24ops.cif` | 896 B | `tools/pins/cells/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/magnesium_P63mmc_origin_shifted_loop.cif` | 1.5 KB | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only), with pymatgen `CifWriter` |
| `DiffractoCoreTests/Fixtures/mixed_centring.cif` | 561 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/magnesium_P63mmc_origin_shifted_loop.cif` | 1.7 KB | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only), with pymatgen `CifWriter` |
| `DiffractoCoreTests/Fixtures/mixed_centring.cif` | 706 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/mp-import/input-aluminium-v3.json` | 1.6 KB | `tools/pins/mp-import/pins.py` | third party: Materials Project data, CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/), source https://materialsproject.org; credited in `NOTICE` |
| `DiffractoCoreTests/Fixtures/mp-import/input-magnesiumJSON.json` | 1.1 KB | `tools/pins/mp-import/pins.py` | third party: Materials Project data, CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/), source https://materialsproject.org; credited in `NOTICE` |
| `DiffractoCoreTests/Fixtures/mp-import/input-siliconJSON.json` | 2.9 KB | `tools/pins/mp-import/pins.py` | third party: Materials Project data, CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/), source https://materialsproject.org; credited in `NOTICE` |
| `DiffractoCoreTests/Fixtures/mp-import/pymatgen-pins.json` | 6.3 KB | `tools/pins/mp-import/pins.py` | |
| `DiffractoCoreTests/Fixtures/polonium_P1_supercell_7x.cif` | 737 B | `tools/pins/conventional-cell/pins.py` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/polonium_P1_supercell_7x.cif` | 894 B | `tools/pins/conventional-cell/pins.py` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/presets-pins.json` | 21.1 KB | `tools/pins/presets/pins.py` | |
| `DiffractoCoreTests/Fixtures/pymatgen-cells-pins.json` | 2.7 MB | `tools/pins/cells/pins.py`, `tools/pins/conventional-cell/pins.py` | |
| `DiffractoCoreTests/Fixtures/pyrite_Pa-3.cif` | 1.1 KB | `tools/pins/cells/pins.py`, `tools/pins/structure-factors/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/pyrite_Pa-3_as_seeded.cif` | 787 B | `tools/pins/cells/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/rocksalt_Fm-3m_192ops.cif` | 3.5 KB | `tools/pins/cells/pins.py`, `tools/pins/structure-factors/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/rocksalt_P1_origin_shifted.cif` | 703 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/rocksalt_P1_origin_shifted.cif` | 823 B | review regression CIF, read by `RefuterRegressionTests` | written for this kit (GPL-3.0-only) |
| `DiffractoCoreTests/Fixtures/silicon_Fd-3m.cif` | 498 B | `tools/pins/cells/pins.py`, `tools/pins/structure-factors/pins.py` | mac4DSTEM tests: from mac4DSTEM 7448401b (GPL-3.0, same author), named in its first comment line |
| `DiffractoCoreTests/Fixtures/spglib-conventional-cell-pins.json` | 2.2 MB | `tools/pins/conventional-cell/pins.py` | |
| `DiffractoCoreTests/Fixtures/tetragonal-pins.json` | 14.3 KB | `tools/pins/cells/tetragonal-pins.py` | |
Expand Down
14 changes: 14 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
"include-component-in-tag": false,
"include-v-in-tag": false,
"bump-minor-pre-major": true,
"changelog-sections": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "perf", "section": "Performance Improvements"},
{"type": "revert", "section": "Reverts"},
{"type": "deps", "section": "Dependencies"},
{"type": "test", "section": "Fixtures and tests"},
{"type": "docs", "section": "Documentation", "hidden": true},
{"type": "style", "section": "Styles", "hidden": true},
{"type": "chore", "section": "Miscellaneous Chores", "hidden": true},
{"type": "refactor", "section": "Code Refactoring", "hidden": true},
{"type": "build", "section": "Build System", "hidden": true},
{"type": "ci", "section": "Continuous Integration", "hidden": true}
],
"packages": {
".": {
"package-name": "DiffractoKit",
Expand Down
2 changes: 1 addition & 1 deletion tools/consumer-check/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DiffractoKit 0.1.0 adds `RingFitChecks.swift` and two sections of `main.swift`:
`FitReport`'s new fields, `progress:` / `isCancelled:` on every fit, `LocalizedError` on the three error types, and the
tetragonal settings. 397 checks at 0.0.4.

Slice 1b adds `ConventionalChecks.swift`: `UnitCell.niggliReduced` / `ReducedCell` (fcc gold's primitive cell, a skewed basis of
The conventional setting and Niggli reduction add `ConventionalChecks.swift`: `UnitCell.niggliReduced` / `ReducedCell` (fcc gold's primitive cell, a skewed basis of
it, an invalid cell), `UnitCell.conventionalCell` / `ConventionalCell` / `BravaisLattice` (gold primitive -> cF with 4 centring
translations, bcc -> cI, a C-centred monoclinic primitive cell -> mC with b the unique axis), `CrystalStructure.setting` /
`conventionalSetting` / `ConventionalSetting` and its four conversions (gold: 192 operations in the conventional cell and 48 in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ConventionalChecks.swift
// Role: the public API DiffractoKit slice 1b adds to DiffractoCore, used from outside the package with a real call and a
// Role: the conventional-setting and Niggli-reduction API of DiffractoCore, used from outside the package with a real call and a
// result a reader verifies by hand: the Niggli reduction and its change of basis (`niggliReduced`, `ReducedCell`),
// the conventional cell and its Bravais lattice (`conventionalCell`, `ConventionalCell`, `BravaisLattice`), the
// symmetry of a structure in any setting (`detectingSymmetry(conventional:tolerance:search:)`,
Expand Down Expand Up @@ -286,7 +286,7 @@ func runConventionalChecks(_ report: inout Report) {
r.equal("and is not at the Cartesian 1e-3 A", tight.operations.count < 96, true)
r.equal("the proposed Cartesian tolerance is 1e-3 A", SymmetryDetection.Tolerance.proposedCartesian, .cartesian(1e-3))
r.equal("it differs from the fractional default", SymmetryDetection.Tolerance.proposedCartesian != .default, true)
r.equal("the default is slice 1's fractional 5e-3", SymmetryDetection.Tolerance.default, .fractional(SymmetryDetection.positionTolerance))
r.equal("the default is the fractional 5e-3 position tolerance", SymmetryDetection.Tolerance.default, .fractional(SymmetryDetection.positionTolerance))
r.equal("(its value)", SymmetryDetection.Tolerance.default, .fractional(5e-3))
let proposed = CrystalStructure.detectingSymmetry(cell: big, sites: displaced, tolerance: .proposedCartesian, conventional: false)
r.equal("detecting with the proposed tolerance equals the .cartesian(1e-3) call", proposed.operations, tight.operations)
Expand Down
4 changes: 2 additions & 2 deletions tools/pins/cells/tetragonal-pins.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
It writes Tests/DiffractoCoreTests/Fixtures/tetragonal-pins.json BEFORE the Swift fix exists. Oracle: pymatgen 2026.9.24
(pymatgen-core 2026.10.16) SpacegroupAnalyzer on spglib 2.8.0, NumPy 2.5.4.

Tolerance: symprec = 1e-4 (Angstrom, spglib's), as slice 1's pins (tools/pins/cells/pins.py SYMPREC). The inputs are
Tolerance: symprec = 1e-4 (Angstrom, spglib's), as the cells pins (tools/pins/cells/pins.py SYMPREC). The inputs are
exact (coordinates written to 4 decimals and expanded by the space group's own operations, so every equivalent site is
exact to 1e-15): the answer does not depend on symprec between 1e-6 and 1e-2, which the script checks (symprec 1e-2 gives the
same space group number). The kit's own position tolerance is a fixed 5e-3 fractional (SymmetryDetection.positionTolerance);
Expand All @@ -33,7 +33,7 @@
any), and the cubic one is invariant.

Per entry the fixture carries: the cell, the sites, pymatgen's space-group number, point-group symbol, the Laue class
(the 32 -> 11 table of slice 1), the number of point operations of the point group (get_point_group_operations), the number of
(the 32 -> 11 table of tools/pins/cells/pins.py), the number of point operations of the point group (get_point_group_operations), the number of
space-group operations on the cell as given (get_symmetry_operations; centring translations counted, lattice
translations not), and the order of the Laue group (2 x the point-group's proper part: the count of {+-R}).
"""
Expand Down
Loading
Loading