Skip to content

PowderLine 0.2.0: one recipe per engine (GSAS-II, TOPAS, easydiffraction), core + engine schemas 0.1.0 - #13

Merged
Adam Corrao (AdamCorrao) merged 275 commits into
NSLS2:mainfrom
AdamCorrao:release/0.2.0-cleanup
Nov 5, 2026
Merged

Adam Corrao (AdamCorrao) merged 275 commits into
NSLS2:mainfrom
AdamCorrao:release/0.2.0-cleanup

Conversation

@AdamCorrao

@AdamCorrao Adam Corrao (AdamCorrao) commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

PowderLine 0.2.0 turns PowderLine into an application layer over three refinement engines:

  • A recipe names one engine and one workflow in its schema_name: gsasii.rietveld, gsasii.spf,
    topas.rietveld, topas.spf or easydiffraction.rietveld.
  • It is written in that engine's own terms.
  • powderline.run() / the powderline CLI hand it to that engine's gateway.

Nothing is translated between engines. The single 0.1–0.26.0 schema is replaced by a core schema and one
schema per engine, each starting at 0.1.0.

The full user-facing list is in CHANGELOG.md (0.2.0); the upgrade path is
docs/migration-0.1-to-0.2.md.

Highlights

  • Three engines, one API and CLI: GSAS-II 5.7.9, TOPAS 6 (Windows, tc.exe) and easydiffraction 0.21.1.
    The core environment validates any recipe without an engine installed.
  • Validation states what the engine computes: symmetry, engine floors and silent defaults become errors
    or structured warnings, never silent changes.
  • Uniform fit statistics: PowderLine computes Rwp, Rexp, GoF and χ²_red the same way for every engine.
  • The output recipe: every result carries the recipe with refined values written back, ready to chain.
  • Ionic scattering types and March–Dollase preferred orientation in all three engines.
  • One failure contract: every failure raises, with a reason and a failure.json record.
  • powderline --doctor.
  • The GSAS-II server needs no shared filesystem.

Upgrading

  • 0.26.0 recipes are refused at schema_name. Convert gsasii recipes with
    scripts/convert_recipe_026.py; write TOPAS and easydiffraction recipes natively.
  • run() has no engine=. Results carry status (no success/error).
  • Pixi environments: default (core only), gsasii, easydiffraction, all, dev. Requires pixi ≥ 0.82.1.

Verification

  • Linux (each suite run at the branch tip):

    Suite Result
    engine-free 1832 passed / 23 skipped
    TOPAS (generation) 289 / 31
    GSAS-II 1488 / 3
    easydiffraction 100 / 13

    The field-table check and the docs build with -W are clean.

  • TOPAS 6, Windows:

    • The native runner reproduces every TOPAS 6 golden fixture byte for byte.
    • Ionic types: La3+/La intensity ratios agree with GSAS-II within 0.07 %.
    • Preferred orientation: the correction equals GSAS-II's March–Dollase per reflection (1e-7), and a
      simulated r = 0.6 is recovered as 0.598.
    • tests/test_topas_exec.py reruns all of this on a TOPAS machine.
    • On the release code, pixi run test-topas with tc.exe passed: 297 passed / 22 skipped, including all 9
      topas_exec tests. The five example TOPAS recipes ran through the CLI (exit 0), and powderline --doctor
      found no problems.
    • An output folder with a non-ANSI (Greek) name runs through its 8.3 short path. A TCHZ peak with a negative
      Lorentzian part runs while its total width is positive; where the total width is not positive TOPAS writes
      no results, and validation refuses it. Both were checked on TOPAS 6.
  • Windows 11 (the same machine, release code, environments installed with --frozen):

    Suite Result
    engine-free 1812 passed / 42 skipped
    GSAS-II (built from source) 1487 / 4
    easydiffraction 100 / 13

    Windows skips more tests than Linux; the October Windows pass did too. The engine-free count is from the
    final TOPAS session; the GSAS-II and easydiffraction counts from the session before it, after which only
    comments and docstrings changed in those gateways.

  • Regression references under examples/**/output/ changed only with equivalence records: the
    version-string change, and the output recipes added beside the existing files.

Known issues

docs/known_issues.md, in particular:

  • KI-15: four examples are deliberately ill-posed teaching cases; their output recipes are invalid by design.
  • KI-17 / KI-18: split sites near special positions.
  • KI-16: TOPAS execution, now verified on TOPAS 6 (resolved).

Reviewing

The diff is large. Suggested order:

  1. CHANGELOG.md.
  2. docs/migration-0.1-to-0.2.md, docs/schemas.md, docs/input-guidance.md.
  3. src/powderline/{api,schema_core,results,roundtrip}.py.
  4. One gateway at a time under src/powderline/gateways/.

The frozen GSAS-II modules (gateways/gsasii/{helpers,project,setters,executors,extractors,constraints}.py)
were moved verbatim from the old kicker.py. Every later edit to them is in the maintainers' signed-off
record and is guarded by _code_hash.json.

AI assistance (NSLS-II policy)

This work was done with AI coding assistants (Claude Code) under maintainer direction and review. Commits
made since the 2026-11-03 review carry Assisted-by: claude-code:<model> trailers. Earlier commits on this
line carry Co-Authored-By: Claude … trailers; history was not rewritten. The maintainers have reviewed the
changes and the test results above.

Adam Corrao (AdamCorrao) and others added 30 commits October 6, 2026 13:29
…on (A77, A78)

- check_cell(space_group, cell): the metric tensor must be invariant under
  every group rotation; compared with the group-averaged cell within
  CELL_TOL = 1e-9 (float noise only). Errors name each parameter and its
  symmetric value. Covers all crystal systems incl. monoclinic unique axes
  and rhombohedral :R.
- check_uij(space_group, xyz, uij): U must be invariant under the site
  stabilizer (R U R^T, the GSAS-II convention). Within UIJ_TOL = 1e-6 A^2
  the symmetric values are returned with adjusted=True; beyond that,
  SymmetryError.
- Canonical coordinates and symmetric Uij use the least-change
  (orthogonal) projection onto the symmetric subspace, anchored at the
  stabilizer barycenter. The Reynolds average alone is oblique on
  hexagonal/trigonal axes and moved free components (e.g. U11 on 6h).
  Changes <= 1e-12 snap back to the stated value; SiteAnalysis gains `adp`.
- tests/test_symmetry_core.py (core-only, no GSAS-II); the characterization
  canonicalization tests now assert exact values (the previous np.allclose
  silently allowed rtol=1e-5) and the coupled least-change result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re (A35, A62-A63, A69, A73-A78)

PhaseStructure validates the structure once, in core:
- explicit space-group setting (A62);
- cell lengths > 0, angles in (0, 180), no volume (A75), cell consistent
  with the group (A77);
- exact bare element symbols (A63);
- occupancy 0..1 (A76);
- ADP 'Uiso' with Uiso or 'Uaniso' with all six Uij, Uij consistent with
  the site symmetry, adjusted within 1e-6 A^2 (A78);
- per-atom analyze_site: ambiguous band = error, stated Multiplicity
  cross-checked (A69), special-position coordinates replaced by their exact
  canonical values (A73).
Every adjustment becomes a StructuredWarning (special_position_adjusted /
adp_symmetry_adjusted, field_path relative to the structure), available
from warnings(). The site analyses are available from site(label). All atom
problems are reported together in one error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lders

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… location (A70)

Review of PR #3 (S2, F1, N2):
- All of an atom's problems are reported: a wrong Multiplicity no longer
  skips that atom's Uaniso check.
- Each problem is a separate pydantic error at its field: unit_cell,
  atoms.<label> (position), atoms.<label>.Multiplicity,
  atoms.<label>.Uaniso, raised together as one ValidationError
  (ValidationError.from_exception_data). Locations get the enclosing path
  when PhaseStructure is embedded in an engine model, also from JSON.
  The atom label is now in the location, not repeated in the message.
- Canonicalization no longer modifies a caller-supplied Atom: adjusted
  atoms are copies (model_copy).
- Docstring + SCHEMA_HISTORY: problems are reported per field, once the
  individual fields are valid (pydantic skips model validators after a
  field error).

Tests: one atom with two problems; cell + position + multiplicity
locations; nested JSON locations; caller Atom untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… band message, compat input check

