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
60 changes: 58 additions & 2 deletions docs/SCHEMA_HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,65 @@ engine schemas adopt it in re/04–06.

## gsasii engine schema

### 1.0.0 — introduced in PowderLine 0.2.0
### 1.0.0 — introduced in PowderLine 0.2.0 (in development)

Entries added by re/04 (`gsasii.rietveld`, `gsasii.spf`).
Defined in `src/powderline/gateways/gsasii/schema.py` (engine-free), on core
1.0.0. Accepted versions are declared: engine schema `==1.0.0`, requiring
core `==1.0.0`. A 0.26.0 `GSASII_*` recipe is converted with
`scripts/convert_recipe_026.py`, which reports every change.

- **Workflows**: `gsasii.rietveld` (`phases`, no `single_peaks`) and
`gsasii.spf` (`single_peaks`, no `phases`; `refinement_controls.single_peak_fitting_mode`
required).
- **Parameters**: `[value, refine_flag]` only. GSAS-II applies parameter
limits only after the fit, so gsasii 1.0.0 exposes no bounds; a 4-element
list is an error.
- **Phase block**: core's `space_group`, `unit_cell`, `atoms`, plus `scale`
(required, >= 0) and `peak_broadening` (isotropic size in µm and microstrain,
each with `LG_eta`). The phase name is its key in `phases`.
- Space group: GSAS-II cannot use origin choice 1 or 9 other settings (7 it
does not read; `P 21 n m` and `A b a m` it reads as another setting), so
they are errors.
- Cell refinement: GSAS-II refines an oblique cell's parameters together
(monoclinic {a, c, β} for b-unique, {b, c, α} a-unique, {a, b, γ}
c-unique; all six for triclinic and rhombohedral axes). Refining part of
such a group is an error.
- **Size/strain left out**: 10 µm / 0 microstrain, isotropic, fixed, with a
structured warning, instead of GSAS-II's own 1 µm / 1000 microstrain. A
stated crystallite size must be > 0.
- **Instrument** (single source; GSAS-II's instrument parameters are built from
it): `description` (optional), `radiation {type: "PXC", wavelength}`,
`geometry {bank, azimuth}` (plain values), `corrections {zero_shift,
polarization, axial_divergence}`, `broadening {U, V, W, X, Y, Z}`. GSAS-II
units: U, V, W centideg²; X, Y, Z and zero centideg; SH/L dimensionless.
SH/L below 0.002 is an error (GSAS-II computes with 0.002 anyway). The
wavelength must be > 0. Kα doublets, TOF and neutron are not supported.
- **Background**: `chebyshev` (left out: one fixed term 0.0, no background,
instead of GSAS-II's constant 1.0) and optional `single_peaks` (positions,
intensities, `pv_gaussian_sigma_sq` in centideg², `pv_lorentzian_gamma` in
centideg; all four lists the same length; each position inside the fit
window). Values below GSAS-II's silent floors (intensity 0.1, σ² 0.01, γ 0.1)
are errors. Peak List peaks (`gsasii.spf`): σ² and γ at least 0.001, each
position inside the fit window.
- **Single peak fitting widths**: with `use_instrument_profile: true` the peak
widths come from the instrument profile (U..Z may be refined; a peak's own
σ²/γ may not); with `false` each peak has its own widths (they may be
refined; U..Z may not). GSAS-II silently ignores a refine flag on the side
not in use, so such a flag is an error.
- **Simulation** (`refinement_cycles` 1): every refine flag must be false.
- **At run time**, after phase setup: an atom GSAS-II reads with the wrong
multiplicity (some 2-fold sites in R32, R-3m, R-3c), or whose site it cannot
name while a coordinate or Uaniso is refined, is an error naming an
equivalent position to state instead.
- **Results**: `rwp`, `r_exp`, `gof`, `chi2_red` from PowderLine's uniform fit
statistics over the stated fit window (`None` where undefined, e.g. no
degrees of freedom); `simulation_mode` (a simulation gets the same
statistics; against placeholder data they mean nothing); GSAS-II's own
values, `parameters_requested` and `parameters_varied` under
`engine_details`; structured `warnings` (defaults applied, GSAS-II's
refinement messages, fewer parameters varied than requested). A refinement
that diverges (a non-finite calculated pattern) is a failure with a clear
message; GSAS-II itself does not flag it.

## topas engine schema

Expand Down
524 changes: 524 additions & 0 deletions scripts/convert_recipe_026.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions scripts/update_code_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"executors.py",
"extractors.py",
"constraints.py",
"_legacy_executor.py", # verbatim 0.26.0 copy (re/04, A39); removed in re/07
)


Expand Down
11 changes: 6 additions & 5 deletions src/powderline/_code_hash.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"gsasii_gateway_hashes": {
"_legacy_executor.py": "b541c8646e4a67ad809696793ea09c27",
"constraints.py": "dc7a28029d0a071cf35dd352e76eaee9",
"executors.py": "a59bf71961245fe6a30842b092b7bb11",
"extractors.py": "7e57b8b0e48ec677d9a90f0441d8cee9",
"helpers.py": "d288784c535123f95d5d2ccc5083e806",
"project.py": "f074993af296685f632db2cb94504486",
"setters.py": "f7e1082b26194ff2ed86e9bde5e4eab2"
"executors.py": "0761a600e29e5f2d314feffc167509ab",
"extractors.py": "30cc981566bc069f2ba309cfc1f6242c",
"helpers.py": "5829fa4cb24cc41a69f27271061926f0",
"project.py": "90c618bf9b4433f6b4b876a4266a1781",
"setters.py": "536dcc49658e5006639e479b220c4703"
},
"schema_version": "0.26.0"
}
Loading