You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docs-only update aimed at people building their own recipes.
Building Recipes guide (docs/building-recipes.md): why PowderLine ships no recipe builder, what a recipe contains (sections, the [value, refine_flag, min, max] format, units), where to start (template, the nine examples, Materials Project), how to validate, and what validation does not catch.
Recipe helper code and LLM prompt (docs/recipe-helpers.md): a small I/O module (CIF / .instprm / pattern → recipe sections, numpy + gemmi only) and a prompt template, adapted from the v0.1.0 tester bundle and updated for the current code. Both are explicitly marked as guidance, not an authoritative builder.
Supported Features (docs/capabilities.md): a per-engine table (GSAS-II / TOPAS / easydiffraction) and a "not yet supported" list (e.g. Pawley/Le Bail, anisotropic broadening, preferred orientation, user constraints/restraints).
Citations: ask users to cite the refinement engine as well as PowderLine (GSAS-II + scripting interface, TOPAS, easydiffraction) in the README, a new Citing page, and CITATION.cffreferences.
ESD terminology: a note that esd follows the engines' terminology and denotes a standard uncertainty (IUCr 1995; NIST TN 1297). Column and key names are unchanged.
Fixes:
The Getting Started example recipe validated but failed at run time; it now runs.
The integration guide listed validate() / load_recipe_asset() as available without GSAS-II.
Simulation unit-cell reports have an empty esd column, not 0.0.
Testing
pixi run docs builds with no warnings.
The helper module and usage example, as extracted from the page, build recipes that pass powderline.validate and validate_only on all three engines.
Helper-built recipes run in GSAS-II: LaB6 Rietveld (Rwp 6.00%, matching example_LaB6), single-peak fitting, and a simulation.
The Getting Started snippet runs.
Code issues found (documented here, not changed in this PR)
easydiffraction converts the zero shift as if it were in centidegrees, but GSAS-II's Zero is in degrees. Values are 100× off; flagged on the Supported Features page.
TOPAS ignores flagged zero shift, axial divergence, and polarization without a warning.
An instrument.parameterization without broadening or corrections passes validation but crashes the GSAS-II run.
easydiffraction drops flagged size/strain with only a warning.
PowderLine deliberately ships no recipe builder. Document why, what a
recipe contains, where to start (template, nine examples, Materials
Project), how to validate, and what validation does not catch.
Add a helper page with a small I/O module (CIF, .instprm, pattern ->
recipe sections) and an LLM prompt template, adapted from the v0.1.0
tester bundle and updated for the current code. Both are explicitly
non-authoritative guidance.
Add a per-engine supported-features page listing what is not yet
supported, and link both pages from the README and Quickstart.
Assisted-by: claude-code:claude-opus-5-5
Add GSAS-II (and its scripting interface), TOPAS, and easydiffraction
references to the README citation section, a new Citing page in the
Sphinx docs, and the references list in CITATION.cff.
Assisted-by: claude-code:claude-opus-5-5
Keep the engines' 'esd' wording and column names, but note that the
quantity is a standard uncertainty (IUCr 1995; NIST TN 1297).
Assisted-by: claude-code:claude-opus-5-5
- Getting Started: the example recipe had an empty instrument block
and no corrections block, so it validated but failed at run time; it
now runs. Point to the Building Recipes guide.
- Integration guide: validate() and load_recipe_asset() are exported
only when GSAS-II is installed, so they are not on the schema-only
track.
- Simulation unit-cell reports have an empty esd column, not 0.0.
Assisted-by: claude-code:claude-opus-5-5
This documentation-focused PR helps users build their own PowderLine recipes, understand engine limitations, and cite the software used for refinement.
Changes:
Adds recipe-building guidance, copyable I/O helpers, and an LLM prompt template.
Documents per-engine capabilities and adds engine citation metadata.
Repairs the Getting Started recipe and clarifies validation availability and uncertainty terminology.
- Helper module: keep missing anisotropic CIF components as None (fall
back to Uiso with a warning) instead of raising TypeError; reject
infinite esd values, which would otherwise become zero weights.
- Scope symmetry-linked refinement to GSAS-II; note that TOPAS only
groups cell lengths and refines flagged symmetry-fixed parameters
with a warning.
- Microstrain is (delta d / d) x 10^6.
- Materials Project recipes start in simulation mode; raise
refinement_cycles before refining.
Assisted-by: claude-code:claude-opus-5-5
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The published helpers can misidentify CIF elements and misparse instrument files, producing incorrect structures or invalid recipes.
No open issues 🎉
3 previously missed issues
In code that hasn't changed since last review
Incorrect element inference from uppercase two-letter atom labels
docs/recipe-helpers.md:141
When a CIF omits the optional _atom_site_type_symbol column and uses uppercase two-letter atom labels, this fallback silently changes the element: FE1 becomes F, SI1 becomes S, and CL1 becomes C. read_cif() emits no warning for this fallback, and schema validation accepts the resulting chemically incorrect structure. Handle case-insensitive two-letter symbols or reject ambiguous labels and require an explicit type symbol rather than silently shortening them to one letter.
Fail to parse multiple semicolon-separated instprm pairs
docs/recipe-helpers.md:344
GSAS-II .instprm files can contain multiple semicolon-separated key:value pairs on one line, but this reader treats the whole line as one pair. For example, Type:PXC;Bank:1 corrupts Type, and a combined wavelength/profile line leaves Lam nonnumeric and drops profile parameters, producing an invalid recipe. Split each non-comment line on semicolons before parsing the individual pairs.
Kicker ignores selected engine and always invokes GSAS-II
docs/recipe-helpers.md:556
pixi run kicker always invokes GSAS-II; it does not use the engine selected earlier in this prompt. For a user who selected TOPAS or easydiffraction, this shell alternative therefore runs a different engine from the one just validated, or fails if GSAS-II is unavailable. Mark this command as GSAS-II-only, give topas-kicker for TOPAS, and retain the explicit-engine Python call for easydiffraction.
- Read two-letter element symbols case-insensitively (FE1 -> Fe, not
F) and warn when the element is taken from the atom label.
- Split .instprm lines on ';' as GSAS-II does.
- Note that pixi run kicker runs GSAS-II only; topas-kicker runs TOPAS.
Assisted-by: claude-code:claude-opus-5-5
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The helper can silently alter fit weights, and two engine-specific documentation claims can lead users to configure unintended models.
No open issues 🎉
3 previously missed issues
In code that hasn't changed since last review
Document structure precedence over parameterization starting values
docs/building-recipes.md:67
Please qualify this for easydiffraction: its builder reads phase cell and atom starting values only from structure, ignoring non-null values in their parameterization leaves. For example, changing parameterization.unit_cell.a[0] while leaving structure.unit_cell.a unchanged still uses the old lattice parameter, even with refinement disabled. Document this exception and tell users to update structure as well; otherwise following this guidance can silently calculate a different model than intended.
easydiffraction groups symmetry-equal cell lengths, but it does not apply GSAS-II's additional grouping for oblique cells. For a monoclinic cell with unique axis b, flagging only a refines a, c, and beta in GSAS-II but only a in easydiffraction. Document this distinction so users do not assume identical flags select identical parameters across engines.
Reject numeric rows with more than three columns
docs/recipe-helpers.md:427
Please reject numeric rows with more than three columns rather than silently truncating them. PowderLine's eight-column fit_profile.txt, for example, has y_weights third, so this reader treats weights as standard uncertainties and replaces them with 1 / y_weights**2. The resulting recipe can pass validation but uses incorrect fit weights.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Docs-only update aimed at people building their own recipes.
docs/building-recipes.md): why PowderLine ships no recipe builder, what a recipe contains (sections, the[value, refine_flag, min, max]format, units), where to start (template, the nine examples, Materials Project), how to validate, and what validation does not catch.docs/recipe-helpers.md): a small I/O module (CIF /.instprm/ pattern → recipe sections, numpy + gemmi only) and a prompt template, adapted from the v0.1.0 tester bundle and updated for the current code. Both are explicitly marked as guidance, not an authoritative builder.docs/capabilities.md): a per-engine table (GSAS-II / TOPAS / easydiffraction) and a "not yet supported" list (e.g. Pawley/Le Bail, anisotropic broadening, preferred orientation, user constraints/restraints).CITATION.cffreferences.esdfollows the engines' terminology and denotes a standard uncertainty (IUCr 1995; NIST TN 1297). Column and key names are unchanged.validate()/load_recipe_asset()as available without GSAS-II.esdcolumn, not0.0.Testing
pixi run docsbuilds with no warnings.powderline.validateandvalidate_onlyon all three engines.example_LaB6), single-peak fitting, and a simulation.Code issues found (documented here, not changed in this PR)
Zerois in degrees. Values are 100× off; flagged on the Supported Features page.instrument.parameterizationwithoutbroadeningorcorrectionspasses validation but crashes the GSAS-II run.Assisted-by: claude-code:claude-opus-5-5