Messages#
PowderLine speaks to you in three ways:
a validation error stops a recipe before anything runs;
a warning comes with a valid recipe or a finished run;
a failure reason names why a run failed.
Validation errors#
An invalid recipe raises pydantic’s ValidationError. It lists every
problem at once, each at its field path. Most messages name the value to
write.
$ pixi run powderline my_recipe.json --validate-only
❌ Recipe validation failed: my_recipe.json
Validation errors:
• payload -> instrument -> radiation: Field required
• payload -> instrument -> radiaton: Extra inputs are not permitted
• payload -> phases -> LaB6 -> unit_cell: Value error, unit cell is inconsistent with 'P m -3 m' (cubic): stated b = 4.2, but by symmetry b = a; write b = 4.15682
Please fix the errors above and try again.
See examples/example_LaB6/input.json for a working example.
The command exits with status 1.
In Python, catch the error and read its list:
from pydantic import ValidationError
try:
powderline.validate(recipe)
except ValidationError as e:
for problem in e.errors():
print(problem["loc"], problem["msg"])
locis the field path as a tuple, e.g.('payload', 'phases', 'LaB6', 'unit_cell').Structural checks (the cell against the space group, special positions, tie groups) run once the individual fields are valid. Fix the first errors and validate again to see them.
Validation needs no engine. It works in every environment.
Why the checks are strict, and what they check, is on Validation.
Warning codes#
A warning is a dict {code, message, field_path[, level]}. It comes back in
result["warnings"], in powderline.validate(recipe).warnings, and in the
validate-only summary.
level: "warning": act on it, or decide about it. The CLI prints these.level: "info": a record of something PowderLine did that changes no outcome. The CLI counts these, and lists them with--verbose.No
levelkey means"warning".
Code |
Engine |
Level |
Meaning |
|---|---|---|---|
|
gsasii |
warning |
Sample size or strain left out: 10 µm and 0 microstrain applied, fixed. |
|
gsasii |
warning |
|
|
gsasii |
warning |
|
|
gsasii |
warning |
A message GSAS-II stored with the refinement: correlations, singular parameters, SVD. |
|
gsasii |
warning |
The last cycle’s χ² change was above GSAS-II’s tolerance. The values are kept. |
|
gsasii |
warning |
GSAS-II varied fewer parameters than the recipe refines. |
|
core |
warning |
The stated |
|
core |
info |
A coordinate, cell value or Uij stated within tolerance of its exact symmetry-derived value is held in that form. The message gives both values. An exactly stated value gets no note. |
|
core |
warning |
The output recipe does not validate as written: an engine returned a value the schema refuses, or a symmetry tie came back inconsistent. It is still returned and written, with |
|
topas |
warning |
|
|
topas |
warning |
A refined value ended at a stated bound or a TOPAS default limit. |
|
topas |
warning |
TOPAS varied fewer parameters than the recipe refines. |
|
topas |
info |
A phase’s calculated intensities are all zero: its scale is 0, or TOPAS discarded a non-finite calculation. |
|
topas |
warning |
The base name is not ASCII-safe for TOPAS, so the files are written as |
|
topas |
warning |
The background-only run wrote nothing or was stopped at the time limit. |
|
topas |
info |
No |
|
easydiffraction |
warning |
A refined value ended at a bound or a physical limit. |
|
easydiffraction |
warning |
lmfit varied fewer parameters than the recipe refines. |
|
easydiffraction |
info |
A phase’s calculated intensities are all zero. |
|
easydiffraction |
warning |
lmfit stopped without success. The values are reported. |
|
easydiffraction |
warning |
The refined profile makes a peak width negative near the fit window. |
|
easydiffraction |
warning |
The CrysFML calculator reports no reflection list, so there are no peak lists. |
|
easydiffraction |
warning |
easydiffraction holds an atom in another writing of the same position. Bounds and reports stay in the recipe’s writing. |
|
easydiffraction |
warning |
Every CrysFML refinement: CrysFML computes in single precision, so the result can depend on the starting values. |
This table lists the same codes as powderline.exceptions.WARNING_CODES,
with the same engine and level. What each engine does, and why PowderLine
warns, is on the engine pages: GSAS-II,
TOPAS and easydiffraction.
Failure reasons#
A failed run raises EngineExecutionError (kind engine: the engine ran and
failed) or ExecutionBackendError (kind backend: the engine never ran). The
reason is e.reason on the error and failure.reason in the failed envelope
and in failure.json (Outputs).
Reason |
Kind |
Meaning |
|---|---|---|
|
engine |
A non-finite calculated pattern or value inside the fit window. For GSAS-II also a refinement GSAS-II itself aborted because no damped step lowered χ² (EB-99). Simulations are exempt. |
|
engine |
The engine reads an atom’s site or a symmetry tie differently from PowderLine’s core (EB-40, EB-05 for GSAS-II; EB-47 for easydiffraction). The run stops before refining. |
|
engine |
GSAS-II’s peak fit returned nothing (EB-38). |
|
engine |
The engine raised or exited abnormally: a GSAS-II crash, an lmfit, CrysPy or CrysFML error, or a |
|
engine |
TOPAS wrote none of its expected files. |
|
engine |
An engine file could not be read strictly: a non-numeric token, a ragged row, missing points, or a pattern on other 2θ values. |
|
backend |
Server mode: no GSAS-II server was running and none could be started. |
|
backend |
Server mode was requested while |
|
backend |
An HTTP or transport error after a GSAS-II server was found. |
|
backend |
GSAS-II: the server’s answer took longer than |
|
backend |
Anything else on the execution path before the engine ran, such as a recipe the server could not validate. |
Note
A TOPAS background-only run stopped at the time limit is not a failure. The
result has an empty y_bkg column and the warning
topas_background_not_calculated.
The reason codes are powderline.results.REASONS, split into
ENGINE_REASONS and BACKEND_REASONS. Error messages by symptom, with their
fixes, are on Troubleshooting.