Repository navigation
Releases
rietx 1.13.0
rietx 1.13.0
This release carries everything that reached main in the eleven days after 1.12.0, 194 merged pull requests.
Six changes are the largest.
A default fit is faster, and its answer moves by a fraction of an esd: a plan no longer ends in a closing stage, its last stage stops when no parameter would move by 0.1 of its esd, and a stage's peak windows are sized to the movement its parameters can make.
A peak's width, position or intensity can be an equation over its reflection, rx.PeakEquation.
A Le Bail partition now reaches its fixed point, so Le Bail answers move by up to 0.66 esd, and dense patterns fit up to 16 times faster.
A parameter on a combination the data do not determine has no esd, where 1.12.0 gave it one short by a factor nothing bounds.
A large cell fits faster: structural Jacobian columns share one structure-factor expansion, and Pawley refines reflections that coincide in every cell as one intensity.
And a choice argument outside its set is refused at the call, before any work.
Everything that changes what 1.12.0 code gets back is in Upgrading.
1.12.0 refuses every structure, instrument, pattern, result, series, history and project that this release writes (Files that change).
Install
pip install --upgrade rietxUpgrading
Code written against 1.12.0 runs unaltered, with the exceptions in this list.
Code to check
-
capabilities().schema_versionis0.62, where 1.12.0's was0.61.
0.62 addsPhase.peak_equationsandInstrument.peak_equations(WP-2107),SeriesEntry.held_values(WP-2081) andPatternData.diagnostics(WP-2304).
It addsStageResult.window_refit_lossandNodeAction.movement_slack(WP-2317 R7), andPlanSpec.shift_over_esd_tol,StageResult.shift_over_esd_tolandNodeAction.shift_over_esd_tol(WP-2317 R6).
It addsReflectionState.merged_groups, a list ofMergedGroup(WP-2315).
capabilities().expression_grammar_versionis2: the grammar gainsorbit_meanandharmonic, which only a peak equation may call.
A tie, a variable or aParametricEquationthat names either is refused at declaration.
capabilities().report_thresholds_versionis1.16, where 1.12.0's was1.14(WP-2081, WP-2220).
Files that change says which documents open where. -
A plan no longer ends in a closing stage unless it asks for one (WP-2222).
Code that readsresult.stages[-1].name == "closing"or countslen(plan.run_stages()) == len(plan.stages) + 1now sees the declared stages alone.
Setplan.closing_window_tol = rietx.schemas.plan.CLOSING_WINDOW_TOLto get the 1.10-1.12 behaviour. -
The last stage records the new stop, and
terminationgains"shift_over_esd"(WP-2317 R6, #1890).
PlanSpec.shift_over_esd_toldefaults to 0.1, andRefinementPlan.shift_over_esd_tol,RefinementPlan.stage_shift_tols()andrun_stage(shift_over_esd_tol=0.1)take it.
StageResult.shift_over_esd_tolandNodeAction.shift_over_esd_tolrecord what a stage stopped on, and areNonefor a stage that stopped on itsftolalone.
Code that testsStageResult.termination == "ftol"on a last stage meets"shift_over_esd"now. -
A second
fiton a converged model runs one stage (WP-2224, #1711).
Refinement.fitandrefinetakerefit="single" | "stages", default"single".
A second fit on a model that its last fit of the same pattern left converged runs one stage,warm_refit, which frees everything the plan frees at once.
Code that reads a re-fit'sresult.stagesby name now seeswarm_refitwhere it saw the plan's stages, andsummary()says which way a re-fit ran.
A first fit stays staged.
So does a fit after any written value, a plan that fixes a parameter (turn_off), a plan that frees a parameter the converged fit held, and a model swap throughedit.
refit="stages"runs the plan as before.
On the eightrietx comparestandards every second fit ran one stage, every parameter ended within 0.21 esd of the first fit's answer, and the one stage cost 0.15-0.27 of a staged re-fit's evaluations.
If the one stage diverges or carries an error-level diagnostic, it is discarded and the plan runs from the same start, and the result carriesWARM_REFIT_REJECTED(info). -
structure_from_cifrefuses a CIF whose operator loop is a different group from its H-M symbol (WP-1933, #913).
A loop that lost the C-centring ofC 1 2/m 1, or a P6₁ loop underP 61 2 2, used to build the loop's smaller group, with half the atoms and no diagnostic.
It now raisesValueErrornaming both groups, and no keyword overrides it: correct the symbol or the loop.
Where the loop listsx, y, zalone, it names both remedies: writeP 1or drop the symbol if the atoms are the whole cell, delete the loop if they are only the asymmetric unit.
A loop that is another setting or origin of the symbol's group, with the same centring, reads as before, and so does a loop that is no group.
A closed loop of another type at an origin gemmi does not tabulate (-x,-y+1/2,-zunderP 1 21 1) also used to read, as the symbol, and is refused too.
A loop of the symbol's type with another number of pure translations a cell is refused as well:B 1 21 1,C -1orI -1whose loop lost its centring is still type 4 or 2, but used to build half the atoms.
A loop on rhombohedral axes under a bareRsymbol still reads.
A loop ofx, y, zalone under a higher-symmetry symbol is refused too.
Such a file, often a full-cell export that keeps the symbol for information, used to read asP 1with the atoms listed, which was right when the atom list is the full cell.
Drop the symbol, or writeP 1, to read it so. -
A fractional coordinate written
.or?is refused naming the file, the site and the tag (WP-1933, #913).
It used to raise pydantic's anonymous "value nan lies outside bounds".
An occupancy written.or?still reads as 1.0. -
A cell parameter the space group ties to another must now agree with it (#1669).
UnderF m -3 m, b and c must equal a; underP 4/m m morP 6/m m m, b must equal a; on rhombohedral axes, β and γ must equal α.
The parameter table used to build the tied value from its source and drop the stored one silently, at any size.
It now refuses a tied length more thanSYMMETRY_LENGTH_RTOL(1e-5, 10 ppm in d) from its source, naming the entry, both values and the symbol.
A script that editscell.a.valueon a cubic phase editscell.bandcell.cwith it, or callsRefinement.set_values({"phases.0.cell.a": ...}), which moves them.
A CIF whose tied values agree within its printed digits is read as the source and reportsCIF_CELL_TIE_CORRECTED.
The GSAS-II, GSAS, TOPAS, FullProf and recipe readers refuse a larger disagreement naming the file.
A history an older release stored with such a cell opens as every fit of it read it, and saysHISTORY_CELL_TIE_CORRECTED. -
A choice outside its set is refused at the call, and some refusals changed type or wording (WP-2302).
A misspeltmode(refine,Refinement.fit,run_stage,parameters,suggest,SequentialRefinement.fit,Project.create) raisesValueErrorbefore any work, naming the choices:unknown mode 'lebial'; mode takes 'rietveld', 'lebail' or 'pawley'; did you mean 'lebail'?.
Before, it ran most of a fit and raised a pydantic error about an internal schema, andRefinement.parameters(mode=...)answered without a word.
An unknownbackendraisesValueError, where it raisedNotImplementedError.
RefinementTree.best(metric=...)refuses a name that is not a numericStatisticsfield; it used to say that no node carried statistics.
auto_background(kind=...),index_pattern(preset=..., engines=...),merge(prefer=...)andsolve_magnetic(nuclear_group=...)refuse before any work.
Code matching the old message text (refit must be one of,unknown search preset,unknown background kind) needs the new form. -
two_theta_rangeistwo_theta_limitswherever it requests a window (WP-2302):pick_peaks,fit_peaks,rx.viz.plot_result,rx.viz.plot_pattern, and theplotmethods that forward to them.
The old keyword raisesTypeError.
A field that describes a span keeps the nametwo_theta_range(DataRef.two_theta_range,ExtinctionScreen.two_theta_range,SuggestedAction.two_theta_range). -
A series no longer raises
SEQUENTIAL_WIDTH_GROWTH(WP-2081).
It warned when a phase width reached 3× its first measured value while GoF doubled.
The width's trajectory and each entry'sstatistics.gofare still on the result, so read the two side by side.
rietx.sequential.WIDTH_GROWTH_FACTOR,WIDTH_GROWTH_GOF_FACTORandWIDTH_GROWTH_SIGMAare gone, so code that reads any of them raises (ImportErrorfrom afrom … import,AttributeErroron attribute access).
SeriesResult.summary(deliverable="series")no longer prints its "widths grown with a worsening fit" row. -
A ΔBIC comparison says which fits it rests on, and
acceptedandfirescan beNone(WP-2220, #1717, issues #1685 and #1686).
FreedComparisongainsstatus_restricted,status_full,chi2_ordered,n_identifiedanddiagnostics.
chi2_orderedis true when the fuller fit's minimised cost (data χ² plus any restraint and penalty rows) is at most the restricted fit's plus 2, the lower edge of Kass and Raftery's (1995) "positive evidence" band.
n_identifiedcounts the freed columns the data measured, beside the count the BIC charged.
FreedParametergainsat_boundandt_reason, the reason a t-ratio is missing, such as "no gradient".
A new warning,COMPARISON_UNCONVERGED, fires when either fit's status is notconvergedor the ordering fails.
It flags and refuses nothing, since a budget stop can sit on the optimum.
A comparison between two converged fits keeps every nu...
rietx 1.12.0
rietx 1.12.0
This release carries everything that reached main in the fourteen days after 1.11.0, 150 merged pull requests.
Six changes are the largest.
Extinction is declared per phase, so mccusker_structural frees it only where a phase asks for it.
A Le Bail stage repeats its partition until the intensities settle, where 1.11.0 stopped after three cycles, so every Le Bail fit's numbers can move.
A point whose file esd is zero or negative takes no weight, where 1.11.0 gave it about a million times its neighbours' weight.
A formula can now set a parameter: tie(path, expression=...) in one fit, and a parametric equation with an "expression" basis in a joint fit.
A joint fit runs in Pawley mode, so a cell series needs no structure.
And the GUI has a new layout, a start screen, a File menu, and a recovery copy that keeps unapplied edits through a close or a crash.
Everything that changes what 1.11.0 code gets back is in Upgrading.
1.11.0 refuses a structure, a refinement result or a project that this release writes (Files that change).
Install
pip install --upgrade rietxUpgrading
Code written against 1.11.0 runs unaltered, with the exceptions in this list.
Code to check
-
capabilities().schema_versionis0.61, where 1.11.0's was0.60.
0.61 makesPhase.extinctionoptional (WP-1944) and addsPhase.parent_cell(WP-1419).
It addsIndexingControls.formulaandIndexingControls.temperature(WP-2030), andExtinctionCandidate.tested_hklandExtinctionCandidate.tested_two_theta(WP-2076).
It adds the"expression"basis andexpressionfield toParametricEquation, makes itstargetoptional, and removesParameter.expr(WP-1964).
It addsTieSpec.expression(WP-2118),StageSpec.turn_offandStageResult.fixed(WP-2208), andStageSpec.lebail_tol,StageResult.lebail_cycles_runandStageResult.lebail_settled(WP-1542).
It addsRefinementResult.sigma_rule,HistogramResult.sigma_ruleandPatternData.nonpositive_sigma(WP-1952).
Files that change says which documents open where. -
Parameter.expris gone (WP-1964). It only ever heldNone, and any other value raised.
Parameter(..., expr=None)still constructs, and a stored"expr": nullstill reads.
Code that readsparam.exprraisesAttributeError.
A formula is now a joint fit'sParametricEquation(basis="expression"), or a tie'sexpression=. -
Extinction is opt-in per phase (WP-1944, #1391, issue #877).
Phase.extinction
now defaults toNone, so code that readsphase.extinction.valueon a phase
that never declared it raises. On such a phase,set_varyandset_values
namingphases.N.extinctionraiseValueErrorfor an unknown path. A custom
plan'sphases.*.extinctionglob frees nothing there, and no code says so.
phase.extinction = 0.0declares it, andmccusker_structuralthen frees it
after the displacement parameters. The CIF, TOPAS and FullProf writers write
no extinction for a phase that declares none. -
Refinement.edit(structure=…)can refuse a change to the restraints made beside an atom reorder (WP-2121).
A restraint the structure held at the same place in its list is carried onto its atoms.
One appended after them is read in the new numbering.
A restraint changed in the same edit that renumbers its atoms could mean either atom list, so the edit raisesValueError.
Deleting a restraint in that edit counts as changing every one after it.
Code that renumbered restraints by hand to work around 1.11's defect meets this refusal.
Make the atom change alone, then change the restraints. -
A stage that frees two of a rigid body's three turn directions raises (WP-1805, #1388).
RIGID_BODY_PARTIAL_TURNis refused at the stage's start, so a stage that ran in 1.11.0 with a hold, a tie or aset_varyglob leaving exactly two directions free now raises.
Free none, one, or all three directions of a body's turn. No preset and no importer frees part of a turn.
The profile interval of one rotation parameter of a three-direction body returned an interval in 1.11.0 and now has no ends (issue #1390 item 4). -
A joint fit's per-pattern starting structures must be one model (WP-1325, #1497).
Starts that differ in a field that is not a parameter now raise, where that field shapes a shared parameter.
The fields are a texture axis, a declared extinction or Stephens block, restraints and a rigid body.
Under a per-histogram texture, different axes are accepted.
A phase'snameandparticle_radius_ummay always differ.
Numbers that move
-
mccusker_structuralfrees no extinction unless a phase declares it
(#1391). Over 69 structural-plan fits in the test suite, 1 freed value in 98
passed 3σ, and that one was a false positive on synthetic data. Where the
coefficient had sat at 0, nothing moves and aFLOOR_HITwarning about it
disappears. Where it had left 0, the phase scale moves by up to 2.8 esd and
Biso by up to 1.7 esd. The QPA guide's weak CaF₂ phase reads 1.34 ± 0.11 wt %
where it read 3.58 ± 3.53 wt %. -
A Le Bail stage repeats its partition until the intensities settle (WP-1542, #1434).
It stops when one cycle moves less than 1e-7 of the Bragg counts, under a cap of 25 000 cycles.
1.11.0 ran three cycles, so every Le Bail fit's numbers can move.
FAP's Rwp goes from 10.237 % to 10.108 %, and its largest move in a parameter other than the background is 0.783 esd.
11-BM NAC keeps its Rwp of 14.358 %, and moves by 0.004 esd.
Corundum's Rwp rises by 0.019 points.
A pattern with heavy overlap is slower.
BT-1 LaMnO₃ took 63-83 s on a loaded machine, where it took 0.44 s, and its cellbmoves by 12.8 esd.
Stage(..., lebail_cycles=3, lebail_tol=0.0)reproduces 1.11.0 bit for bit, and an old history node replays its three cycles. -
A point whose file esd is zero or negative takes no weight (WP-1952, #1541, issue #1448).
1.11.0 floored such an esd at a thousandth of the column's median.
That gave the point about a million times its neighbours' weight, and nothing said so.
A fit moves wherever a file carries such a point.
On a synthetic LaB6 pattern with one σ = 0 at the strongest channel, 1.11.0 stopped at its iteration limit with the cell 1.75e-3 Å from the truth.
1.12 converges to within 2e-4 Å.
Changed says what the readers do with such a point. -
Assigning a
Parameterto a schema field gives it the field's declared range and unit (WP-2088, #1458).
Passing one to the constructor already did so (issue #204).
In 1.11.0,phase.lor_size = Parameter(value=0.01, vary=True)left the width unbounded below and without a unit, so a free width could walk out of its physical range.
The same assignment also replaced the model's otherParameterobjects.
So an object held beforehand, such asg = phase.gauss_size, was no longer the model's, andg.vary = Truefreed nothing.
A fit whose model was built by assignment can give a different answer.
A stored document that holds an unbounded range keeps it. -
result.microstructurereads a width on its floor as no broadening under either solver (WP-1914, #1506).
Undersolver="trf"a width driven to zero stores a tiny positive value, and 1.11.0 read it as a real domain size.
On notebook 04's CeO₂ pattern, which has no Gaussian broadening,gauss_sizestored 3.4e-24 deg² and read as 4.3e13 Å.
It now readsat_zero.
The default LM solver already stored 0.0, and its readings do not change. -
A joint fit's parametric form test runs at the answer (WP-2104, #1547).
The test (the lack-of-fit check on an equation's form) used the parameter vector the last stage started from.
The equation guide's two quoted statistics move from 9.3 to 9.4 and from 501.5 to 504.2, and both verdicts stand. -
check_rigid_bodieskeeps a body's riding hydrogens riding in its released refit (WP-1989 part 1, #1008), so on a body with riding Hchi2_released,n_added,p_value,delta_bic,deviationsandfirescan move.
Each riding H is tied to its parent and no bond or angle with one in it is restrained, so the refit adds 3 parameters per other atom less the body's own.
n_addedis 36 on acridine form IX's 14 heavy atoms and 9 H, where 1.11.0 freed the H too and added 63.
On the deposited pattern (COD 2242872) with C2–C3 stretched 0.3 Å, as #1008 measured it, ΔBIC is +20.8 at N/f², where it was −137 with the H freed, and Hamilton's p is 4.8e-37.
The deposited body gives −233.
A body with no riding H refits as before. -
The extinction screen compares Pawley fits, where 1.11.0 compared Le Bail fits (WP-2076, #1460, #1461).
It scores each class on the forbidden lines that class can test.
On 318 of 1082 synthetic rows at a correct cell, the old comparison named a class that excluded the true group, and nothing fired.
Corundum over 20-90° returnsR - c -at ΔBIC −45.9, where it was −3435.
FAP now abstains, withP 63 - -leading on one testable line at 68.0°.
NAC still returnsI - - -.
PbSO₄ returnsP c - a, where the specimen isP c - n.
Files that change
Measured both ways on a fluorapatite fit, with 1.11.0 installed from PyPI.
- 1.11.0 refuses a structure, a refinement result or a project that 1.12 writes.
A structure carriesparent_celland, on a phase that declares no extinction,extinction: null.
A result carriessigma_rule, and each stage'sfixed,lebail_cycles_runandlebail_settled.
A project'sproject.jsoncarries the indexing controls'formulaandtemperature, as null when unset.
capabilities().project_format_versionis1.6, where 1.11.0's was1.5(WP-2030).
An instrument written by 1.12 opens in 1.11.0. - 1.12 opens what 1.11.0 wrote. A stored extinction value opens unchanged, as a declaration.
Somccusker_structural...
rietx 1.11.0
rietx 1.11.0
This release carries everything that reached main in the eleven days after 1.10.0, 183 merged pull requests.
Six changes are the largest.
The indexer validates each candidate by a Pawley fit, where 1.10.0 ran one Le Bail pass, and a line screen counts the predicted lines the pattern lacks, so a wrong cell can no longer buy a count of zero by refitting its background.
RefinementResult.parameters lists only what the fit could move, so a cubic b and c no longer sit beside a held a.
lab_calibrate and lab_bragg_brentano refine the axial ratio S/L and hold H/L, because the two are interchangeable and a fit could report either as a measurement.
A stage whose χ² still falls, too slowly to move its parameters by an esd, now stops and says so.
A series no longer calls any step a jump or refits a pattern for a high Rwp: it records steps, direction gaps and code counts with no threshold, and it follows each phase and atom by name.
And a structure can hold more: a rigid body on a special position, planarity and torsion restraints, and a distorted child refined on its mode amplitudes.
Everything that changes what 1.10.0 code gets back is in Upgrading.
1.10.0 refuses a structure, a history log, a refinement result or a series result that this release writes (Files that change).
Install
pip install --upgrade rietxUpgrading
Code written against 1.10.0 runs unaltered, with the exceptions in this list.
Code to check
capabilities().schema_versionis0.60, where 1.10.0's was0.59.
0.60 addsRefinementResult.radiationandHistogramResult.radiation(WP-2042),Phase.distortion_modesandRefinementResult.distortion_totals(WP-1419),IndexingResult.formula,IndexingResult.temperature,PeakList.instrument_undeclaredandCellCandidate.formula_units(WP-2030),PlanarityRestraint(WP-1809),GeometryTable.torsionsandTorsionRestraint(WP-1815),StageResult.rwp,StageResult.terminationandStageResult.window_loss(WP-1334, WP-2047), andSeriesResult.code_counts,SeriesResult.direction_gapsandSeriesEntry.rwp_over_median(WP-2003).
RestraintRow.kindgains"planarity"and"torsion".
Files that change says which documents open where.RefinementResult.parameterslists a parameter only when the fit could move it (WP-1999, ruled by the maintainer 2026-11-01).
1.10.0 listed a tied parameter whatever its source did, so a cubicbandcstayed beside a helda, at the carried value and with no esd.
Code that looks up a held path there now finds no row.
Read the value from the model, or list every parameter withRefinement.parameters().
A Le Bail fit of NAC reports 2 tied rows where 1.10.0 reported 18, and a series draws no trajectory point at a pattern where the path could not move.
The printed result does not change, and a CIF still states every cell length and coordinate.lab_calibrateandlab_bragg_brentanorefine the axial ratio S/L and hold H/L at the value you set (WP-2012, ruled by the maintainer 2026-11-01).
Swapping the two gives the same pattern to the last bit, so two free ratios had two mirrored minima and a fit reported whichever it reached.
Code that read a refinedinstrument.geometry.axial_hlfrom either plan now reads the value it declared.
Therefine_axial_asymmetrysuggestion names S/L alone.
An imported GSAS-II recipe still frees both ratios from its single SH/L flag.Refinement.fitno longer raisesValueError: array must not contain infs or NaNswhen a stage's model turns non-finite (WP-2048).
The stage ends at its start withstatus="diverged", the warningSTAGE_NOT_FINITEnames the stage, what went non-finite and the free set, and the fit carries on.
Code that caught the exception reads the stage's status.PeakListrefuses a line whoseq_esddoes not follow from itstwo_theta_esd(WP-2071, issue #1236), in the validator that already refuses a staleq.
The engines weight lines byq_esd, so in 1.10.0 an edit to one line'stwo_theta_esdloaded clean and never reached the search.
Set both together throughq_esd_of_two_theta, or rebuild the list withpick_peaksorfrom_positions.read_fullprof_pcrrefusesNor = 0with a non-zeroPref1, the exponential preferred-orientation function (WP-2058).
1.10.0 built such a file with no preferred orientation and said nothing.write_topas_inprefuses atie_equalgroup whose members hold two values (WP-1911), at the 1e-6 bar the TOPAS reader refuses one on read.SplitFamily(...)built withoutemission_lineraises (WP-1339), since a default of 0 read as an answer.
A stored dump still loads.predicted_but_absentis a capping caveat (C3, issue #916, PR #941): a cell carrying it alone gradesmedium, where 1.10.0 graded itlow;INDEX_REFUTING_CAVEATSno longer names it.
Code that read the caveat as a refutation readssupercell_refutedinstead, which is what refutes an oversized cell now.LeBailValidationgainspredicted_but_absent_uncancellable,predicted_but_absent_uncancellable_in_windowandabsent_source;SupercellCheckgainsrelation, and itsindexis 0 when the parent is not a sublattice (schema 0.60, indexing thresholds 1.12).
Every field is defaulted to the reading a 1.10.0 document had.- The indexer validates each candidate by a Pawley fit, where 1.10.0 ran one Le Bail pass (WP-2011).
LeBailValidation.moderecords which (schema 0.60), and a 1.10.0 document reads"lebail".
The type,CellCandidate.lebail,validate_by_lebailandlebail_rwpkeep their names. - Under a time ceiling (
quick, or a declaredtotal_budget_seconds) the search stops 15 % of it early, where 1.10.0 stopped 8 % early, and the validation fits run cheapest first, each on what the clock holds, where 1.10.0 gave each an equal share in rank order (WP-2011).
rietx.indexing.engines.budget_exhausted_diagnosticloses itsceiling_hitargument, since a validation fit no longer has a share of its own to run out of.
Code that compared two candidates'lebail.rwpreads a different number: a cell that predicts every reflection of another now fits at least as well, so the comparison separates a wrong metric and never an oversized cell. determine_extinction_symbolnow refines the cell before it screens (refine_cell=Trueis the default, issue #726).
A caller that hands it a certified cell and wants that cell held passesrefine_cell=False.
A caller that readsbest_or_none()getsNoneon a new reason as well:ExtinctionScreen.status == "unreliable".
0.60 also addsExtinctionScreen.prefit_rwp,ExtinctionScreen.reference_rwp_netandExtinctionScreen.perfect_fit_rwp_net, each defaulting toNone.SearchSpec.from_formulasets a volume ceiling only, for every formula (WP-2030).
1.10.0 also setmin_volumeto 0.8 ×zformula units by Hofmann's volumes, which excluded the true cell of 15 of 16 inorganic standards;min_volumenow stays at the 15 ų default unless you pass it beside the formula.
Withz=Nonethe spec narrows nothing, where 1.10.0 set a floor of one formula unit.
A search declared this way covers smaller cells and can take longer.
CompositionCheck.in_volume_windowtests the same ceiling alone: it readFalseon 15 of 16 true inorganic cells under the 0.8 floor.INDEX_Z_NOT_INTEGERis withdrawn, withrietx.indexing.diagnostics.Z_INTEGER_TOLERANCE, andcandidate_diagnosticsno longer takesformulaortemperature(WP-2030).
It fired on 12 of 16 true inorganic cells: against Hofmann's volumes a correct inorganic cell looks like a wrong Z.
The number it judged is recorded asCellCandidate.formula_unitswhenindex_patternis givenformula=.- A chemical formula whose full stop reads two ways is refused (WP-2030):
formula_unit_volume,SearchSpec.from_formulaandindex_pattern(formula=)raiseValueErroron"CuSO4.5H2O", which 1.10.0 read as 4.5 O, 39 % low.
What is refused is a decimal count of 1 or more, with no leading zero in its fractional part, straight after an element or a bracket and followed, past any whitespace, by one of 13 adduct molecules (H2O, D2O, NH3, H2O2, HCl, CO2, CH3OH, CH4O, C2H5OH, C2H6O, CH3CN, C6H6, C4H8O) that ends the part:"CuSO4.5H2O","CuSO4.5 H2O","CuSO4.5 H2 O".
Write a hydrate with·("CuSO4·5H2O").
Every other decimal reads as 1.10.0 read it:"Fe2.95O4","Li1.05Mn1.95O4","Ca9.5(PO4)6F2"and"Mg0.5SiO3"are unchanged.
A solvate whose molecule is not on the list ("ZnCl2.2C5H5N") still reads as a decimal. - A plan's last declared stage now converges at the solver's 1e-9 when a closing stage follows it, as it did before 1.10.0 (WP-2045).
RefinementPlan.stage_ftols()ends[..., None, None]where it ended[..., 1e-6, None], and that stage'sStageResult.ftolreadsNone.
A stage's ownStage.ftolstill wins. - Code that filters a joint result's
BISO_NEGATIVE,BISO_UNUSUALLY_LARGEorADP_NOT_POSITIVE_DEFINITEfindings by the bare path of a per-histogram parameter (WP-2028).
Such a finding's path now readshist.<h>.…, where 1.10.0 wrote it bare from pattern 0. - Code that reads a joint result's
ticksortick_hklas one row per phase, where a phase carries a moment (WP-2028).
A neutron pattern's magnetic phase now has its own"<phase> (magnetic)"row there, as a single fit's has had since issue #278. SEQUENTIAL_DISCONTINUITYis gone, with its three thresholdsDISCONTINUITY_FACTOR,DISCONTINUITY_SIGMAandMIN_POINTS_FOR_DISCONTINUITY(WP-2003).
A series no longer calls any step a jump: what one means depends on the sample's history, which no pattern records.
SeriesResult.discontinuitiesis renamedSeriesResult.steps, and it now lists every refined path's step between consecutive patterns, in esds of the later fit (SeriesStep.size_esd)...
rietx 1.10.0
rietx 1.10.0
This release carries everything that reached main in the ten days after 1.9.0, 128 merged pull requests.
Five changes are the largest.
Every plan now ends in a closing stage, which solves once more on peak windows that keep 99.9 % of each peak, so the answer of every default fit moves.
Sabine's extinction factor is now continuous, where 1.9.0's stepped by 3.6 %.
A fit that stopped on that step could report an esd that depended on the platform: in the QPA guide it was ten times smaller on macOS than on Linux.
solve_magnetic now charges each ΔBIC for the observations a powder pattern holds, so its evidence for a magnetic group is about ten times smaller.
A fit's diagnostics print by what they mean for the result you want from it, and every diagnostic's message is rewritten.
And the manual is rebuilt at rietx.org/docs/ in six tabs, and every tutorial notebook runs in a browser at rietx.org/lite/ with nothing installed.
On the 11-BM NAC example, README's figures move with the closing stage: Rwp goes from 0.0933 to 0.0930, and the history holds 15 nodes where it held 13.
Nearly every fit row of docs/VALIDATION.md moved, most by under 1 %, and Numbers that move lists the larger moves.
A fit whose declared stages run away can spend a very long time in its closing stage, and closing_window_tol=None avoids it (see Code to check).
Everything that changes what 1.9.0 code gets back is in Upgrading.
Install
pip install --upgrade rietxUpgrading
Code written against 1.9.0 runs unaltered, with the exceptions in this list.
Code to check
-
Code that reads the text
print(result)orsummary()prints for its diagnostics (WP-2037).
The "N unresolved" header is gone, and with no deliverable only an error prints in full: every other row is one line naming the code, its parameters and the purposes it is a warning under.
summary(deliverable=…)prints that purpose's warnings in full, andresult.diagnosticsholds every row as before, which is what code should read. -
SearchSpec.n_unindexedandSearchSpecSpec.n_unindexeddefault toNone, where they were 2, and also take"inliers".
Nonekeeps the count of two and adds the retry below; an int still declares that absolute count with no retry, so code that set one is unchanged and code that read the default as an int now readsNone. -
ParametricTieis nowParametricEquation, with no alias.
Code from 1.9.0 that buildsparametric=[rx.ParametricTie(...)]must change the name.
The standard term is a parametric equation, as in GSAS-II and in Stinton and Evans (2007).
A 1.9.0 result'sParametricCoefficientrows carry the keytie, and they open here with that key read asequation.
Reading.tieon aParametricCoefficientraises, because the attribute is now.equation. -
capabilities().schema_versionis0.59, where 1.9.0's was0.55.
0.56 addsRefinementResult.parametric_form.
0.57 addsPhase.textureandRefinementResult.texture.
0.58 addsRigidBody.riding.
0.59 addsRefinedParameter.equations,.intervaland.stderr_uncorrected, andRefinementResult.parametric_equationsand.parametric_form_joint.
It also addsStageResult.cell_reset,.collapsed,.width_twins_held,.window_area_toland.n_lapack_fallbacks.
It addsNodeAction.phase_support_sigma,.correlation_guardand.window_area_tol, andPlanSpec.phase_support_sigmaand.closing_window_tol.
For indexing it addsCellCandidate.n_search_unindexedand.unindexed_two_theta,ObservedPeak.two_theta_esd_fit,ExtinctionCandidate.excluded_groupsand.laue_classes, andExtinctionScreen.prior.
For QPA it addsQuantitativePhaseAnalysis.unmeasured_phasesand.unmeasured_heldandNodeMetrics.held_scale_phases, and letsPhaseQuantity.weight_fractionbeNone.
What this means for stored files is in Files that change.
A 1.9.0 result opens here withequationsset toNoneon every row, meaning not recorded. -
capabilities().indexing_thresholds_versionis1.11, where 1.9.0's was1.9.
Every indexing change below that can alter a search's answer rides it: the picker's false-discovery bar and its resolvability rule, the undrivenweak_linelines, the inlier retry, the search window sized by the list's widths, the intensity-weighted indexed fraction, and the extinction prior.
capabilities().report_thresholds_versionis1.13, where it was1.12, because the noiseMAGNETIC_WIDTH_UNMODELLEDdivides by has moved (Magnetic structures). -
Every plan now ends in a stage it does not declare, named
closing, soRefinementResult.stagesholds one entry more than the plan'sstages(WP-2002).
Code that readsresult.stages[-1]as the last declared stage, or counts stages againstplan.stages, should readplan.run_stages()instead.
compile_model,Refinement.predictandRefinement.run_stagenow compute at the closing stage's windows by default, so a pattern they draw carries tails a 1.9.0 one lacked.
Passwindow_area_tol=rietx.model.forward.WINDOW_AREA_TOLtocompile_modelorrun_stagefor 1.9.0's windows.
What the closing stage changes in an answer is under Numbers that move. -
build_reporttakesinstrument=besidestructure=, and refuses a Rietveld or Le Bailmodel=passed without both (WP-2002).
The report now reads its misfit at the closing stage's precision and its peak shapes at the declared stages', so it compiles whichever of the two models it was not handed.
A Pawley model is read as it is, as before. -
Harmonic.orderhas no default, where it was 2, andrietx.schemas.instrument.DEFAULT_HARMONIC_ORDERis gone (WP-2002).
Which orders a monochromator passes depends on its crystal: Si(111) and Ge(311) pass no λ/2.
Instrument.constant_wavelength_neutron(harmonics=True)is refused with a message naming the crystals, so pass the orders, such asharmonics=[2].
A stored instrument carries its order and opens as before. -
Refinement.tieandtie_equalrefuse a tie whose source is itself tied onto a locked or derived row (WP-1804).
1.9.0 accepted it and left the target frozen without a word.
No shipped plan or verb builds that chain, so no fit moves. -
magnetic_supercellrefuses a magnetic candidate or group given withoutmagnetic_species(#1079 by @mustachefeeling).
1.9.0 returned a child phase with a magnetic group and no moment on any site, which fitted with no magnetic term and no diagnostic.
A displacive candidate carries no moment and is not refused. -
Every diagnostic's
messageandsuggestionis rewritten (WP-1985).
The message states what this case found, with its numbers, and the suggestion is one action.
What a code means moved out of both, toDiagnostic.explanationandrietx.help.explain(code).
str(d)printswarning[CODE]: message, then anat:line with the paths and ahelp:line with the suggestion.
The rewrite renames no code, so code that matched on message text should match oncodeandwhereinstead.
The parameter help, the plan descriptions inPLAN_INFOand the API summaries are rewritten in the same voice. -
rietx.help.PEAK_DIAGNOSTIC_HELPis nowrietx.help.DIAGNOSTIC_HELP, and it explains every diagnostic code rietx raises (WP-1985).
rietx.help.help_registry()names that arm"diagnostics", where it was"peak_diagnostics". -
A GSAS-II project's spherical-harmonics entry is now
Gsas2Hap.texture, and itsGsas2Hap.preferred_orientationisNone(WP-1960).
In 1.9.0 that field held the entry's unused March-Dollase slots under the model name"SH". -
Three limit constants are gone, with the limits they set (WP-2002):
rietx.params.vector.SIZE_CAP_MIN_SIZE_A,rietx.schemas.structure.MARCH_R_MAXandrietx.schemas.instrument.HARMONIC_WEIGHT_MAX.
rietx.params.vector.size_captakes the fitted range alone,size_cap(tt_min, tt_max), where it also took a wavelength.
rietx.schemas.structure.MARCH_R_MINis now 1e-6, where it was 0.15. -
auto_backgroundreturns aBackgroundChoice, the background with the scores it was chosen on beside it (WP-2002, B12).
Assign itsbackgroundtoInstrument.background:ins.background = rx.auto_background(data).background.
In 1.9.0 it returned the background alone, and code assigning that now raises a validation error namingBackgroundChoice.
The background itself is the one 1.9.0 built. -
solve_magneticno longer takestie_r, andrietx.strategy.magnetic.SOLVE_TIE_R_MAGNETICis gone (WP-2002, B12; the ranking change is under Magnetic structures). -
QPA_FRACTION_UNDETERMINEDis nowQPA_FRACTION_RANGE, aninforecord on every width profile whose fit has an esd, andrietx.schemas.fraction.FRACTION_PROFILE_EXCESSis gone (WP-2002, B12).
In 1.9.0 the code was a warning, raised only when an admissible fraction lay more than twice the esd's 95 % half-width from the fit's, a factor chosen rather than measured.
The record'svalueis that distance,FractionProfile.excess, so a filter on the old code becomes a test ofvalue. -
rietx.viz.indexingno longer has the colour constantsOBS,CALC,BKG,DIFF,ABSENTandUNMATCHED(WP-1972).
Their values are theindex_obs,index_calc,index_bkg,index_diff,absentandunmatchedentries ofrietx.viz.plots.PALETTES["light"].
CANDIDATE_COLORSstays. -
CandidateSet.classesis now the partition split by the consistency rule (#936 by @mustachefeeling, issue #565 part 5), so a set whose union-find class held a proved separation reports more classes than 1.9.0 did, one per irrep group the proofs tell apart.
CandidateSet.merged_classesholds the old union-find partition beside it.
solve_magneticth...
rietx 1.9.0
rietx 1.9.0
This release carries everything that reached main in the two days after 1.8.0, 41 merged pull requests.
Five changes are the largest.
A joint fit can refine a parameter as a declared function of each pattern's coordinates, such as a cell edge linear in temperature down a ramp.
A joint fit of 300 patterns of 3 000 points each now runs in about 1 GiB.
The default LM driver now converges in three cases where 1.8.0 stopped early, at times while reporting converged.
A parameter on an exactly flat direction now reports a large esd, where 1.8.0 could report an esd of 0.
And rietx reads a neutron time-of-flight bank, though it cannot yet refine one.
On the 11-BM NAC example every figure README quotes is unchanged.
Of the 133 figures in docs/VALIDATION.md, 16 moved, and Numbers that move says by how much and why.
Tutorial notebook 06 is a template to run on your own data, and a notebook's figures keep their shape in Colab.
Everything that changes what 1.8.0 code gets back is in Upgrading.
Install
pip install --upgrade rietxpip also upgrades rietx-kernels to 1.3, which this release needs (Requirements that rise).
Upgrading
Code written against 1.8.0 runs unaltered, with the exceptions in this list.
Code to check
PatternData.two_thetaisNonefor a time-of-flight pattern, which carriesPatternData.tofin µs instead (WP-1927, schema 0.53).
Code that readstwo_thetaas always present should askPatternData.axisfirst ("two_theta"or"tof").
A constant-wavelength pattern is unchanged, and a stored document loads as before.
Every entry that needs a 2θ axis refuses a time-of-flight pattern by name.- A GSAS file holding several banks is refused until
bank=names one (WP-1927).
1.8.0 read the first bank.
The refusal names the banks the file holds, andrietx.io.formats.gsas.gsas_bankslists them.
A single-bank file reads as before.
A project that recorded no bank reopens on the file's first bank, and its stored fingerprint still checks that choice. - A
.xyfile whose header states its x-axis unit is read in that unit (WP-1927).
A stated time of flight goes toPatternData.tof.
A stated d-spacing, Q, wavelength or energy is refused by name.
1.8.0 read such a column as 2θ whenever its values lay between 0 and 180. RefinementResult.for_histogram(h)spells parameter paths as a single fit does (WP-1341).
Itsparameterskeep histogram h's rows without theirhist.<h>.prefix, and drop every other histogram's rows.
In 1.8.0 the view carried every row of the joint result, with each histogram's own rows still scoped.capabilities().schema_versionis0.55, where 1.8.0's was0.49.
0.50 adds the tether and anti-bump restraints, and 0.51 addsSeriesResult.relative_pathsand.angle_paths.
0.52 addsPhase.floating_originandParameterRow.origin_axis, 0.53 the time-of-flight axis and source, and 0.54 the"centroid"origin.
0.55 addsRefinementResult.parametric.
What this means for stored files is in Files that change.
Numbers that move
- Axial divergence no longer switches off when only one of
axial_slandaxial_hlis zero (WP-1953).
One ratio at zero now gives the limit of a vanishing one, a uniform smear, and only both at zero give the symmetric peak.
A stage that refines one ratio while the other is held at zero now refines a real asymmetry, where before it changed nothing.
On the QPA round-robin pattern cpd-1a that stage takes S/L from 0 to 0.041, Rwp falls from 17.13 % to 16.68 %, and no weight fraction moves by more than 0.04 wt %.
Over all eight mixtures of round-robin sample 1 the largest move is 0.10 wt %.
A fit freeing both ratios could land one on zero under LM, meet the jump there, and crawl to its evaluation cap beside it.
On the report-loop test that failed on Windows in 1.8.0, LM and TRF now end at the same χ²_red, 51.29977, with one ratio at 0.0413 and the other on zero.
That test now passes on Windows, Linux and macOS. - A Pawley fit with more than 128 columns now converges under LM (WP-1953).
Above 128 columns each step is now a projected conjugate-gradient step, which always lowers the model, where the old approximate step often raised it.
On the GSAS-II fluorapatite tutorial pattern, 343 columns, every stage converges at Rwp 7.824 %, where 1.8.0 stopped theprofilestage at its cap at 8.036 %.
TRF reaches 7.838 % there.
On the 11-BM NAC pattern, 1 499 columns, every stage converges at Rwp 12.62 %, where 1.8.0 stopped at its cap at 15.34 % and TRF reaches 13.48 %. - Parameters on an exactly flat direction no longer report an esd of 0 (WP-1930).
The covariance now inverts each kept eigenvalue of the normal matrix by its magnitude.
A flat direction comes back at a rounding-level eigenvalue of either sign, and a negative one used to give every parameter on it a negative variance, read as an esd of 0 and a correlation of 0.
Those parameters now report the large esd and the ρ = ±1 a positive one always gave, andHIGH_CORRELATIONnames them.
On the LaB₆ + cBN fit with six Lorentzian widths free, 1.8.0 raised noHIGH_CORRELATIONon Linux.
On macOS a 1e-14 change to one start value reproduced that, with six widths at ± 0.
Now, over ten such starts, the widths read ± 8.9 to ± 3420 at nine, and at the unchanged start, where both flat directions fall under the cut, ± 5e-5 to ± 3e-3 withCOVARIANCE_DIRECTION_DISCARDEDnaming all six.
A fit whose normal matrix has no negative eigenvalue above the cut is unchanged to the bit. - Under LM, a stage no longer crawls beside a parameter whose column vanishes, such as a moment angle at a direction the symmetry fixes (WP-1953).
Each column now keeps the largest scale it has had in the stage.
A column that is small from the stage's start has its curvature measured once λ climbs, since Gauss-Newton cannot see it.
Such stages used to stop onconvergedfar from a minimum, or run out their evaluations.
A one-site moment fit started at 3e-6 μ_B now reaches χ²_red 2e-18, where 1.8.0 reportedconvergedat 35.5.
With every moment DOF freed in one stage, the two-site Pnma set now reaches 3.498 and 0.700 μ_B, where 1.8.0's best was the swapped minimum.
profile_intervalon an azimuth beside such a direction now gives ±0.0357 rad, where 1.8.0's refits mostly stopped at their start and gave ±0.0287 rad. - A reflection tick now sits where the calculated curve draws its peak (WP-1908).
RefinementResult.ticksadded the zero shift and nothing else.
A fit with a refined sample displacement, transparency or capillary offset therefore drew every tick off its peak.
On a synthetic 0.5 mm displacement on a 217.5 mm circle the ticks sat 0.14° to 0.26° low, and every tick now lies within 0.01° of its peak.
The joint runner's ticks, the live viewer's ticks and the lattice positions of the satellite report take the same correction.
No fitted value, Rwp or weight fraction moves.
The report does, because it reads the ticks.
On twelve QPA round-robin fits (cpd-1a to 1h, cpd-1c over two ranges, cpd-2 and cpd-4), the unmatched observed peaks changed on eight, in both directions.
The suggested actions on cpd-1c, cpd-1f, cpd-1h and cpd-2 fell from eight, seven, seven and nine entries to one, one, none and one. - A phase that a plan has called unseen stays held at the next stage's start (WP-1523).
Each stage now reads the previous stage's answer beside its quick screen.
Before, a phase whose scale had been fitted to noise was freed at every stage start, chased the noise, collapsed and was solved a second time.
On a synthetic blank frame (issue #481) under the 11-stage structural plan that took 18 solves and 233 iterations, and it now takes 11 and 59.
Of 64 fits of weak real phases, one went from refined to held, at 2.46σ.
run_stage,cherry_pickand the GUI's stage-by-stage path still read the screen alone. - Whether a phase is seen is now judged with the other phases' scales held (WP-1523).
A phase modelled beside a subgroup of itself has a scale that trades one for one with the subgroup's.
Judged with the partner's scale free, both phases read under 3σ, and the hold took whichever one the start left weaker.
On issue #219's cubic Cu with an absent subgroup, that was the only real phase in 9 of 15 split starts.
Now a phase that another can stand in for is not called absent, andHIGH_CORRELATIONon the two scales reports the ambiguity.
A phase fitted to noise still reads under 3σ. - An indexing candidate whose ambiguity sweep refuses now counts as unasked, as one the clock stopped does (WP-1924).
A sweep refuses when the candidate's own lines cannot be predicted.
1.8.0 recorded such a candidate as checked with no partners, so the gate could still grade ithigh. determine_extinction_symbolnow refits every declaredHumpComponentin each class fit, beside the background, its FWHM floored atHUMP_MIN_WIDTH_MULTinstrument widths (#932 by @mustachefeeling, issue #931).
Before, a declared container halo was held at the pre-fit's values, which a Le Bail line at a forbidden position under the halo had biased, and the class forbidding that line was refuted.
On a synthetic pyrochlore with a 1° halo on the forbidden (200),F d - -is now returned on 3 of 3 noise seeds, where 1.8.0 refuted it on all three; a real line at (200) still refutes it.
A screen with no declared hump is unchanged.- The dichotomy indexing engine now refuses a box that lies outside its domain's obliquity bound everywhere (WP-1959, #780).
The domain holds reciprocal angles from 30° to 150°, so such a box holds no cell the engine may report.
Nothing refused one before, and near a singular metric its subtree does not converge.
On #780's monoclinic case one grid cell to...
rietx 1.8.0
rietx 1.8.0
This release carries everything that reached main in the four days after 1.7.0, 47 merged pull requests.
Four changes are the largest.
Every parameter is now refined in its own units, and the default driver is LM, so every converged fit can move.
The compiled kernels are a Rust wheel, rietx-kernels, where they were numba.
An install is 139 MB smaller, and an Intel Mac can install rietx again.
A CIF rietx writes now states what IUCr checkCIF computes, and a refinement CIF holds every measured point.
And a rigid body can carry torsions about named bonds, with a check that asks whether the data want the body a different shape.
On the 11-BM NAC example every figure README quotes is unchanged, and its Biso warning now reads FLOOR_HIT.
17 of the 129 rows of VALIDATION.md moved by more than 1 %, and it quotes the figures the 1.8.0 tree gives.
On NIST SRM 660c LaB₆, for one, the cell reads 25 ppm above the certificate, where 1.7.0 read 28 ppm.
A Pawley fit with more than 128 columns can stop a stage on its evaluation cap under the new driver, and solver="trf" avoids it (see Numbers that move).
Everything that changes what 1.7.0 code gets back is in Upgrading.
Install
pip install --upgrade rietxrietx now installs rietx-kernels in place of numba.
It has wheels for Linux, macOS and Windows on Python 3.11 or later, and no source distribution, so the platforms it covers are listed below.
Upgrading
Code to check
Code written against 1.7.0 runs unaltered, with the exceptions in this list.
Parameter.transformis gone (WP-1938).
Passingtransform=toParameterstill works and becomes bounds, but reading.transformraisesAttributeError.
ParameterRow.transformis gone too.Refinement.add_variableandParameterTable.add_parameterno longer taketransform=.
Pass the bounds instead, for examplemin=0.0.strategy.suggest.Candidate.dp_duis gone, since every column is in physical units.- A parameter that refines onto a lower bound of 0 reports
FLOOR_HIT, where it reportedBOUND_HIT(WP-1929).
That covers a scale, a width, a B withmin=0, and W on its floor.
Code that finds rows on a bound bycode == "BOUND_HIT"should read both codes, orRefinedParameter.at_bound, which isTrueunder either. - An event log opened by
EventStreamnow starts with a header line,{"record": "run", …}(#902 by @mustachefeeling, issue #223).
The line goes to the file only, so no callback sees it, andread_eventsskips it.
A reader of your own that validates each line as anEventRecord, or readse["kind"], needs to skip it too.
EVENT_SCHEMA_VERSIONis3, where it was2. - The module
rietx.params.transformsis gone, andlogaddexpandsigmoidleft the backend op list.
A custom backend no longer needs to provide them. - The isotropy
Witnessstores one more field,interior, so aWitnessbuilt by hand needs it. capabilities().schema_versionis0.49, where 1.7.0's was0.43.
0.44 addsStageResult.seeded, 0.45 addsRigidBody.torsions, and 0.46 removesParameter.transform.
0.47 addsBackgroundSelection.diagnostics, 0.48 addsParameterInterval, and 0.49 addsStageResult.moment_angle_tests.
Every document 1.7.0 wrote opens unchanged.
1.7.0 refuses a result this release writes, and a structure that carries a rigid body, even one with no torsions.
Numbers that move
- Every parameter is refined in its own units, and the default driver is LM, where it was TRF (WP-1938).
A width or a scale used to be refined through a softplus, a map that kept it above zero.
Near zero that map left the last digits of a fit to rounding, so two machines could reach different minima, and an esd depended on where the solver stopped.
Now a parameter'sminandmaxare bounds the driver holds directly.
TRF crawls on such bounds, so LM became the default.
On SRM 660c and NAC, LM is 1.19–1.30× faster than TRF.
On corundum and on a four-phase QPA pattern, TRF stops on its iteration limit and LM converges.
Every converged fit can move.
On the 11-BM LaB₆ + cBN Le Bail pattern from cells 0.36 % long, pass 1 reads Rwp 13.918 %, where TRF read 13.847 %.
solver="trf"stays selectable.
It can now stall on a positive parameter started far from its answer: a PbSO₄ scale started 2400 times too high ends at χ² 4.5e5 under TRF, with Pb Biso 133 Ų, and at 7111 under LM (issue #900). - The LM driver solves each step exactly inside the parameter bounds (WP-1937), so a parameter that ends on a bound sits on it.
Its budget ismax_iter × 4residual evaluations, as TRF's is, where it wasmax_iterouter iterations.
A stage that starts at its minimum reportsconverged.
It saiddiverged, and a series set such a pattern aside. - A Pawley fit with more than 128 columns can stop a stage on its evaluation cap under LM.
Above 128 columns each step is an approximate one, because the exact solve took 0.8 s to 177 s per step there.
On the GSAS-II fluorapatite tutorial pattern, 343 columns, theprofilestage stops at its cap at Rwp 8.036 %, where 1.7.0 converged at 7.825 %.
solver="trf"converges at 7.838 %.
WP-1953 owns the fix. - On Windows, one test of the report-guided loop stops at a different point under LM (WP-1953).
Freeing axial asymmetry on a short synthetic window ends at χ² 51.434 there, against 51.414 on macOS.
From that point the report offersrefine_sample_transparencyat confidence 0.999, where macOS caps it at 0.3 as not separable.
The loop's verify step rejects it, so the fit does not change.
It is the one failing test of 9417 in the Windows suite, and 1.7.0 passes it on the same hardware. - Under LM a fit keeps the Gaussian width real at every reflection, Γ_G² ≥ 1e-8 deg², and keeps a Stephens strain block inside its physical range.
RESOLUTION_NOT_POSITIVEandSTEPHENS_STRAIN_NOT_POSITIVEstill fire undersolver="trf"and in a joint fit.
Round-robin brucite with a Stephens block now ends inside that range, at χ²_red 7.72, where 1.7.0 reached 7.64 outside it. - The acceptance suites were re-measured for this release (macOS arm64,
[dev,jax]), and these answers moved by more than 1 %.
On NIST SRM 660c LaB₆ the Gaussian width is now real at all 60 reflections, where TRF's answer had it on its clamp at 12.
The cell reads 4.156882(21) Å, 25 ppm above the certificate, where it read 4.156895(21) Å, 28 ppm above.
Rwp rises from 8.67 % to 8.75 %.
The specimen displacement moves from −0.0801 mm to −0.0791 mm.
With a holder doublet injected into that pattern, ignoring the doublet shifts the cell by +9.9 ppm, where it shifted it by +7.6 ppm.
Declaring it leaves −1.4 ppm, where it left −1.0 ppm.
Excluding it leaves +0.2 ppm, where it left +0.6 ppm.
These SRM 660c moves come from the Γ_G² inequality, since LM without it lands where TRF did.
At 150 K, above Cr₂WO₆'s ordering temperature, its unsupported moment ends at 0.017 ± 1.29 μ_B under LM, where TRF left it at 0.067 ± 0.83 μ_B.
Both read as no moment.
Seeded along a and along b, the 4 K Cr₂WO₆ moment now agrees to 2.4e-8 μ_B, where it agreed to 3e-6 μ_B.
Chained, the eight round-robin sample 1 patterns take 278 iterations against 1015 fitted one at a time, where they took 725 against 1826.
On corundum the Stephens block's anisotropy ratio reads 1.52×, where it read 2.03×, at the same χ²_red of 2.65601.
That ratio rides a flat direction of the Lorentzian split.
Undersolver="trf", round-robin brucite with a Stephens block stops at its iteration limit at Rwp 18.09 %, where it reached 17.84 %.
Its ΔBIC for the block falls from +22.4 to +9.2.
Across four starting seeds it leaves the cone on 13, 7, 26 and 24 of 43 reflections, where it left it on 14, 7, 0 and 0.
The constrained LM fit, at 17.94 %, is now the better of the two by Rwp.
Corundum's two descriptions of its R lattice now agree to 4.9e-9 in c, where they agreed to 1.5e-8. - Caglioti
w's lower bound is 1e-8 deg², where it was 0.
A storedwbelow that is raised to it on read, as Marchris raised to its floor.
read_gsas_prm,read_gsas2_instprmandread_reciperaise a W between 0 and 1e-8 deg² to 1e-8 in the same way. - A parameter that ends on a lower bound of 0 reports
FLOOR_HIT(warning), and keeps its esd (WP-1938, WP-1929).
Before, a softplus row there was set aside as untested, and itsRefinedParameter.at_boundreadNone.
FLOOR_HITsays the data push the parameter below zero, and to fix it at 0.
BOUND_HITsaid to widen the bound, which a scale or a width cannot use.
GuardFinding.limitcarries the bound the finding chose.
Freed on SRM 660c, extinction now ends at exactly 0, where it ended at 5e-10. - Under the default LM driver,
at_bound,BOUND_HITandFLOOR_HITread the driver's active set (WP-1929).
A row is on its bound when the step landed it exactly there and the data still push it outward.
Undersolver="trf"the test is unchanged: within a hundredth of an esd of the limit, and pushed outward.
A row whose esd was wide enough to reach a limit it was nowhere near is no longer flagged. - The finite-difference step for the Caglioti
uandvis now sized by their unit, 1e-6 deg², instead of by 1 (WP-1936).
On a sharp instrument the old step was a large part of the peak's own variance, and on 11-BM SRM 660c it put 8.8e-4 of error intou's Jacobian column.
Every fit that freesuorvcan move. - A stage's
seedlifts only a free row that sits exactly on a lower bound of 0 or more.
In 1.7.0 it lifted any softplus row below the seed.
StageResult.seededlists what each stage lifted and the value it started from.
Of the presets, only the roughness stage seeds now.
The extincti...
rietx 1.7.0
rietx 1.7.0
This release carries everything that reached main in the five days after 1.6.0, 89 merged pull requests.
It is the first weekly cut.
Four additions are the largest.
rietx figures now show in Jupyter, and five executed tutorial notebooks ship with the repository.
write_topas_inp writes a whole input TOPAS runs, with the fit's free set and its ties, and the TOPAS reader reads them back.
Rigid bodies arrive as a provisional first piece.
And Atom.biso has no default bound, as in FullProf, TOPAS and GSAS-II.
Five changes move numbers an unchanged script prints, each only where it applies.
A displacement parameter is no longer stopped at 0 or 25 Ų.
An ion label without its digit (Na+, Cl-) scatters as the ion, where 1.6.0 computed the neutral atom.
The GSAS and GSAS-II readers and writers convert the Gaussian U, V and W as the variance those programs state.
A phase is judged present only when its scale is 3σ from zero.
And a magnetic phase in a centred parent keeps reflections 1.6.0 dropped.
On the 11-BM NAC example every figure README quotes is unchanged.
About 45 rows of VALIDATION.md moved, and it quotes the figures the 1.7.0 tree gives.
On the IUCr round-robin sample 1, for one, the worst weight-fraction error is 4.97 wt % where 1.6.0 gave 5.13.
Everything that changes what 1.6.0 code gets back is in Upgrading.
Install
pip install --upgrade rietxUpgrading
Code to check
Code written against 1.6.0 runs unaltered, with the exceptions in this list.
schemas.structure.BISO_BOUNDS,biso_boundsandbiso_widening_diagnosticare gone.rietx.crystallography.magnetic.irrepsand.modesmoved torietx.crystallography.representation.irrepsand.modes.
The old paths raiseModuleNotFoundError.
Both are internal modules, but 1.6.0 shipped them.print(x)andstr(x)on a schema give a new form (below), and so doeshistory.summary().
Code that parsed either text needs the change.capabilities().schema_versionis0.43.
0.42 addsRefinementState.free_declared, and 0.43 addsPhase.rigid_bodies.
A document that carries a rigid body is refused by a build older than 1.7.0.pip install rietxnow installs matplotlib (>=3.10.5), so figures work on a base install.
The install grows by about 58 MB.
Thevizextra is empty and still accepted, sopip install "rietx[viz]"keeps working.
An environment on a matplotlib older than 3.10.5 is upgraded.- A new
notebooksextra (ipykernel,nbclient,nbformat) runs notebooks headless.
Using rietx in a notebook does not need it.
Thedocsextra gainsmyst-nb. examples/fap_lab.pyis gone.
examples/tutorials/02_simple_rietveld.pyand its notebook replace it.
A default that changes: Atom.biso has no bound
Atom.biso was bounded at 0–25 Ų by default. It is now unbounded, as in
FullProf, TOPAS and GSAS-II.
- A stage holds B wherever the fitted range cannot separate it from the phase's scale, and reports
SCALE_B_INSEPARABLE. BISO_NEGATIVEwarns on a negative B, andBISO_UNUSUALLY_LARGEon one past the phase's melting estimate.- A bound you pass on a
Parameterstill binds. - A model saved before this keeps the bounds stored with it.
Measured on the IUCr round-robin mixtures over their full range, the largest
change in a weight fraction is 0.03 wt%. Over 20–40° the bounded fit was closer
to the weighed truth for 34 fractions and the unbounded fit for 10. Every
unbounded B below −1 Ų there fired BISO_NEGATIVE.
What a printed object looks like
print(x) and str(x) on a rietx schema give an indented tree with one line
per parameter. They used to give pydantic's field=value line. A long list or
array prints as a count and a range in repr too, so a pattern's repr fell from
79 607 characters to 171 on the FAP tutorial file. The values are unchanged and
are read from the fields.
rietx index prints the same lines as before. Its text now lives on
IndexingResult, so print(result) gives it in a script.
history.summary() keeps a straight run of stages in one column and indents
only the branches of a fork. It indented every stage before, so a long history
ran off the screen.
Diagnostics to check
Branch on Diagnostic.code, never on its text, and these changes pass you by.
Refinement.hold_floating_origin()holds one coordinate along each direction a polar group's origin floats in (P 6₃ m c: z), andfloating_origin_basis(group)returns those directions.
It reportsORIGIN_FIXED_ON_POLAR_AXISfor each phase it held, andORIGIN_NOT_FIXEDwhere a direction has no free coordinate to hold.
Opt-in: nothing is held unless it is called, so a fit that frees every coordinate of a polar group still has its flat direction, as in 1.6.0.- A phase on rhombohedral axes (
R -3 c:R) is written in hexagonal axes bywrite_fullprof_pcrandwrite_gsas2_phase_cif, and reported byFULLPROF_RHOMBOHEDRAL_RESTATEDandGSAS2_CIF_RHOMBOHEDRAL_RESTATED.
1.6.0 wrote the rhombohedral cell underR -3 c, which FullProf reads as hexagonal (5.42 5.42 5.42 90 90 120, a different crystal of three times the volume), and GSAS-II's CIF import refused the file.
The restatement holds every cell edge and coordinate and divides the scale by 9, sopredict()on it equals the original's. BISO_BOUND_WIDENEDis gone. Readers keep a file's B whatever its value, so there is no bound to widen.SCALE_B_INSEPARABLEfires on a phase with fewer reflections in range than scale and displacement parameters, not only on one d-spacing. It covers anisotropic sites, and a joint fit now runs it.- A B that reached the 0 floor reported
BOUND_HIT. Below zero it now reportsBISO_NEGATIVE. INDEX_PRIOR_USEDis awarningwhere a declared prior lies outside the search's axis box.
Its suggestion names theSearchSpec(max_d_axis=…)ormin_d_axisto pass.
A prior still never widens the box itself.STAGE_PATH_NOT_FREEis new, awarning. A stage naming a literal phase path that the model locks or ties by symmetry used to free nothing in silence.
The measured case is an atom coordinate on a special position,phases.0.atoms.2.x. Its suggestion names the path to free,phases.0.atoms.2.dof.*for a coordinate.STAGE_FREES_MAGNETIC_WIDTH_WITH_MOMENTfires only where the magnetic width starts at 0.0.
1.6.0 also fired on a converged fit refitted in one stage, which is the third step of the order the message itself prescribes.CELL_RUNAWAYcan now say a phase's cell was restored.
Where pulling each escaped cell parameter back to its window would leave a cell with no volume, every free cell parameter of the phase returns to the cell the stage started with.
1.6.0 pulled three escaped triclinic angles onto a corner, andRefinement.fitraisedDegenerateCellError.INDEX_DATA_INSUFFICIENTnames an undeclared instrument first whenindex_patternis given the instrument a fitted peak list was picked with.
assess_peak_list(peaks, instrument=…)takes it too, and only an abstention's suggestion changes.INDEX_SUPERCELL_REFUTEDsays the cell is ranked below its parent, not directly below it.SPECIES_FALLBACK_NEUTRALno longer fires onY3+, nor on a digitless one-charge ion the table holds.
It used to callNa+and the others absent from the table, and that was wrong.
It still fires onFe+and on the other ions no table carries.- The four foreign writers no longer refuse an ion label. 1.6.0 refused
Cu+in all four, GSAS-I's.EXPincluded.
Each now writes the atom rietx computed, in its program's spelling:Cu+isCu+1in TOPAS,CU+1in FullProf and GSAS,Cu1+in a GSAS-II CIF.
Where rietx computes an ion as its neutral atom (Fe+), the file states the neutral atom and the writer reports it:
TOPAS_SPECIES_WRITTEN_NEUTRAL,FULLPROF_SPECIES_WRITTEN_NEUTRAL(X-ray files only),GSAS_EXP_SPECIES_WRITTEN_NEUTRALandGSAS2_CIF_SPECIES_WRITTEN_NEUTRAL.
write_topas_inpandwrite_fullprof_pcrtakediagnostics=for it, as the GSAS writers already did.
An isotope a file has no place for is still refused. write_topas_inpwrites origin choice 1 as TOPAS's ownSsuffix (Fd-3mS), where 1.6.0 wroteF d -3 m:1and TOPAS stopped with "Space group not found".
A site within 1e-4 of a special position is written on it (x 0.3333333333333333, not the stored0.3333), so TOPAS generates the atoms rietx computes with.
1.6.0's rounded ICSD coordinates made TOPAS read the site as general: 12 positions for ZnO's two.
The stored coordinate is unchanged.write_topas_inp'sstrstates a phase's size and strain widths and its Stephens anisotropic-strain block aslor_fwhm/gauss_fwhmequations, and names what it still cannot state,TOPAS_FIELD_NOT_WRITTEN: the magnetic-only widths, extinction and preferred orientation.
1.6.0 wrote the phase without any of them and said nothing; a phase at every identity writes the same file.write_topas_inpwrites a moment component the site symmetry forces to zero as held (mlx ! 0.0).
1.6.0 gave all three components the moment's refine flag, and TOPAS stopped with "Magnetic moment mlx of site Mn cannot be refined as it has no derivative".
read_topas_inpstill gives all three components the flag any one carries.Structure.from_cifreads a site whose own symmetry images sit closer than 0.02 Å on the special position they collapse to (CIF_SITE_TWINS_MERGED).
A site within 0.02 Å of an image of an earlier site of the same species, whose occupancies sum above 1, is dropped (CIF_SITE_LISTED_TWICE); a file where they disagree otherwise is refused by name.
1.6.0 read both as extra atoms: a 6h site printed as (0.828, 0.657, ¼) gave 12 atoms, and gives 6 now. Split sites are untouched.structure_from_cifnames ...
rietx 1.6.0
rietx 1.6.0
This release carries everything that reached main in the fifteen days after 1.5.0, 217 merged pull requests.
It is the first release numbered when it was cut rather than when a milestone closed.
The largest addition is the first half of magnetic structure refinement.
A moment can be stated on a site and refined against a constant-wavelength neutron pattern.
It can be read from and written to magCIF, TOPAS and FullProf files, followed through a series, and proposed from the data.
The magnetic milestone is not finished, and each magnetic section below says what is still missing.
Around it sit fixes to answers that were wrong without saying so, the foreign readers and writers checked against the programs themselves, and a structure figure built from Python.
Three changes move numbers an unchanged script prints.
Every esd is smaller, because the factor that inflates it for correlated residuals now follows Bérar and Lelann's own correction.
On the shipped examples an esd is 0.79 (FAP) and 0.87 (NAC) of its 1.5.0 value, and no refined value moves.
A result's Rwp and χ² are now measured at the values it returns, which moves their last digits.
A constant-wavelength neutron fit refines in a wider profile box, estimates its own absorption where you declare a specimen size, and reads corrected isotope scattering lengths.
Apart from those three, a refined value moves only where one of the changes under Numbers that move applies to the fit.
VALIDATION.md quotes the new esds.
Everything that changes what 1.5.0 code gets back is in Upgrading.
Install
pip install --upgrade rietxUpgrading
Code to check
Code written against 1.5.0 runs unaltered, with the exceptions in this list.
capabilities().features["secondary_extinction"]is nowfeatures["primary_extinction"].
A powder has only primary extinction (Sabine, Von Dreele and Jørgensen 1988), so only the name changed.
The model andphases.N.extinctionare as they were, and the manual's anchor is nowcorrections.html#primary-extinction.write_reflection_tablewrites 13 columns on every table, magnetic or not.
satellite_orderandcomponentfollowintensity, andReflectionRowgains the same two fields.
Code that reads the CSV by column position needs the change.BackgroundPSpline.air_scatterisNonewherever no air term is declared.report.background.worst_absorptionisNone, andabsorptionbeside it isNonerather than{}, wherever the absorption screen had nothing to screen.
That is every Le Bail and Pawley fit, and a comparison such asworst_absorption < 0.25raises there.RefinedParameter.at_boundisNoneon a free row sitting at a zero floor, such as an absent phase's scale.
Code that testsat_bound is Falseneeds the change.write_htmlno longer takesinclude_plotlyjs, because the page carries everything it draws with.
viz.html.figure_from_arraysis gone, andviz.html.pagereturns the page as a string in its place.
A file an earlier version wrote still opens.- A pattern whose fit raised used to end
SequentialRefinement.fitin that exception.
It now records the pattern as a failure and carries on, which is the new defaulton_error="carry".
Passon_error="raise"for the old ending. A series that fits no pattern at all still raises. - The writers refuse what they used to write wrong without a word.
write_fullprof_pcr,write_topas_inp,write_gsas_expandwrite_gsas2_phase_cifeach refuse by name what their format cannot state, and spell an ion as their program reads it.
The sections on isotopes and on the.pcrwriter list each case. - A FullProf
.pcrwith aJbt = ±1phase at k = 0, and a TOPAS.inpwithmag_space_groupand site moments, used to raise.
Both now read, with the moments.
Code that caught the refusal to fall back now gets a magnetic model, which computes magnetic scattering on a neutron histogram. - A project that 1.6.0 saves does not open in 1.5.0, since the stored plan carries
lebail_passes.
A project that 1.5.0 saved opens in 1.6.0.
The same holds for any saved model that uses a field added since 1.5.0 (SCHEMA_VERSION0.22 to 0.41), so upgrade every machine that opens your files.
Diagnostics to check
Branch on Diagnostic.code, never on its text, and these changes pass you by.
BOUND_HITfires on some fits that were silent before, which is the point of it.
Its message ends with a parenthetical carrying its evidence, andDiagnostic.valueis a number where it wasNone.INDEX_SEARCH_INCOMPLETE's message changed on a search that a size cap stopped.- A series with a pattern above its Rwp fence carries
SEQUENTIAL_RWP_OUTLIER.
ASEQUENTIAL_DISCONTINUITYinto or out of such a pattern, or a diverged one, is no longer reported. GSAS2_GPX_PHASE_MAGNETICon a project whose phase names a magnetic partner but holds no magnetic phase isinfo, where it was awarning.
Its old message said the file's Rwp included magnetic scattering, which was wrong on every public file that triggers it (#606).
Numbers that move
- Every esd is multiplied by a smaller factor.
Refined values do not move, and the ratio of the two versions'Statistics.esd_inflationconverts one esd into the other.
ΔBIC fromsuggestandcompare_freed, theprofile_fractioninterval and the factor written into an exported CIF move with it. - A result's Rwp, χ² and curves come from a compile at its returned values.
χ² moved by at most 2.5e-3 of itself on the single-pattern acceptance fits, and by up to 2 % on one QPA series.
The history node keeps the figure from the stage's own compile, so a node's Rwp and its result's can now differ. - A refinement that tied a coordinate degree of freedom and then called another verb was accumulating that tie.
A refinement that tied a parameter of a phase the data cannot see, or a structural parameter under Le Bail or Pawley, was refining a column the corresponding freeze meant to stop.
Both now give the answer the tie declared. - A P-spline background built by
for_range, or byauto_backgroundwithout the air term, was refining that term anyway.
Every P-spline penalty now reads λ as a pure number (lambda_units = "intensity"restores the old one). Instrument.constant_wavelength_neutronbuilds its profile in a wider box (u from −0.5 to 8, v from −4 to 4, w, x and y up to 8).
1.5.0 used the X-ray box, with u up to 1, so a neutron fit can differ in its last digits.- A neutron instrument with a declared
capillary_radius_mmorthickness_mmand nomu_rormu_tnow gets an estimated one.
Absorption trades with scale and Biso, so both move on such a fit.
The Brindley correction ofparticle_radius_umnow reads the neutron table on a neutron histogram, so its weight fractions change. b_Sears.datcorrected 245 cells in 131 rows. Isotope scattering lengths moved by up to 12 %.
A natural-abundance neutron pattern moves only through He and Ra.- A σ column is floored at a thousandth of its own median esd.
1.5.0 floored it at 1e-3 or more, so a normalised pattern whose esds sit near or below 1e-3 had them raised.
Its χ², GoF and esds change. A pattern in counts is bit-identical (#650). CandidateGroup.delta_bicis now charged at N/f², which makes it smaller on every candidate the raw count favoured.
CandidateGroup.delta_bic_raw_nholds the number 1.5.0 gave.- A supercell the pattern does not support now sits directly below the smaller cell it contains in
IndexingResult.candidates, with a new refuting caveat,supercell_refuted. phases.i.atoms.j.dof.kis measured from where its fit began, and a series now starts each pattern's coordinates where the last one left them.
Its trajectory is each pattern's step, so chart the coordinate rows, which carry the same esd.- Three fixes move a fit only when they fire, and each names itself when it does:
CELL_RUNAWAY,SCALE_B_INSEPARABLEandPAWLEY_OFF_DATA_RIDGED.
The sections below say what each one changes.
Files that read differently
- A GSAS
.EXPor.prmnumeric field that is written but cannot be parsed now raises, naming the file, record and columns.
1.5.0 read it as absent. - A GSAS atom type such as
NI+2_58reads as ⁵⁸Ni²⁺, where 1.5.0 read a "+258" ion of natural Ni.
A GSAS-II.gpxreads the isotope its phase chose, so a deuterated project reads as ²H (b = 6.671 fm) where it read as H (−3.739 fm). - A TOPAS dataset opened by
RAW(...),XYE(...),XY(...),DAT(...),BRML(...)orSST(...)now counts.
Two such datasets no longer build into oneStructure, and a lone one gives its phasedataset = 0where it gaveNone.
A time-of-flight dataset is refused byto_structure, where 1.5.0 read it as constant wavelength. - A structure file with a Biso outside 0 to 25 Ų reads, where 1.5.0 refused the whole file.
Magnetic structures
A magnetic structure can be stated and refined
rietx 1.5.0 had no magnetic scattering model. Magnetic peaks in a neutron
pattern stayed in the residual, and the foreign-project readers refused a
magnetic phase. A moment is now an attribute of a site. Atom.moment takes a
Moment, holding crystal-axis components in μ_B, the form-factor ion and a
Landé g. A 4f or 5f ion needs the g stated. Phase.magnetic_symmetry takes a
MagneticSymmetry. That is the magCIF operator and centring loops, each
operation with its time-reversal sign, or a UNI, BNS or OG number resolved
into them. For MnF₂, Atom(..., moment=Moment.from_values((0, 0, 4.6), "Mn2+", vary=True)) puts 4.6 μ_B along c on Mn²⁺, and Phase(..., magnetic_symmetry="136.499") gives the group by its BNS number. The manual's
moment section
has the whole model.
The magnetic term r...
rietx 1.5.0
rietx 1.5.0
The window-into-a-run milestone. A fit used to be opaque until it returned.
Now every fit records itself to disk as it goes, and rietx watch shows you any
of them while they run: the pattern, the parameter trajectory, the event
console. You can stop a run from that page, or open it in the GUI without
disturbing it. Around that sit a structure written back out to the format
another program reads, a measured blank entering as data with its own error
bars, and a set of corrections to numbers the package stated about itself.
Two things change numbers you already have. A project with a fixed
background curve now refines that curve's scale under every shipped plan, and
constant_wavelength_neutron(fwhm_deg=...) seeds a different starting width.
Both are in Upgrading. Everything else in the forward model is
untouched: recording a fit returns a bit-identical Rwp, and the sinθ/λ symbol
rename moved no computed value.
Install
pip install --upgrade rietxWatch a fit while it runs
rietx watchNo arguments. It scans the working directory for runs — .rietx/runs, where
fits now record themselves, and any project's live/ — lists what it finds, and
draws the one you pick. Give it a directory to scan somewhere else, or a
directory that is itself a run to open straight onto it. The page keeps your zoom
across a stage boundary, so you can hold a peak in view while the fit works on
it.
In 1.4.0 this verb served one LiveSession directory that you had to set up
yourself, by passing events=LiveSession("live/") to the fit. That is no longer
necessary, because of the next section.
Two verbs sit on each row. Stop asks a running fit to stop, through the same
cancel token the solver already reads between residual evaluations, so the
in-flight stage is abandoned cleanly and the completed ones are kept. GUI
opens the run's project in rietx gui on a byte-for-byte scratch copy, because
there is no read-only way to open a project and looking should not change one.
rietx watch --read-only # clears both verbsEvery fit records itself
fit, run_stage, refine and refine_sequential now write a run directory
without being asked: the event log, a per-stage snapshot.json, summary.txt,
meta.json, status.json and a held run.lock. A five-stage LaB₆ fit costs
204 kB.
result = ref.fit(data) # records
result = ref.fit(data, telemetry=False) # does notRIETX_TELEMETRY=0 switches it off for a process, telemetry=<path> moves the
root, and a .gitignore of * goes into the root so runs stay out of
git status.
It is on by default because the measurement said so. Three of three subagents
asked to instrument a fit switched telemetry off when it was opt-in, and the
cost is 1–3 % of a fit. Every configuration returns a bit-identical Rwp.
Recording cannot break your fit. Every recorder method latches one-shot on
BaseException, records why in status.json, and warns once per process. A
callback you passed through events= is still yours and still runs outside
every try block, so a monitoring hook that crashes the refinement remains a bug
you get to see.
ref.fit(data, label="Ni foil, 400 °C") # names the run in the listWrite a structure back out
1.4.0 could read a TOPAS .inp or a FullProf .pcr. It could not write one.
Nine new calls close that:
rx.write_topas_inp(structure, "refined.inp")
rx.write_fullprof_pcr(structure, "refined.pcr")
rx.write_gsas_prm(instrument, "refined.prm")A structure carries out exactly what the reader reads back in: the space group,
the six cell parameters, and every atom's coordinates, occupancy and
displacement.
Each parameter's own vary is written as the format's @/! flag, so your
refine flags survive the round trip without a symbol table. The instrument is a
separate file in these formats and has its own writers.
The writers are write_topas_inp, write_fullprof_pcr, write_gsas_exp,
write_gsas_prm, write_gsas2_instprm and write_gsas2_phase_cif; the new
readers are read_gsas_exp, read_gsas2_gpx and read_gsas2_instprm. Each
writer's docstring names what does not carry — for TOPAS that is
extinction, preferred orientation and sample broadening, none of which the
reader builds.
A .prm stating two wavelengths now comes back with both emission lines, the
second weighted by the file's own KRATIO. It used to be refused, on a reason
that turned out to be an artefact of reading the record by splitting on
whitespace.
A measured background, with its own error bars
BackgroundFixedPlusChebyshev held a curve and added it with an implicit
coefficient of exactly 1.0. It now has the other form, the one TOPAS writes as
bkg_file("f.xy", @, s):
bg = BackgroundFixedPlusChebyshev.from_pattern(blank, n_terms=1)scale is a refinable multiplier on the curve, fixed_sigma carries the
curve's own counting statistics into the channel weight as σ² + s²·σ_f², and
fixed_source records where the curve came from.
Free the scale against a low-order polynomial. Measured on a synthetic blank
built at 0.85, one Chebyshev term recovers 0.8378(42) while six recover
0.6479(182), with Rwp falling monotonically across that row. The scale is a
measurement only where the polynomial cannot describe the curve itself.
Smaller changes worth knowing
help.py's Lp entry was wrong and is fixed. It stated a formula 0.508× of
the one the code computes at 2θ = 90° for K = 0.99, with the ratio varying
across the range. Two further entries were corrected in the same pass.sinθ/λissin equations andstolin python. Both renamed signatures
are internal, every call site passes positionally, and every refined number is
bit-identical.- A degenerate cell is refused by name.
d_spacingsraises
DegenerateCellErrorwhere it produced aRuntimeWarningand a silent NaN.
StageResult.n_degenerate_cell_probesand theCELL_DEGENERATE_PROBE
diagnostic count how often a stage reached one. RefinementResult.tick_hklpairs each tick with its reflection, by index.
A result written before this release opens with the mapping empty.- The GUI, the watcher and
rietx compareshare one set of colours and one
theme, which any of the three may set.
Contract versions
capabilities() reports six. One moved: schema_version 0.19 → 0.22, in
three steps — the degenerate-cell probe count, the measured background's fields,
and tick_hkl. Every new field defaults to the state its member was already in,
so no stored document changes meaning. The other five are unchanged:
event_schema_version 2, project_format_version 1.3,
report_thresholds_version 1.5, indexing_thresholds_version 1.3 and
textdoc_format_version 1.
Upgrading
Who has to do something, and what.
-
Your project has a fixed background curve. Every shipped plan preset frees
instrument.background.*, and the curve'sscaleis a parameter of the
background, so that glob now reaches it. Such a project refines one parameter
more than it did and its numbers move. To hold the curve exactly where you set
it, freeinstrument.background.c*instead. This was not made opt-in because
the P-spline'sair_scatterhas always been reached by the same glob, and a
measured background whose scale the shipped plans cannot free would need a
hand-written plan to do the one thing the feature is for. -
Your fixed background curve stops short of your fit range.
interpolate_fixedwas barenp.interp, which clamps to the end values
outside the curve's range with no warning. A blank measured over 0.5–50°
under a specimen scanned to 70° contributed twenty degrees of flat invented
counts and nothing said so. It now raises, naming both ranges and both ways
out: crop the fit withtwo_theta_min/two_theta_max, or supply a curve
that covers it. A curve frombackground.estimateorauto_backgroundis
already on the pattern's own grid and is unaffected. -
You build an instrument with
constant_wavelength_neutron(fwhm_deg=...).
It seededw = (0.5·fwhm)²andx = fwhmtogether, double-counting the
width and climbing with angle: atfwhm_deg=0.3the seeded FWHM was 1.179° at
2θ = 150, which is 3.93× the width you asked for. It now seedsw = fwhm²and
leavesxalone, holding the seeded width within 1.4 % across 20–150°. Your
starting widths move; your converged fit does not, since these terms refine.
To get the old seed back, setwandxon the profile directly. A
fwhm_degabove 1.0° now raises,w's default upper bound being 1.0 and the
seed beingfwhm_deg²; declare a coarser instrument by setting
instrument.profile.wexplicitly, with its own bounds. -
You catch
RuntimeWarningaround a cell that can go degenerate. It is a
crystallography.lattice.DegenerateCellErrornow, which is aValueError.
Inside a refinement you will not see it: the solver-side guard neutralises
such a reach and counts it instead. -
You fit on a shared filesystem, or in someone else's repository. Fits now
leave a run directory behind.RIETX_TELEMETRY=0,telemetry=Falseor
telemetry=<path>each decline it. -
You passed
events=LiveSession(...)to get a live view.LiveSessionno
longer writesfit.html; it writessnapshot.jsonper stage, which is what
rietx watchreads.rietx htmlstill writes a page on demand. A project's
live/now holds one directory per run rather than one session's files.
The measured record
docs/milestones/v1.5.md
carries this milestone's acceptance rows. Unlike every record before it, they
were written after the work shipped rather than at the open, because the
milestone was opened 496 commits behind its own ...
rietx 1.4.0
rietx 1.4.0
The free-standing-peaks milestone. Peaks without a structure: fitted
standalone at positions you name, and declared as components of the instrument
when something in the pattern is not a phase you are refining. Around that
milestone sits two weeks of work that landed after 1.3.0 shipped — model files
from other programs, two more vendor pattern readers, a joint fit that shares
the crystallite size rather than the coefficient, and named variables.
The forward model moved in one place. A multi-wavelength joint fit now
shares a specimen's size across histograms in physical units rather than
sharing the angular coefficient, so such a fit gives different numbers from
1.3.0 — better ones, measured. Everything else in the forward model is
untouched: a single-histogram fit that declares no extra component gives what
1.3.0 gave.
Install
pip install --upgrade rietxFit exactly the peaks you name
rx.fit_peaks(data, instrument, positions) fits peaks at the positions you
give it, with no structure, no phase and no plan:
peaks = rx.fit_peaks(data, ins, [28.094, 34.087, 39.985, 48.226])It returns the same PeakList that pick_peaks returns, so everything that
reads a peak list reads this one. The components in each window are your
positions and no others.
Two answers it gives rather than withholding. A position where there is no
peak comes back flagged rather than silently dropped, so a typo in your list
is visible instead of being a shorter list than you passed. And a position
sitting beside a real peak you did not name is flagged too: fitting your
model alone where the data shows more biases the position you asked about, and
the only numeric trace would otherwise be χ²_red. The manual's
Fitting peaks you name
chapter runs a Williamson-Hall analysis over the result.
Declare a peak your phases cannot account for
A sample holder at its own specimen distance, a mount, an unidentified impurity
line: declare it as a component of the instrument and the channels stay in the
fit, instead of being excluded along with the sample peaks underneath them.
from rietx.schemas.common import Parameter
from rietx.schemas.instrument import PeakComponent
instrument.extra_components.append(PeakComponent(
label="steel holder 110",
center=Parameter(value=44.6, min=44.3, max=44.9, unit="deg"),
area=Parameter(value=800.0, min=0.0, unit="counts*deg",
transform="softplus"),
))A declared peak joins result.ticks under the reserved key "(extra)", which
is what stops Layer 0 of the report calling it an unindexed impurity. Under Le
Bail and Pawley its curve is subtracted before the intensities are partitioned,
so a holder's counts are never handed to a phase. Two diagnostics come with it,
both advice rather than gates: EXTRA_PEAK_ON_REFLECTION (the component sits
on a line your model already predicts, which is a degeneracy and is legitimate
when the overlap is real) and EXTRA_PEAK_NO_INTENSITY (the area refined to
zero, so the centre is not a measurement).
What it is measured to do, and what it is not. On the SRM 660c protocol
with two holder lines injected onto reflections, declaring them recovers the
clean-pattern cell to −1.0 ppm where ignoring them costs +7.6 ppm and inflates
the cell esd 7.5×. Excluding the regions instead also recovers it, to
+0.6 ppm, for 4.8 % of the channels. So on a pattern as reflection-rich as LaB6
what you gain is the retained channels and a measured intruder, not cell
accuracy. The gain grows as the reflection count falls, which is the operando
case this was built for.
A refinement another program wrote, opened by content
model = rx.read_project_model("refined.inp") # or .pcrread_project_model works out which program wrote a file and returns its
phases, sites, refine flags and the data files it points at.
identify_project_format answers the question without reading the model, and
read_topas_inp, read_fullprof_pcr and read_gsas_prm are the individual
readers. Dispatch is by content, never by suffix: several unrelated
programs write .inp.
What a reader could not carry it says so about, in the same diagnostics channel
the pattern readers use — TOPAS_FEATURE_REFUSED, TOPAS_BLOCK_SKIPPED,
TOPAS_CELL_COUPLING_DROPPED, TOPAS_ORIGIN_TRANSLATED,
FULLPROF_TIE_DROPPED, FULLPROF_ORIGIN_CHOICE,
FULLPROF_OCCUPANCY_UNCHECKED, GSAS_PRM_FIELD_DROPPED,
GSAS_PRM_GEOMETRY_ASSUMED, and the two species normalisations. This surface
is provisional: it is new, and the compatibility chapter says plainly that
it may change.
Two more vendor pattern formats
PANalytical .udf and Philips .rd/.sd (V3 and V5), plus three things
declined by name rather than by traceback: a binary .raw that matched no
reader, and the peak-list formats .pks and .udi, which are tables of
reflections rather than measured profiles.
The .rd intensities are √-compressed. Read the obvious way — the way the
only permissively-licensed description of the format reads them — every peak
lands in the right place and every intensity is wrong, with no symptom: the
profile looks like a diffraction pattern and the fit converges. This reader is
checked channel for channel against the IUCr CPD kit's own ASCII conversions of
the same scans, 15 of 16 bit for bit and the sixteenth off by one count on 2108
channels from a different rounding rule in the kit.
A joint fit shares the size, not the coefficient
This changes numbers. A specimen has one crystallite size, and a size
coefficient is (180/π)·K·λ/L — so in a joint fit over histograms at different
wavelengths, sharing the coefficient shares the wrong thing. A joint fit now
shares the size itself, scaling each histogram's coefficient by λ_h/λ_0, and
says so with SIZE_NORMALISED_ACROSS_WAVELENGTHS. Both strains and Stephens'
Λ(hkl) are λ-free and stay shared as they were.
Left unfixed, one specimen came back at 363.3 Å against 623.9 Å for the same
material, converged, with Rwp 1.8× worse on the long-wavelength histogram and
4.7× worse for the Gaussian size term. A single-histogram fit is unaffected.
Beside it, RefinementResult.microstructure reports each phase's size and
strain readings with exact single-parameter esds, the Gaussian and Lorentzian
readings compared rather than combined (size_agreement), and a verdict on
whether size and strain are separable in this fit at all.
Named variables
A parameter of your own, outside the model tree, that other parameters follow:
ref.add_variable("B_metal", 0.7, min=0.0, max=25.0)
ref.tie_equal(["phases.0.atoms.0.biso", "phases.0.atoms.1.biso"],
source="vars.B_metal")
ref.tie("phases.0.atoms.3.biso", "vars.B_metal", scale=2.0)
ref.set_vary("vars.*", True)The path is "vars." + name and behaves like any other dot-path: parameters()
lists it, set_vary globs it, a fit refines it and gives it an esd. This is
TOPAS's prm, and it exists so a constraint can be written in terms of a
quantity rather than in terms of whichever model parameter happened to be
nominated as the master.
Smaller changes worth knowing
- A neutron fit names a resonant absorber (
NEUTRON_RESONANT_ABSORBER):
the tabulated b is the real part of the thermal value and is incomplete near
the resonance, which the fit now says rather than using it silently. - A missing species falls back to the neutral atom and says so
(SPECIES_FALLBACK_NEUTRAL), where it used to swallow the substitution. - The region below the first reflection is diagnosed
(LOW_ANGLE_UNMODELLED) when it carries misfit nothing in the model can
reach. - Two symmetry silences are reported: a site sitting within tolerance of a
special position and expanded at it, so the multiplicity is the special one
(SITE_SNAPPED_TO_SPECIAL_POSITION), and a symbol the tables hold in more
than one setting, resolved to one of them (SPACE_GROUP_SETTING_ASSUMED). - Path dependence is judged per pattern, and only where both chains measured
an esd. Adirection="both"series compares the same pattern in each
chain, so a path can be reported on for part of a series and stay silent for
the rest rather than being judged on a chain that never refined it. Refinement.summary()accepts a report you already built
(summary(report=...)), so a caller that has one does not pay for a second.- A compile fault names the atom it came from, with a spelling hint that
resolves before it is offered. - Magnetic symmetry groundwork:
crystallography.magneticconverts
magnetic space-group identifiers into operator lists and back, and gives a
site's allowed moment basis. No magnetic refinement ships in this release;
this is the layer the magnetic WPs stand on.
The manual
Both parts were rewritten out of the compressed register the repository's own
rulebooks are written in, and twelve defects reported against the theory part
are fixed.
Every Source: line is a link into the code. All 105 of them resolve their
dotted name through inspect at build time, so an equation reaches the function
that computes it in one click. A renamed symbol now fails the build naming the
symbol and the chapter line, rather than leaving a dead link on a published
page.
Two equations printed their own substitution names. A MyST substitution is
not substituted inside a {math} directive, so (3.3) and (3.4) in
Peak profiles typeset
STRAINCAPRANGEFRACTION as a product of italic letters. Four further equations
ran under their own number, the worst 179 px into it in a 736 px column.
The Thompson-Cox-Hastings attribution is corrected from the paper. TCH
(1987) credit the pseudo-Voigt to Wertheim, Butler, West & Buchanan (1974) and
the mixing expansion to Hasti...