Review of PR #3 (N1, N4-N8, N10):
- check_element_symbol suggests a spelling only for case/whitespace
  differences (' Fe' -> 'Fe'); gemmi's prefix reading ('Nax' -> Na) is no
  longer offered as a fix (N1).
- ChebyshevBackground rejects non-finite coefficients, like every other
  numeric core field (N7).
- analyze_site's ambiguous-band error names the special position and its
  multiplicity only when the nearby operations form a group (new
  _is_group); otherwise it says "a special position" instead of printing a
  non-multiplicity (N10).
- compat.required_core_schemas raises ValueError (not AttributeError) for a
  requires_core_schema that is neither a specifier nor a mapping;
  support_matrix() documents that malformed declarations raise (N8).
- Docstrings: UnitCell cites A75 (N4); oblique projector singular values
  (N5); topas/errors.py no longer says symmetry raises it (N6).

Tests: element hints; non-finite coefficients; _is_group; band message;
compat non-mapping. The compat first-match test now has two matching keys
in both orders (it could not tell first-wins from highest-bound-wins); the
misleadingly named picks_highest_version_match is replaced by
skips_non_matching_keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ema/symmetry tests

Review of PR #3 (N3):
- The 11 bare pytest.raises(ValidationError) in test_schema_core (strict
  flags, null values) now assert the exact (location, type) of every
  error, so they cannot pass on the wrong field.
- The cubic b != a test asserted '"b" in msg' (always true); it now checks
  "b = 4.2 (symmetric value" and the unit_cell location.
- "Returned unchanged" checks use == instead of abs(...) < 1e-15
  (check_uij, canonical 1/3 and 2/3, free U11 on 6h); the code returns
  exact values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…c core fields (A80)

Review of PR #3 (S1). pydantic's default lax mode read "0.25" and true as
numbers (x: true -> 1.0, Multiplicity: true -> 1), against A73 and the
generated JSON Schema. Every numeric core field now uses one of two types,
exported for the engine schemas:
- CoreFloat = Annotated[float, Strict()]: any number (int, float, numpy
  scalar); a string, bytes or a boolean is a float_type error;
- CoreInt: a whole number (4 or 4.0, as JSON Schema's integer, numpy ints
  included); a string, bytes or a boolean is an int_type error, 4.5 an
  int_from_float error.
Covers parameter values and bounds, FitRange, XRDData arrays, Chebyshev
coefficients and num_coefficients, the unit cell, atom coordinates,
occupancy, Uiso, Uaniso and Multiplicity. Values that were accepted as
numbers keep their value; the JSON Schema is unchanged. metadata stays
free-form (A21). The legacy 0.26.0 schema is untouched.

Tests: every numeric field rejects "0.5", "1", true, false and accepts
int / numpy float / numpy int as a float; whole-number rules for both
integer fields; quoted numbers rejected from JSON. SCHEMA_HISTORY states
the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ror normal (A102)

