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
8 changes: 4 additions & 4 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Where DiffractoKit is going next, in order. `docs/parity.md` says what is held today and its known limits, and the GitHub
issues track each piece of work. The numbers below are the ones `docs/parity.md` cites as "ROADMAP item n".

1. **Diagnose before fixing.** Phase matching (`minimumVectors` = 2 makes "matrix" by exclusion; the cross-phase winner
ignores completeness), the ACOM mirror (a mirrored win carries `inPlaneAngle` + π with no flag; some off-grid
self-recoveries land 36 or 60 degrees away) and CIF symmetry (a group named by Hermann–Mauguin symbol alone, a partial
operation list). Each gets its cause stated first; what the diagnosis supports is fixed, the rest stays an open item.
1. **Diagnose before fixing.** A number that reads wrong gets its cause stated first; what the diagnosis supports is
fixed, the rest stays an issue. Open today: the ACOM beam direction lands 3 to 6 degrees off the [001] and [011] zone
axes on the AlMgSi demo where excitation widths nearly tie (#65). The phase-matching, ACOM-mirror and CIF-symmetry
items of October are closed (#7, #8, #9). Listing on the Swift Package Index (#58) is open beside it.
2. **Space-group facts, public.** Space group symbol, number and Hall symbol through spglib's definitions (no Wyckoff
positions first); a public `ReflectionFamily` initialiser; `RingIndexing`'s "accepted" documented as a likelihood ratio,
not family membership, or changed.
Expand Down
14 changes: 7 additions & 7 deletions tools/beta-variants/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# beta'' variants: planted truth (DiffractoKit task 35)
# beta'' variants: planted truth

`planted.py` builds the 12 orientation-relationship variants of beta'' (Mg5Si6, C2/m) in Al as rotation matrices, with their
pairwise disorientation angles in closed form and a set of seeded "measured" orientations whose nearest variant is known.
numpy only; no orix or diffsims is run and no upstream number is claimed. The Mac pin script (kit audit step 0) adds
numpy only; no orix or diffsims is run and no upstream number is claimed. `tools/pins/orix/pins.py` adds
`Misorientation.equivalent()` / `reduce()` at atol 1e-4 from the same matrices.

```sh
Expand All @@ -19,15 +19,15 @@ Output: `variants.npy` (12, 3, 3), `measured.npy` (48, 3, 3), `truth.json`. Do n
- 48 measured orientations (0.5 degree seeded noise, random 2/m setting) with the true variant; the nearest by disorientation
is unique (second best at least 89 degrees away).

## How the Mac session uses it
## How the tests use it
1. `CrystalPresets.betaDoublePrime` plus `OrientationRelationship.variants(matrix:precipitate:)` must return the 12 classes of
`variants.npy` (compare as classes under the right group, atol 1e-9) and the angle matrix in `truth.json`.
2. `nearestVariant(of:)` on `measured.npy` returns `truth.json.measured.true_variant` exactly.
3. The pin script runs orix 0.15.0 `Misorientation.equivalent()` on the same R0 and compares at atol 1e-4 (the orix test's own).
3. The orix pin script runs orix 0.15.0 `Misorientation.equivalent()` on the same R0 and compares at atol 1e-4 (the orix test's own).
4. Frame: precipitate Cartesian e1 || a, e2 || b, e3 = e1 x e2; if the kit's `UnitCell` Cartesian setting differs, convert R0
in the test wrapper and note it in `docs/parity.md`.

## Open point for Paul
## Open point
The OR (a || [3 2 0]Al, b || [001]Al, c || [1 -3 0]Al) is derived in the script from the lattice parameters (105.25 degrees
against beta = 105.3, a misfit 3.7 %); it is not copied from the paper. Scope question 1 (which OR the study used) decides it;
replacing it means editing `R0` in `planted.py` only. Check against Andersen et al. 1998 before the figure quotes it.
against beta = 105.3, a misfit 3.7 %); it is not copied from the paper. Replacing it means editing `R0` in `planted.py` only.
Check against Andersen et al. 1998 before a figure quotes it.
27 changes: 6 additions & 21 deletions tools/consumer-check/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# consumer-check

A separate SwiftPM package that depends on DiffractoKit **by path** (`.package(path: "../..")`) and uses, from outside the
package, the public API of slices 1 to 3: `UnitCell`, `MillerIndex`, `IntegerMatrix`, `SymmetryOperation`, `PointSymmetry`,
package, the public API: `UnitCell`, `MillerIndex`, `IntegerMatrix`, `SymmetryOperation`, `PointSymmetry`,
`LaueClass`, `CrystalSystem`, `Element`, `AtomSite`, `CrystalStructure`, `SymmetryDetection`, `CIFImport`, `CIFDocument`,
`ReflectionList`, `Reflection`, `ReflectionFamily`, `ElectronScatteringFactors`, `StructureFactors`,
`KinematicReflectionList`, and DiffractoGeometry's `ElectronWavelength`, `RingCalibration` (closed forms, `calibrate`,
Expand All @@ -15,26 +15,11 @@ a q at Au {111}'s g with σ = 1e-3 q accepted as {1 1 1}, β″'s [0 0 1] = (cos
rendered by `GeometryChecks.swift` and recovered inside the apps' bands (radius 1 %, b/a 0.01, centre 1 px), and a 2:1
ellipse's offset (4, 3) corrected to (2, 3)).

DiffractoKit 0.1.0 adds `RingFitChecks.swift` and two sections of `main.swift`: `RingCalibration.q` / `radius`, `RingEvidence`
(by hand and on a planted ring), `fitRing` / `calibrating` (equal to `fit`), `requireRingEvidence`, the three new refusals and
`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.

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
the primitive file cell; rutile with its 4-fold axis along a: 4/mmm, 16 operations, the file's (1 0 0) the conventional
(0 0 1)), and `detectingSymmetry(conventional:tolerance:search:)` with `SymmetryDetection.Tolerance` / `Search` (a 0.012 Å
displacement in a 30 Å cell: symmetric at the fractional 5e-3, not at the Cartesian 1e-3 Å; the cell list equals the brute-force
scan). 530 checks in all.

DiffractoKit 0.2.0 adds `PolicyChecks.swift`: every `Policy` type (`ReflectionList`, `CrystalStructure.ValidationPolicy`,
`SymmetryDetection`, `CIFImport`, `EllipseCalibration`, `RingEvidence`, `RingCalibration`) with its `.default` read field by
field, one non-default use whose outcome a reader verifies by hand (a 0.3 Å contact usable under a 0.2 Å limit, a 120 degree
gap fitted under a coverage bound of 20 bins, occupancies 0.50 and 0.51 two species at tolerance 0), the refusals of an invalid
value (a position tolerance outside its domain, an `Int.max` bin count, a NaN residual cap), `SymmetryOperation(xyz:maximumMagnitude:)`,
`RingIndexing`'s `minimumMargin:` and `reach`, and `retainingAll:` (`kept` and `families` equal, `all` empty).
`RingFitChecks.swift` covers the ring fit (`RingCalibration.q` / `radius`, `RingEvidence`, `fitRing` / `calibrating`, the
refusals, `FitReport`, `progress:` / `isCancelled:`, `LocalizedError` on the error types, the tetragonal settings);
`ConventionalChecks.swift` the Niggli reduction, the conventional cell and `SymmetryDetection` with its tolerance and search;
`PolicyChecks.swift` every `Policy` type read field by field, one non-default use each and the refusals of invalid values.
About 530 checks in all.

```
tools/consumer-check/run.sh
Expand Down
Loading