`_monoclinic_unique_axis` looked only for a proper 2-fold, so
`cell_constraints` raised "could not determine the monoclinic unique axis"
for every setting of the mirror-only groups Pm, Pc, Cm and Cc (space groups
6-9, 41 gemmi settings) since v0.1.1. The unique axis is now the invariant
direction of det(R)*R for any operation with |trace| = 1: the 2-fold axis or
the mirror/glide normal. One shared helper for every cell rule (the re/03b
cell tie groups, re/04's coarse groups, re/05/re/06).

Deliberate change (devkit tasks/deliberate-changes.md #4): the legacy TOPAS
writer and the easydiffraction policy/builder no longer refuse these groups
early.

Tests: Pm/Pc/Cm/Cc and P2, P2_1/c, C2/c in a-, b- and c-unique settings and
other cell choices, plus every monoclinic setting in gemmi's table (115).

Assisted-by: claude-code:claude-opus-5-5
…ical space groups (A93-A96, A100, A105)

The core phase model is now one block: `Phase[P]`, `UnitCell[P]` and
`Atom[P]`, generic over the parameter type P (RefinableParameter, or
BoundedRefinableParameter for engines that honor bounds; one P for cell and
atoms, review N6). Every structural quantity (cell a..gamma; atom x, y, z,
occupancy, Uiso, U11..U23) is `[value, refine_flag]`; element, ADP, a stated
Multiplicity and the space group stay plain values. Engine schemas subclass
`Phase[TheirType]` and add their own fields flat (gsasii: scale,
peak_broadening).

- Value rules unchanged in substance, now on `.value` (A63, A69, A73,
  A76-A78); canonicalization replaces `.value` and keeps the flag and bounds.
- No null and no defaults (A96): occupancy is required; Multiplicity, Uiso and
  Uaniso may be left out but never null; a dump leaves them out, so it
  validates again.
- No phase_name: the phases dict key is the name (A100).
- `space_group` must be gemmi's canonical xhm() name exactly (A105); any other
  spelling is an error naming the canonical form (both settings / origins for
  a bare rhombohedral / two-origin symbol). New engine-free
  `symmetry.canonical_space_group`; the lenient resolve_space_group stays for
  the legacy paths.
- Reserved names: an engine subclass that redeclares space_group, unit_cell or
  atoms raises TypeError at class definition.
- `CoreModel` base + `CoreJsonSchema`: readable $defs names (`Atom`, not
  `Atom_RefinableParameter_`); qualified fallback if two parameter types ever
  share a document (devkit tasks/re03b-spike-generics.md).
- Removed: PhaseStructure, StructureRefinableParameter,
  StructureBoundedRefinableParameter and the null-value schema note (A71's
  structure part is superseded by A93/A96).

Flag and bound rules (F1-F4) follow in a later commit. Nothing at runtime
consumes the phase model yet; the legacy 0.26.0 schema is unchanged.

Tests: test_schema_core reworked by ID (17 Structure*-only tests and 14
Structure* numeric parametrizations removed, 22 test_phase_structure_* renamed
test_phase_*), plus new phase-block tests.

Assisted-by: claude-code:claude-opus-5-5
Assisted-by: claude-code:claude-sonnet-5-5
…ith affine relations (A94, A95, A98)

- `cell_tie_groups(space_group)`: which cell parameters are one parameter
  (cubic {a,b,c}; tetragonal/hexagonal {a,b},{c}; `:R` {a,b,c} and
  {alpha,beta,gamma}; monoclinic unique-axis angle via the A102 helper) and
  which angles are fixed. `cell_constraints` is unchanged and keeps its `:R`
  refusal for the legacy TOPAS/easydiffraction callers (deliberate change #2).
- `coupling_groups(space_group, xyz)`: coordinate and Uij tie groups at the
  canonical site, as connected components of the orthogonal projector onto
  the allowed subspace (the oblique Reynolds average gives wrong Uij groups on
  hexagonal axes). Each group exposes its exact relation `member = k*rep + c`:
  affine for coordinates, with `c` from the canonical values (P-42_1m 4e
  y = x + 1/2; P4_2/mnm y = -x + 1), linear for Uij (U12 = U22/2,
  U23 = -U13). Review B1.

Proof:
- engine-free, all 564 gemmi settings, every distinct special site on the
  1/24 grid (3,451): fixed sets match analyze_site; moving along any
  coordinate group's relation stays fixed by the whole stabilizer; a Uij
  tensor along any group's relation is invariant (2,792 coordinate groups);
- vs GSAS-II GetCSxinel/GetCSuinel, the 522 settings GSAS-II reads (2,928
  sites): partition, fixed set, one DOF per group and relation coefficients
  agree everywhere GSAS-II names the site; its 17 known defects (9 R-centred
  2-fold sites read as general, EB-40; 8 'sp' sites, EB-05) are listed and
  asserted to still differ (review S2);
- every gemmi setting: cell groups agree with the metric (a group moved
  together stays symmetric, one member alone or a fixed angle breaks it) and,
  off `:R`, with cell_constraints.

Assisted-by: claude-code:claude-opus-5-5
…A104, A106, A108)

The phase validator now checks refine flags and bounds against the symmetry
ties (cell_tie_groups, coupling_groups), after the values are valid and
canonical:
- F1: the members of one tie group carry the same flag. Reported at every
  member whose flag differs from the group's first member, naming the whole
  group (review N1), e.g. "cubic cell ('P m -3 m'): a, b, c are one
  parameter; set the same refine flag on all three".
- F2: a symmetry-fixed parameter has flag false; A106: and no bounds.
- F3: different groups are independent. A104: co-located atoms are never
  compared.
- F4 (with bounds): member bounds follow the tie from the first member's,
  affine for coordinates ([k*min + c, k*max + c], swapped for k < 0, open
  sides map to the matching side). A108: within the family's value tolerance
  (coordinates 5e-6, Uij 1e-6 A^2, cell CELL_TOL) the bounds are set exactly,
  with a `tied_bounds_adjusted` warning; beyond, an error at the member.
- Review N4: a value moved by canonicalization (A73/A78) is re-checked against
  its final bounds.

All problems are reported together in one ValidationError (A70), each at its
parameter (`unit_cell.b`, `atoms.<label>.y`, `atoms.<label>.Uaniso.U12`).

Tests: every crystal system incl. `:R` and Pm/Pc/Cm/Cc cells, special
positions, multi-group and negative Uij ties, affine ties at P-42_1m 4e and
P4_2/mnm 4f, open bounds, snapping vs errors, A106, N4, exact messages and
locations. The engine-import-block test now runs the new symmetry code and a
full phase validation with GSAS-II and easydiffraction blocked.

Assisted-by: claude-code:claude-opus-5-5
SCHEMA_HISTORY's core 1.0.0 entry now describes the phase block that replaced
the structure-only draft before release (noted as a pre-release revision, not
a new version): one block keyed by the phase name, every structural quantity a
parameter, no null and no defaults, gemmi's canonical space-group name (A105),
and refinement intent that follows the symmetry (tied members share a flag;
fixed parameters have flag false and no bounds; bounds follow affine ties,
snapped within tolerance; co-located atoms independent).

Assisted-by: claude-code:claude-opus-5-5
…hema and errors at the field

Review follow-up to item 4 of the re/03b record. `Uiso`/`Uaniso` were never
optional in effect (ADP selects exactly one), but the JSON Schema listed
neither as required and the pairing errors were reported at the atom, not at
the field.

- `Uaniso` is now a `UanisoTensor[P]` model with all six of U11..U23
  required: a missing or unknown component is reported at it
  (`atoms.<label>.Uaniso.U23`). Same JSON shape as before.
- The ADP check reports a missing selected parameter as `missing` and the
  other one, if given, as `extra_forbidden`, each at its own field
  (`atoms.<label>.Uiso`), with a message naming the ADP choice.
- The Atom JSON Schema states the rule: if ADP is "Uiso", Uiso is required
  and Uaniso forbidden; if "Uaniso", the reverse.
- Multiplicity is unchanged: derived, so optional; never null.

Tests: the six test_atom_adp_* tests keep their IDs and now pin location,
error type and message; new tests for the location inside a phase and the
schema rule. SCHEMA_HISTORY updated.

Assisted-by: claude-code:claude-opus-5-5
Core's space-group contract is gemmi's canonical names (A105), and the
symmetry rules (special positions, tie groups, unique axis) are characterized
against this gemmi version. A gemmi release that renames a symbol or changes
an operation would change which recipes are valid, so gemmi is widened only
deliberately, after the symmetry tests and the committed name list
(tests/data/canonical_space_groups.txt, next commit) are re-checked.

pixi.lock: only powderline's own requires_dist copy changes (gemmi 0.7.5 was
already the locked build); `pixi lock --check` reports it up to date.

Re/03b review B4.

Assisted-by: claude-code:claude-opus-5-5
…n; monoclinic symbols

Follow-ups from the independent re/03b review (maintainer answers 2026-10-07).

- Engine subclasses of Phase may not reuse a core validator, private
  attribute or method name (_space_group, _sites_check, _sites, _warnings,
  site, warnings). pydantic collects validators by name, so a same-named
  engine validator silently replaced core's: e.g. a gsasii `_space_group`
  check let "Pm-3m" through, and overriding `_sites_check` dropped every
  symmetry, flag and bound rule. A subclass must also keep extra='forbid'
  (A19). Both raise TypeError when the subclass is defined. (Review A1.)
- Atom labels (and, through the exported CoreName, engine phase names) follow
  one rule every engine can use: an ASCII letter, then ASCII letters, digits
  or '_'. Evidence: GSAS-II renames a phase with surrounding spaces or
  non-ASCII characters and the parameterization then skips it silently;
  easydiffraction rejects any other atom label; TOPAS writes the names into
  its input; phase names become report file names; field paths are
  '.'-joined. check_names_unique_ignoring_case() is for engine payloads'
  phase names (case-insensitive file systems). JSON Schema states the rule
  as propertyNames. (Review C6.)
- In engines with bounds, a stated cell bound must lie where the parameter
  exists: a length's min > 0, an angle's min/max strictly between 0 and 180;
  null still means no bound. (Review C5.)
- A short monoclinic symbol ("P21/c", "C2/m") states neither the unique axis
  nor the cell choice; the error now lists every setting of that space group
  by unique axis instead of suggesting gemmi's silent pick. (Review B3.)
- tests/data/canonical_space_groups.txt pins gemmi's 564 canonical names; a
  test fails if the installed gemmi differs. (Review B4.)
- SCHEMA_HISTORY: the name rule, the bound domain, the monoclinic message and
  the pinned name list.

Suite (default env): see the devkit record.

Assisted-by: claude-code:claude-opus-5-5
… parameter type

Second round of the re/03b review follow-ups (maintainer answers 2026-10-07).

- A115, validation never changes a recipe. The recipe is the record of the
  refinement intent, so validation only accepts or rejects. A value that is
  near the exact one but not equal to it (to floating-point precision) is an
  error that gives the value to write:
  - a special position within 5e-6 (was: replaced by the exact values,
    A73); the 5e-6..2e-3 band error is unchanged;
  - a Uaniso within 1e-6 A^2 of symmetric (was: adjusted, A78);
  - tied bounds near the mapped ones (was: snapped, A108).
  The suggestion keeps each tie group's first member as stated and derives
  the others ("write y = 0.2468", "write U12 = 0.0061735"); fixed values are
  exact. Every value is the repr of the float, so "0.3333333333333333" for
  1/3. N4 is moot. Phase.warnings() and the codes special_position_adjusted,
  adp_symmetry_adjusted and tied_bounds_adjusted are removed. None of the
  67 atoms in the committed examples is affected.
- A114, a phase model needs its parameter type. An engine subclass that
  forgets [P] is a TypeError when it is defined, unless it declares
  Generic[P]. Validating with an open type is a TypeError. Unparametrized,
  one phase could mix [value, flag] and [value, flag, min, max], and F4 then
  crashed.
- A112 amended: names are also not Python keywords and are at most 64
  characters (phase names become file names).
- Tests: removed test_bounded_phase_canonicalization_keeps_flag_and_bounds
  and the two N4 tests. Renamed the adjust/snap tests to *_not_exact_rejected,
  test_tied_cell_bounds_equal_exactly and
  test_phase_holds_the_callers_atoms_unchanged. Added tests for the A114
  guards and the keyword and length rules.
- SCHEMA_HISTORY: exactness, suggested values, the 1/3 spelling, names.

Assisted-by: claude-code:claude-opus-5-5
… (A118)

A Uaniso whose symmetric matrix has a principal value <= 0 describes no
thermal ellipsoid. Like a negative Uiso (A111), it can show that the
parameter compensates for something the model lacks, so it is accepted as
stated. It gets a structured warning, uaniso_not_positive_definite, at
atoms.<label>.Uaniso.

The sign test needs no cell: the Cartesian tensor is a congruence transform
of the Uij matrix (Sylvester's law of inertia). Phase.warnings() returns, for
informative findings only. The warning never comes with a changed value
(A115), so validating the same recipe again gives the same warning.

GSAS-II 5.7.9 has no such check (devkit EB-50).

Assisted-by: claude-code:claude-opus-5-5
…tly (A120)

This refines A115, following the maintainer's rule. A value that has an
exact decimal form is written exactly: 0.5, 0.25, 0.125, coupled
coordinates such as y = 2x, every Uij relation and every cell tie.
0.4999999 is an error ("write 0.5").

A value with no exact decimal form cannot be written exactly. It is stated
to at least 6 decimals (within A73's 5e-6) and read as the exact value. In
crystallographic symmetry this always means a third: 0.333333 = 1/3,
0.166667 = 1/6, or a coupled member y = x + 1/3 and its bounds. This was
checked over all 564 settings and every distinct special site: fixed
denominators are 1, 2, 3, 4, 6, 8 and 12; tie factors are +-1, +-2 and
+-1/2; offset denominators are 1 to 4; Uij offsets are 0.

- The rule is applied per coordinate, from the stated tie-group
  representative, which is never changed.
- The reading carries no warning: it is the documented meaning of the
  recipe. A dump (0.3333333333333333) means the same thing and validates the
  same way.
- The caller's atom is untouched; the phase holds a copy.
- The 5e-6..2e-3 band error is unchanged.
- Errors give the values to write: exact values with repr; thirds to 6
  decimals.

Assisted-by: claude-code:claude-opus-5-5
…/3 in full (A120)

Option A of A120, chosen by the maintainer. The validated model holds the
float nearest 1/3, so tie relations hold exactly and every engine starts from
the same structure. The user's file is never rewritten. Only a Python dump of
the model shows 0.3333333333333333, which is the same value.

Assisted-by: claude-code:claude-opus-5-5
…band message to 6 decimals

re/03b PR review S5 and N3.

- SiteAnalysis.canonical is the stated position moved onto the special
  position by the least (orthogonal) change. It is used to find the
  stabilizer and the tie offsets. It is not what the engines receive: the
  validated core Phase holds those coordinates (A120), and keeps a tie
  group's first member as stated where canonical may move it (by ~1e-7 at a
  y = x + 1/3 tie). The docstring said gateways use it.
- The ambiguous-band message printed the nearby special position's free
  coordinates with .6g, which gives fewer than 6 decimals once |x| >= 1. It
  now prints 6 decimals.

Assisted-by: claude-code:claude-opus-5-5
…rs (A121-A123)

Fixes from the re/03b PR review, as decided by the maintainer. They share
the functions of Phase's validation, so they are one commit.

One rule for symmetry-determined values (A121, option B; S1, S3, Q1, N1-N3,
N7). The first member of each tie group is the independent parameter, kept
exactly as stated. Every other value is derived from the space group and
those parameters in exact rational arithmetic (Fraction), rounded once, and
the validated model holds the derived value, so every tie holds exactly.
How closely the recipe must state a derived value:
- a constant of the site (a fixed coordinate, a Uij fixed at 0) with a
  decimal form exactly (0.5, not 0.4999999; 0, not 1e-9); a third to at
  least 6 decimals (A120, unchanged);
- a value derived from another stated value (a coupled coordinate or Uij,
  a tied member's bounds) within its family's tolerance, coordinates 5e-6
  (A73) and Uij 1e-6 A^2 (A78), read as the derived value.
The ideal C14 6h position (0.833333, 0.666667, 1/4), y = 2x - 1, was an
error ("write y = 0.666666"); it is now read. A third written to 13 digits
is held as 1/3. A value and its bounds are derived together, so a value at
its bound stays within it. One message per parameter set gives the values
derived from the first member, and names equal ties (z = y, U22 = U11).
docs/SCHEMA_HISTORY.md shows users the rule as a table of cases.

Cell (A123; S4). Checked from its tie groups within A77's CELL_TOL (1e-9,
kept), with the metric check behind it. The model holds the first member's
values and exact fixed angles (b = a exactly). The error states the stated
values and the values to write (repr, not %g).

Engine phase guard (A122; S2, N5). A mixin placed before Phase[P] could
replace _space_group or _sites_check silently, and a 'wrap' validator could
skip core. Now:
1. no class in the MRO besides core's own, mixins included, may redeclare a
   core field, reuse a core name, or define a pydantic entry point;
2. every core validator must still be core's own function;
3. an engine's own validators are 'after' validators on core fields and the
   model (a 'before' one could rewrite the recipe before core reads it);
4. tests/test_phase_canary.py runs core's must-fail recipes and a valid
   recipe through every engine phase model (re/04-06 register theirs) and
   re-runs the structural guard on each.
The parameter type must be RefinableParameter or BoundedRefinableParameter
(Phase[float] is a TypeError).

Also:
- the uaniso_not_positive_definite warning gives the Cartesian principal
  mean-square displacements; a near-zero one counts as 0 (A118 amended;
  N4);
- atom labels must differ by more than case (A112 amended; N8).

Tests: 3 renamed (behaviour changed), 6 updated, 38 new IDs; none removed.
Default suite 1518 passed, 4 skipped; easydiff 55 passed. The fuzz over all
564 settings and translates (10,353 sites) gives 0 rejections and the exact
derived float in every case.

Assisted-by: claude-code:claude-opus-5-5
…ema 1.0.0)

- gateways/gsasii/schema.py (engine-free): recipes on CoreRecipe, the phase
  GsasiiPhase(Phase[RefinableParameter]) with scale and peak_broadening flat
  (A93), the single-source instrument blocks (A99, A103), background and
  Peak List peaks; RefinableParameter only, no bounds (A84).
- GSAS-II rules: space-group settings GSAS-II reads as themselves (canonical
  name -> GSAS-II symbol; :1 and 9 unreadable settings refused, EB-03,
  EB-41); GSAS-II cell refinement groups (A95); SH/L >= 0.002 (A91);
  background-peak and Peak List floors (A86, A90); simulation refines
  nothing (A88); scale >= 0; phase names unique ignoring case (A112).
- Documented defaults (A119): size/strain left out = 10 um / 0 with a
  structured warning (A87, A107); background left out = one fixed 0.0 term.
- Version declarations ==1.0.0 in capabilities() (A65, A81).
- schema_core.collect_warnings: a validated model's structured warnings with
  full field paths (A115).
- gsasii_iparm1: GSAS-II's Iparm1 built from the instrument block.
- validate() / the gateway route gsasii.* recipes to the native schema;
  GSASII_* recipes keep the legacy validation until re/07.
- Tests: schema rules (77); the space-group translation and cell groups
  proven against GSAS-II for all 564 canonical names (1054); canary
  registration (A122); import-block test validates a native recipe.

Assisted-by: claude-code:claude-opus-5-5
Assisted-by: claude-code:claude-sonnet-5-5
…er re/04)

gateways/gsasii/_legacy_executor.py holds byte-identical copies, taken at
2810c82, of every function the re/04 frozen-edits ledger touches (R1-R10),
and of every function on the 0.26.0 path from run_refinement that calls one
of them (18 functions + SCHEMA_EXECUTORS). The functions it imports are
unedited and shared. So a GSASII_* recipe runs only unedited code and the
before/after-refactor comparison stays exact (maintainer, ledger sign-off
2026-10-08). Generated, not edited; deleted with the 0.26.0 schema in re/07.

Not yet called: routing to it lands with the ledger edits. Added to the
code-hash manifest (script, tripwire test, _code_hash.json).

Assisted-by: claude-code:claude-opus-5-5
Input-side edits to the frozen gateway, signed by the maintainer 2026-10-08
(devkit tasks/re04-frozen-edits.md). Only recipe reads change; nothing GSAS-II
does to the project changes:
- R1 run_refinement takes the native model: Iparm1 built from the instrument
  blocks (gsasii_iparm1), fit_range from the core model, getattr for the
  workflow-specific single_peaks/phases, the instrument dumped whole,
  'gsasii.spf' check, SCHEMA_EXECUTORS gains the native names;
- R2 instrument setter reads radiation.wavelength and
  corrections.polarization (the corrections loop skips polarization);
- R3/R5 the phase block itself (A93), name = dict key (A100);
- R4 [value, flag] values; canonical name -> GSAS-II symbol (A105, EB-41);
- R6-R8 unpack_refinement_parameter reads [value, flag] too, the 6 bare
  unpacks + background peaks use it, has_active_refinement_parameter counts
  2-element lists (else atom refinement was silently skipped);
- R9 background peaks read pv_gaussian_sigma_sq (A89);
- R10 extractor reads use getattr.

Routing (gateways/gsasii/routing.py): kicker.run_refinement sends a native
model to executors.run_refinement and a 0.26.0 RecipeModel to the verbatim
legacy copy; the server and the client's in-process fallback validate a
received dict with the matching schema.

Tests: test_run_refinement_missing_keys runs every case on both executors.
Default suite 2673 passed, 4 skipped; every 2810c82 baseline test passes
(the 21 retargeted ones in both modes); regression references untouched.

Assisted-by: claude-code:claude-opus-5-5
Assisted-by: claude-code:claude-sonnet-5-5
scripts/convert_recipe_026.py states explicitly what v0.1.1 refined and
reports every change: structure + parameterization merged into one phase
block (the parameterization value won), refine flags expanded to the symmetry
and GSAS-II cell groups v0.1.1 refined together (A95), symmetry-fixed flags
false, ADP type/flags as GSAS-II used them, v0.1.1's silent defaults written
out, Multiplicity dropped where it disagrees (A101), space group to the
canonical name as GSAS-II read it (A105), instrument blocks from Iparm1 +
parameterization (A103), SH/L to GSAS-II's 0.002 floor (A91),
pv_gaussian_sigma -> pv_gaussian_sigma_sq (A89), bounds dropped (A84).
Anything the gsasii schema rejects stops the conversion with every problem
listed; nothing is fixed silently. The symmetry rewriting stays private to
the converter (A124). Engine-free.

Tests (43): one per rule, both ADP-switch directions, GSAS-II's reading of
every example's symbol, and every committed example (LaB6 and
LaB6_simulation stop on the background-peak gamma floor, example_template on
its placeholder instrument).

Equivalence (devkit probe re04_equivalence_probe.py): for 8 examples the
legacy path on the edited 0.26.0 recipe and the native path on its
conversion give identical Rwp, ycalc and refined values.

Assisted-by: claude-code:claude-opus-5-5
Assisted-by: claude-code:claude-sonnet-5-5
Regenerated from 2810c82 by the same call-graph closure: adds verbatim
execute_spf_refinement (R12), export_refined_parameters_csv,
_extract_fit_profile (R14) and their caller _extract_refined_parameters, so a
0.26.0 recipe still runs only unedited code (21 functions +
SCHEMA_EXECUTORS; the 22 names it imports are byte-identical to 2810c82).
Code-hash manifest updated.

Assisted-by: claude-code:claude-opus-5-5
GSAS-II misreads some orientations of the 2-fold sites in R32, R-3m and R-3c
(:H): it calls them general with double the multiplicity, which gives 4x the
Bragg intensity with nothing refined (EB-40; devkit probe
re04_eb40_orientation_probe.py). Some sites it cannot name ('sp'), and then
refining a coordinate or Uaniso crashes its constraint setup (EB-05).

- core symmetry.orbit(space_group, xyz): the equivalent positions in gemmi's
  operation order, reduced to [0, 1), one per position (engine-free);
- gateways/gsasii/sites.py: after add_phases_from_dict, each atom's GSAS-II
  (site_sym, mult) is compared with core's multiplicity; a mismatch, or 'sp'
  with a refined coordinate/Uaniso, is an EngineExecutionError naming the
  first orbit member GSAS-II reads correctly (never a silent substitution);
- executors.run_refinement calls it (native path only; one line, signed).

Tests land with the batch-2 run tests (tests/test_gsasii_native_run.py).

Assisted-by: claude-code:claude-opus-5-5
… writers (ledger R11, R12, R14)

Signed by the maintainer 2026-10-08 (devkit tasks/re04-frozen-edits.md,
batch 2); native path only, the 0.26.0 path runs the verbatim legacy copy.

- R11 gateways/gsasii/fit_report.py, merged into run_refinement's result:
  rwp, r_exp, gof, chi2_red from core fitstats over the fit window (A23,
  A125); engine_details with GSAS-II's own Rwp, GOF (sqrt of reduced chi^2 in
  a Rietveld refinement, EB-52), chi2, Nobs, parameters_requested (one per
  refined symmetry tie group) and parameters_varied (Rvals Nvars, which counts
  parameters GSAS-II then drops, EB-33; Peak List sigDict for SPF); GSAS-II's
  refinement message (EB-32) as a structured warning.
- R12 execute_spf_refinement: refine_peaks' bare TypeError when DoPeakFit
  fails becomes a clear EngineExecutionError (EB-38).
- R14 (A83, native only): the refined-parameters, fit-profile, unit-cell and
  peak-list tails write through core reports writers, cells formatted as
  to_csv did (gateways/gsasii/report_rows.py); files byte-identical to the
  legacy path's on 8 examples (devkit tasks/re04-equivalence-batch2.json).
- kicker.run: a native recipe's validation warnings are collected once and
  carried to the result ahead of the run's; the validate_only summary reports
  core/engine schema versions and warnings.
- server: the response model carries the new keys (they were dropped in
  server mode); a 0.26.0 result still has none of them.
- docs/SCHEMA_HISTORY.md: the gsasii 1.0.0 section.
- Tests: tests/test_gsasii_native_run.py (statistics, engine details,
  warnings, validate_only, refined zero/polarization/SH-L are varied, EB-40
  and EB-05 site errors naming a working position, orbit, EB-38, SPF);
  server response model; mock tests patch the new readers.

Assisted-by: claude-code:claude-opus-5-5
AGENTS.md is the tool-neutral guidance (NSLS-II convention), without the
maintainers' private paths and design-record ids, plus the working rules
for coding agents (human review, unsigned commits on feature branches,
Assisted-by trailers, no secrets). CLAUDE.md only imports it.

Assisted-by: claude-code:claude-opus-5-5
Two input-guidance sections:
- what each engine does with ionic scattering types, with PowderLine's
  response and the edge cases (O2- is not portable to easydiffraction;
  with_block carries the whole phase);
- how a disordered atom near a special position is read by each engine
  against what PowderLine does, what happens during a refinement, and
  how to write a split site.
KI-17 (split-site occupancy unchecked) and KI-18 (a coordinate refined
into the ambiguous band) registered; KI-16 records the first TOPAS 6
session.

Assisted-by: claude-code:claude-opus-5-5
From upstream PR NSLS2#12, adapted to 0.2.0:
- CITATION.cff references: GSAS-II (2013, scripting interface 2018),
  TOPAS (2018), easydiffraction 0.21.1 (zenodo.22905049, the release
  record), CrysPy (Phys. Rev. Research 2019), CrysFML2008, gemmi (JOSS
  2022); README section and docs/citing.md
- input-guidance: a nine-step 'Building a recipe' workflow, the
  no-builder rationale extended, and the unsupported list completed
  (Pawley/Le Bail, restraints, magnetic, extinction, minimizer choice)
- getting-started: the standard-uncertainty note
The 0.26.0 recipe guide, capabilities page and recipe helpers are not
ported (they describe the old schema).

Assisted-by: claude-code:claude-opus-5-5
…on references

- example_LaB6, _LaB6_simulation, _LaB6_singlepeakfit, _DRX_33_simulation
  and _DRX_33_strainonly gain output_recipe.json and
  parameter_dispositions.csv; every pre-existing reference file was
  reproduced byte for byte first (singlepeakfit's recipe is invalid as
  posed, KI-15)
- examples/<case>/easydiffraction/output/ for LaB6, DRX_33, the ionic and
  textured examples and the temperature series' first step
- regression tests: committed output recipes validate (or are invalid
  where KI-15 says so); a fresh run matches them within the regression
  tolerances; the easydiffraction references agree with the goldens

The three other DRX_33 references reproduce only within tolerance on
this build, so they get no new files here.

Gates: core 1761 / 22; gsasii 1485 / 3; easydiffraction 100 / 13.

Assisted-by: claude-code:claude-opus-5-5
- 0.2.0 opens with Highlights and Upgrading, then Added / Changed /
  Removed / Fixed / Security in short user-facing bullets; the schema
  split (core + one schema per engine, each at 0.1.0) is stated; compare
  links; known limitations link known_issues.md
- CITATION.cff: version 0.2.0, released 2026-11-04; CrysFML cited as in
  the literature (CompComm Newsletter 1, 2003) beside the software entry
- CONTRIBUTING: how to add a changelog entry
Bullets for the TOPAS work still in progress carry verify markers.

Assisted-by: claude-code:claude-opus-5-5
Added from this build without touching the older reference files, which
reproduce here only within the regression tolerances (phase-angle sign
flips 180/-180, last-digit drift). All three are invalid as posed
(KI-15). The regression test covers all eight older references now.

Assisted-by: claude-code:claude-opus-5-5
…by version

From two sessions on a TOPAS 6 machine:
- scattering_types accepted (TOPAS 6's 113 ions; written as occ La+3);
  La3+/La intensity ratios agree with GSAS-II within 0.07 %
- preferred_orientation accepted (the PO macro; fixed or refined, stated
  bounds or TOPAS's default lower limit 0.0001); per reflection equal to
  GSAS-II's March-Dollase correction; r = 0.6 recovered as 0.5982(14)
- a negative TCHZ Lorentzian width over the fit window is a validation
  error (TOPAS computes it silently or writes no results)
- a non-ANSI output folder is run through its 8.3 short path, or refused
  before tc.exe starts
- the at-limit warning allows for TOPAS stopping just past a bound or a
  window edge
- supported versions are an explicit tuple; goldens move to golden/6/
  (byte-identical); a cell-refined LaB6 golden from the TOPAS machine
- tests/test_topas_exec.py runs every golden fixture and the ionic and
  textured legs through a real tc.exe when POWDERLINE_TOPAS_DIR and
  POWDERLINE_TOPAS_VERSION are set
- topas legs for example_LaB6_ionic and example_LaB6_textured

Gates: core 1820 / 23; test-topas 277 / 31 (exec tests skip here);
gsasii 1488 / 3; fields-check and docs -W clean.

Assisted-by: claude-code:claude-opus-5-5
On the release code with TOPAS 6, every topas_exec test passed: all golden
fixtures reproduced, and the ionic and textured legs. The example TOPAS
recipes ran through the CLI, and the GSAS-II and easydiffraction suites
passed on the same Windows machine. KI-16 is resolved, the support matrix
says TOPAS execution is verified on TOPAS 6, and the CHANGELOG bullet
stands.

Assisted-by: claude-code:claude-opus-5-5
- the background-only tc.exe run stopped at topas_timeout leaves y_bkg
  empty with topas_background_not_calculated instead of failing the run
- the declared installed TOPAS version must be a supported release as
  written ("6"; "6.0" is refused), like a recipe's engine_version
- the TCHZ rule refuses only a total (Thompson-Cox-Hastings) width that
  is not positive in the fit window (topas_tchz_width_not_positive); a
  negative Lorentzian part with a positive total runs as written, as
  TOPAS 6 computes it
- clearer wording of the PO macro's default maximum

Assisted-by: claude-code:claude-opus-5-5
Scripts' printed text, the docstrings docs/api.rst publishes, the
tests/data READMEs and AGENTS.md (devkit named in general terms;
generate-only wording; test-topas and fields-check). run() documents
topas_timeout.

Assisted-by: claude-code:claude-opus-5-5
Comments and docstrings only (AST unchanged); code hash regenerated.
Restart the GSAS-II server after this commit.

Assisted-by: claude-code:claude-opus-5-5
Also KI-16, support matrix, engine versions, the textured TOPAS README,
the CrysFML author spelling, and private ids out of the committed
cross-engine record.

Assisted-by: claude-code:claude-opus-5-5
ionic, textured and temperature series: provenance gains engine and
engine_version; every table reproduced byte for byte. The ionic
example's metadata text drops a private id and names all three engines.

Assisted-by: claude-code:claude-opus-5-5
GetShortPathNameW also shortened the file name, and TOPAS names its own
.out after the name it is given: a run in a Greek-named folder left
TOPAS_~1.out beside topas_bkg.inp (TOPAS 6, session 3). The folder is
shortened and the ASCII file name kept.

Assisted-by: claude-code:claude-opus-5-5
Upstream's changes are already on this branch in their 0.2.0 form (pixi >= 0.82.1, CI on pixi v0.83.0, the lock update, citations, the s.u. note); the 0.26.0-era recipe-building pages are superseded by docs/input-guidance.md and are not shipped.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Substantial cell shifts in the GSAS-II atom-refinement references require maintainer confirmation of private devkit equivalence and frozen-module sign-off records, plus engine-run evidence.

No open issues 🎉

What changed in this PR

PowderLine 0.2.0 replaces cross-engine recipe translation with engine-native recipes selected through schema_name. A shared API and CLI route recipes to GSAS-II, TOPAS, or easydiffraction gateways, with engine-free validation and standardized results.

Changes:

  • Introduces native gateways, core and engine schemas, updated public exports, and packaging.
  • Adds coverage for engine isolation, warnings, failure artifacts, reporting, scattering, and output recipes.
  • Replaces legacy fixtures and updates examples, regression references, and integration documentation.

Review note — nit (1 vote): .powderline_config.yaml.example:33 incorrectly labels GSAS-II CW Zero in centidegrees. The engine uses degrees 2θ and receives the value unchanged: 0.1 produces a 0.1° shift, not 0.001°. Restore the degree annotation and align the corresponding zero_shift schema/unit documentation.

This pull request is too complex or risky for automated approval.

File Description
tests/​test_warning_codes.py Checks warning registry, emissions, and documentation consistency.
tests/​test_status.py Marks status tests as engine-free.
tests/​test_simulation_builder_gsasii.py Adds GSAS-II simulation-builder integration coverage.
tests/​test_gsasii_report_rows.py Checks pandas-compatible CSV formatting.
tests/​test_gsasii_fit_report_divergence.py Tests aborted-refinement detection.
tests/​test_gsasii_failed_run_artefacts.py Tests failure artifacts and stale-output cleanup.
tests/​test_gen_schema_field_tables.py Tests generated-table diagnostics.
tests/​test_gateways_installed_engines.py Checks installed engine versions against gateway specifications.
tests/​test_examples_validate.py Validates shipped examples and the getting-started recipe.
tests/​test_easydiffraction_scattering.py Tests ionic scattering against GSAS-II reference ratios.
tests/​test_easydiffraction_output.py Tests output-recipe parameter mapping.
tests/​test_easydiff_integration.py Removes legacy translated-recipe integration tests.
tests/​test_easydiff_dispatch.py Removes legacy engine= dispatch tests.
tests/​test_core_guard.py Tests engine-free import and execution guards.
tests/​test_constraints_mapping.py Updates imports and GSAS-II suite classification.
tests/​symmetry_sites.py Adds a special-site enumeration helper.
tests/​intensity_ratio.py Adds shared intensity and preferred-orientation calculations.
tests/​data/​topas/​native/​po/​README.md Documents preferred-orientation fixture provenance.
tests/​data/​topas/​native/​po/​po_free_reference_results.csv Adds preferred-orientation refinement results.
tests/​data/​topas/​native/​ions/​README.md Documents ionic-scattering fixture provenance.
tests/​data/​topas/​native/​golden/​6/​ties_simulation__snapped_results.csv Adds tied-cell simulation reference results.
tests/​data/​topas/​native/​golden/​6/​ties_simulation__snapped_bkg.inp Adds tied-cell simulation background input.
tests/​data/​topas/​native/​golden/​6/​lab6_spf__snapped_bkg.inp Adds single-peak-fit background input.
tests/​data/​topas/​native/​golden/​6/​lab6_rietveld__snapped_results.csv Adds LaB6 Rietveld reference results.
tests/​data/​topas/​native/​golden/​6/​lab6_rietveld__snapped_bkg.inp Adds LaB6 Rietveld background input.
tests/​data/​topas/​native/​golden/​6/​lab6_pv_full_axial__snapped_results.csv Adds full-axial profile reference results.
tests/​data/​topas/​native/​golden/​6/​lab6_pv_full_axial__snapped_bkg.inp Adds full-axial background input.
tests/​data/​topas/​native/​golden/​6/​lab6_corrections__snapped_results.csv Adds instrument-correction reference results.
tests/​data/​topas/​native/​golden/​6/​lab6_corrections__snapped_bkg.inp Adds instrument-correction background input.
tests/​data/​topas/​native/​golden/​6/​lab6_cell_rietveld__snapped_results.csv Adds refined-cell reference results.
tests/​data/​topas/​native/​golden/​6/​lab6_cell_rietveld__snapped_bkg.inp Adds refined-cell background input.
tests/​data/​topas/​native/​golden/​6/​drx33_rietveld__snapped_results.csv Adds two-phase DRX_33 reference results.
tests/​data/​topas/​native/​golden/​6/​drx33_rietveld__snapped_bkg.inp Adds two-phase DRX_33 background input.
tests/​data/​topas/​LaB6_topas_peaks.txt Removes the legacy translated-path peak fixture.
tests/​data/​topas/​example_LaB6_topas_profile.txt Removes the legacy profile fixture.
tests/​data/​topas/​example_LaB6_results.csv Removes the legacy LaB6 result fixture.
tests/​data/​topas/​example_DRX_33_results.csv Removes the legacy DRX_33 result fixture.
tests/​data/​ions/​README.md Documents shared ionic-scattering references.
tests/​data/​ions/​lab6_la3_over_la_gsasii.json Adds GSAS-II ionic intensity ratios.
tests/​data/​convert_026/​README.md Documents retained migration fixtures.
src/​powderline/​topas/​errors.py Removes the legacy TOPAS translation exception.
src/​powderline/​topas/​__init__.py Removes legacy TOPAS package exports.
src/​powderline/​gateways/​topas/​scattering.py Adds supported TOPAS ions and spelling conversion.
src/​powderline/​gateways/​topas/​peak_list.py Relocates TOPAS reflection-list parsing.
src/​powderline/​gateways/​topas/​__init__.py Documents the native TOPAS gateway.
src/​powderline/​gateways/​gsasii/​scattering.py Adds supported GSAS-II ions and spelling conversion.
src/​powderline/​gateways/​gsasii/​routing.py Adds executor and request-model routing.
src/​powderline/​gateways/​gsasii/​report_rows.py Formats report rows for core CSV writers.
src/​powderline/​gateways/​gsasii/​constraints.py Removes legacy schema numbering from documentation.
src/​powderline/​gateways/​gsasii/​__init__.py Documents lazy runtime-import requirements.
src/​powderline/​gateways/​easydiffraction/​scattering.py Adds supported CrysPy ionic-scattering types.
src/​powderline/​gateways/​easydiffraction/​gateway.py Adds validation, version checks, and runtime delegation.
src/​powderline/​gateways/​easydiffraction/​__init__.py Documents the native easydiffraction gateway.
src/​powderline/​gateways/​__init__.py Adds the gateway package namespace.
src/​powderline/​engine.py Removes legacy engine= dispatch.
src/​powderline/​easydiff/​errors.py Removes the legacy translation exception.
src/​powderline/​easydiff/​conversions.py Removes cross-engine conversion utilities.
src/​powderline/​easydiff/​__init__.py Removes legacy easydiffraction adapter exports.
src/​powderline/​_code_hash.json Records hashes for frozen GSAS-II gateway modules.
src/​powderline/​__init__.py Publishes the 0.2.0 API and exception exports.
scripts/​update_code_hash.py Updates hashing for frozen gateway modules.
pyproject.toml Registers gateways and CLI; updates dependencies and test markers.
examples/​example_template/​DESCRIPTION.md Updates template instructions and output documentation.
examples/​example_LaB6/​topas/​README.md Documents the native TOPAS LaB6 recipe.
examples/​example_LaB6/​output/​topas/​refined_parameters.csv Removes the legacy TOPAS parameter reference.
examples/​example_LaB6/​output/​topas/​LaB6_unit_cell_report.csv Removes the legacy TOPAS cell reference.
examples/​example_LaB6/​output/​topas/​example_LaB6_results.csv Removes legacy TOPAS raw results.
examples/​example_LaB6/​output/​topas/​example_LaB6_prms.csv Removes legacy TOPAS iteration output.
examples/​example_LaB6/​output/​parameter_dispositions.csv Adds the GSAS-II parameter-disposition reference.
examples/​example_LaB6/​easydiffraction/​README.md Documents the native easydiffraction LaB6 recipe.
examples/​example_LaB6/​easydiffraction/​output/​refined_parameters.csv Adds the easydiffraction parameter reference.
examples/​example_LaB6/​easydiffraction/​output/​parameter_dispositions.csv Adds the easydiffraction disposition reference.
examples/​example_LaB6/​easydiffraction/​output/​LaB6_unit_cell_report.csv Adds the easydiffraction cell reference.
examples/​example_LaB6_textured/​topas/​README.md Documents TOPAS March–Dollase refinement.
examples/​example_LaB6_textured/​output/​refined_parameters.csv Adds the textured GSAS-II parameter reference.
examples/​example_LaB6_textured/​output/​parameter_dispositions.csv Adds the textured GSAS-II disposition reference.
examples/​example_LaB6_textured/​output/​LaB6_unit_cell_report.csv Adds the textured GSAS-II cell reference.
examples/​example_LaB6_textured/​easydiffraction/​README.md Documents CrysPy preferred-orientation conventions.
examples/​example_LaB6_textured/​easydiffraction/​output/​refined_parameters.csv Adds the textured easydiffraction parameter reference.
examples/​example_LaB6_textured/​easydiffraction/​output/​parameter_dispositions.csv Adds the textured easydiffraction disposition reference.
examples/​example_LaB6_textured/​easydiffraction/​output/​LaB6_unit_cell_report.csv Adds the textured easydiffraction cell reference.
examples/​example_LaB6_textured/​data/​truth.json Records synthetic texture and noise parameters.
examples/​example_LaB6_temperature_series/​output/​thermal_expansion_fit.json Adds the fitted thermal-expansion reference.
examples/​example_LaB6_temperature_series/​output/​steps/​500C_refined_parameters.csv Adds the 500 °C parameter reference.
examples/​example_LaB6_temperature_series/​output/​steps/​500C_LaB6_unit_cell_report.csv Adds the 500 °C cell reference.
examples/​example_LaB6_temperature_series/​output/​steps/​405C_refined_parameters.csv Adds the 405 °C parameter reference.
examples/​example_LaB6_temperature_series/​output/​steps/​405C_LaB6_unit_cell_report.csv Adds the 405 °C cell reference.
examples/​example_LaB6_temperature_series/​output/​steps/​310C_refined_parameters.csv Adds the 310 °C parameter reference.
examples/​example_LaB6_temperature_series/​output/​steps/​310C_LaB6_unit_cell_report.csv Adds the 310 °C cell reference.
examples/​example_LaB6_temperature_series/​output/​steps/​215C_refined_parameters.csv Adds the 215 °C parameter reference.
examples/​example_LaB6_temperature_series/​output/​steps/​215C_LaB6_unit_cell_report.csv Adds the 215 °C cell reference.
examples/​example_LaB6_temperature_series/​output/​steps/​120C_refined_parameters.csv Adds the 120 °C parameter reference.
examples/​example_LaB6_temperature_series/​output/​steps/​120C_LaB6_unit_cell_report.csv Adds the 120 °C cell reference.
examples/​example_LaB6_temperature_series/​output/​steps/​025C_refined_parameters.csv Adds the 25 °C parameter reference.
examples/​example_LaB6_temperature_series/​output/​steps/​025C_LaB6_unit_cell_report.csv Adds the 25 °C cell reference.
examples/​example_LaB6_temperature_series/​output/​series_report.csv Adds the chained-refinement summary reference.
examples/​example_LaB6_temperature_series/​easydiffraction/​README.md Documents the easydiffraction temperature-series workflow.
examples/​example_LaB6_temperature_series/​easydiffraction/​output/​refined_parameters.csv Adds the first-step easydiffraction parameter reference.
examples/​example_LaB6_temperature_series/​easydiffraction/​output/​parameter_dispositions.csv Adds the first-step easydiffraction disposition reference.
examples/​example_LaB6_temperature_series/​easydiffraction/​output/​LaB6_unit_cell_report.csv Adds the first-step easydiffraction cell reference.
examples/​example_LaB6_singlepeakfit/​topas/​README.md Documents the native TOPAS single-peak recipe.
examples/​example_LaB6_singlepeakfit/​output/​topas/​refined_parameters.csv Removes the legacy TOPAS parameter reference.
examples/​example_LaB6_singlepeakfit/​output/​peak_convergence_diagnostics.txt Removes the previous convergence-diagnostic reference.
examples/​example_LaB6_simulation/​output/​parameter_dispositions.csv Adds simulation parameter dispositions.
examples/​example_LaB6_simulation/​output/​LaB6_unit_cell_report.csv Records zero ESDs for fixed simulation cells.
examples/​example_LaB6_simulation/​output/​dummy.lst Updates the migrated simulation log reference.
examples/​example_LaB6_ionic/​topas/​README.md Documents native TOPAS ionic scattering.
examples/​example_LaB6_ionic/​output/​refined_parameters.csv Adds the ionic GSAS-II parameter reference.
examples/​example_LaB6_ionic/​output/​parameter_dispositions.csv Adds the ionic GSAS-II disposition reference.
examples/​example_LaB6_ionic/​output/​LaB6_unit_cell_report.csv Adds the ionic GSAS-II cell reference.
examples/​example_LaB6_ionic/​easydiffraction/​README.md Documents CrysPy ionic-scattering requirements.
examples/​example_LaB6_ionic/​easydiffraction/​output/​refined_parameters.csv Adds the ionic easydiffraction parameter reference.
examples/​example_LaB6_ionic/​easydiffraction/​output/​parameter_dispositions.csv Adds the ionic easydiffraction disposition reference.
examples/​example_LaB6_ionic/​easydiffraction/​output/​LaB6_unit_cell_report.csv Adds the ionic easydiffraction cell reference.
examples/​example_LaB6_ionic/​DESCRIPTION.md Explains ionic scattering and example limitations.
examples/​example_LaB6_easydiff/​DESCRIPTION.md Removes the legacy translated-example documentation.
examples/​example_DRX_33/​topas/​README.md Documents the native two-phase TOPAS recipe.
examples/​example_DRX_33/​output/​topas/​refined_parameters.csv Removes the legacy TOPAS parameter reference.
examples/​example_DRX_33/​output/​topas/​Li4MgWO6_SG12_unit_cell_report.csv Removes the legacy secondary-phase TOPAS cell reference.
examples/​example_DRX_33/​output/​topas/​example_DRX_33_results.csv Removes legacy TOPAS raw results.
examples/​example_DRX_33/​output/​topas/​example_DRX_33_prms.csv Removes legacy TOPAS iteration output.
examples/​example_DRX_33/​output/​topas/​DRX_33_unit_cell_report.csv Removes the legacy primary-phase TOPAS cell reference.
examples/​example_DRX_33/​output/​topas/​DRX_33_topas_peaks.txt Removes the legacy TOPAS reflection reference.
examples/​example_DRX_33/​output/​Li4MgWO6_SG12_unit_cell_report.csv Updates the GSAS-II secondary-phase cell reference.
examples/​example_DRX_33/​output/​DRX_33_unit_cell_report.csv Updates the GSAS-II primary-phase cell reference.
examples/​example_DRX_33/​easydiffraction/​README.md Documents the native two-phase easydiffraction recipe.
examples/​example_DRX_33/​easydiffraction/​output/​refined_parameters.csv Adds the two-phase easydiffraction parameter reference.
examples/​example_DRX_33/​easydiffraction/​output/​Li4MgWO6_SG12_unit_cell_report.csv Adds the easydiffraction secondary-phase cell reference.
examples/​example_DRX_33/​easydiffraction/​output/​DRX_33_unit_cell_report.csv Adds the easydiffraction primary-phase cell reference.
examples/​example_DRX_33/​DESCRIPTION.md Documents native recipes, refine flags, and invalid output values.
examples/​example_DRX_33_strainonly/​output/​Li4MgWO6_SG12_unit_cell_report.csv Updates the strain-only secondary-phase cell reference.
examples/​example_DRX_33_strainonly/​output/​DRX_33_unit_cell_report.csv Updates the strain-only primary-phase cell reference.
examples/​example_DRX_33_simulation/​output/​topas/​DRX_33_topas_peaks.txt Removes the legacy TOPAS simulation reflection reference.
examples/​example_DRX_33_simulation/​output/​Li4MgWO6_SG12_unit_cell_report.csv Records zero ESDs for fixed secondary-phase cells.
examples/​example_DRX_33_simulation/​output/​dummy.lst Updates the migrated two-phase simulation log.
examples/​example_DRX_33_simulation/​output/​DRX_33_unit_cell_report.csv Records zero ESDs for fixed primary-phase cells.
examples/​example_DRX_33_atomrefine/​output/​topas/​Li4MgWO6_SG12_unit_cell_report.csv Removes the legacy secondary-phase TOPAS cell reference.
examples/​example_DRX_33_atomrefine/​output/​topas/​DRX_33_unit_cell_report.csv Removes the legacy primary-phase TOPAS cell reference.
examples/​example_DRX_33_atomrefine/​output/​topas/​DRX_33_topas_peaks.txt Removes the legacy TOPAS atom-refinement reflection reference.
examples/​example_DRX_33_atomrefine/​output/​Li4MgWO6_SG12_unit_cell_report.csv Updates the atom-refinement secondary-phase cell reference.
examples/​example_DRX_33_atomrefine/​output/​DRX_33_unit_cell_report.csv Updates the atom-refinement primary-phase cell reference.
examples/​example_DRX_33_anisoADP/​output/​topas/​Li4MgWO6_SG12_unit_cell_report.csv Removes the legacy secondary-phase TOPAS cell reference.
examples/​example_DRX_33_anisoADP/​output/​topas/​DRX_33_unit_cell_report.csv Removes the legacy primary-phase TOPAS cell reference.
examples/​example_DRX_33_anisoADP/​output/​topas/​DRX_33_topas_peaks.txt Removes the legacy TOPAS anisotropic-ADP reflection reference.
examples/​example_DRX_33_anisoADP/​output/​Li4MgWO6_SG12_unit_cell_report.csv Updates the anisotropic-ADP secondary-phase cell reference.
examples/​example_DRX_33_anisoADP/​output/​DRX_33_unit_cell_report.csv Updates the anisotropic-ADP primary-phase cell reference.
docs/​regression-tolerance.md Updates execution commands and historical TOPAS fixture context.
docs/​integration/​pixi_schema_only.toml Updates the engine-free validation environment template.
docs/​integration/​pixi_full.toml Updates the GSAS-II integration template and source pin.
docs/​index.rst Reorganizes documentation around native engine recipes.
docs/​changelog.md Includes the root changelog in Sphinx documentation.
docs/​_generated/​support_matrix.md Adds generated gateway and version-support information.
.powderline_config.yaml.example Documents TOPAS configuration and revised simulation defaults.
.gitignore Ignores maintainers’ local probe scripts.

Review effort: Balanced

…ait limit

- powderline.run() validates the recipe and probes that the gateway's
  engine is importable before it clears the directory's fixed-name
  outputs: a mistyped recipe or a run in an environment without the
  engine raises and leaves the previous results in place. The probe is
  the installed_engine_version of the module defining the registered
  gateway's run(), so a replacement gateway or TOPAS is left to its own
  checks.
- The GSAS-II client's fixed 300 s read timeout on the /simulate request
  is gone: a refinement takes as long as it takes, as in-process (the
  connect, write and pool phases keep a 30 s bound). The gsasii gateway
  gains server_timeout (seconds; None or 0 = no limit) and the CLI
  --server-timeout SECONDS, mirroring --topas-timeout; past the limit the
  run raises ExecutionBackendError timeout with no in-process fallback,
  as before.

Gates: core 1848 passed / 23 skipped; gsasii 1488 / 3; docs -W clean.
Refs NSLS2#13

Assisted-by: claude-code:claude-fable-5-1
fix: keep previous results until a run can start; no default server wait limit
Copilot AI balanced review requested due to automatic review settings November 5, 2026 18:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Changes to scientific regression references and the frozen GSAS-II boundary require maintainer/domain review of equivalence records and native-engine results, including Windows-only TOPAS 6, to establish numerical equivalence.

No open issues 🎉

Review effort: Balanced

@AdamCorrao
Adam Corrao (AdamCorrao) merged commit 1a15bda into NSLS2:main Nov 5, 2026
8 checks passed
@AdamCorrao
Adam Corrao (AdamCorrao) deleted the release/0.2.0-cleanup branch November 17, 2026 17: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.

3 participants