Repository navigation
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 number it had.
VerificationOutcome.acceptedfrompredict_then_verifyandBodyMisfitRow.firesfromrigid_body_misfitare nowbool | None, andNonemeans "not judged" where a short fit could flip the 1 % χ² rule.
Code that testsif outcome.accepted:still works, and code that testsaccepted is Falseornot row.firesnow also meetsNone. -
Code reading
RefinedParameter.stderrorParameterRow.esdas a number on every refined row (WP-2219).
A row on a discarded direction now carriesNone, as an unmeasured row did. -
A merged Pawley member's
ReflectionState.stderrrow readsinf(WP-2315, #1869).
A member's ownintensityrow is its share of the group's sum by multiplicity (equal F²), and a checkout restores it.
The measured sum and its esd are inReflectionState.merged_groups, which is[]where a Pawley phase merged nothing andNonefor Le Bail and for a node written before.
n_freefalls by the number of merged columns. -
What a pattern reader repaired or noticed now reaches every fit's
result.diagnostics(WP-2304, #1842).
1.12.0 reportedPATTERN_INTENSITY_SCALED,PATTERN_SIGMA_CONSTANTandPATTERN_SIGMA_NONPOSITIVEonly if the caller passeddiagnostics=toread_pattern.
read_patternnow keeps them onPatternData.diagnosticson every call, andfit,run_stage,cherry_pick,replay, each series member and each pattern of a joint fit copy them into the result.
A note is left out where the fit already raised the same code, where the fit asks the question itself, and where the caller already took its advice.
A fit on a file with one of these conditions has a diagnostic it did not have in 1.12.0, so code that countsresult.diagnosticsmay see one more.
Numbers that move
-
Every default fit (WP-2222).
With no closing stage, a fit is 1.2-1.9× faster than in 1.12 (11-BM NAC 0.53→0.43 s, CPD cpd-1a 1.65→0.97 s, cpd-2 3.5→2.1 s on an arm64 Mac), and its answer moves by 0.16-2.0 plain esd.
Refinement.run_stageand a FitReport action applied in the GUI now run on the declared stages' 2 % windows instead of 1e-3.
A project saved with a plan under 1.10-1.12 storedclosing_window_tol: 0.001and keeps its closing stage until that line is set tonone. -
The last stage of a plan stops when no free parameter would move by 0.1 of its esd (WP-2317 R6, #1890).
1.12.0 stopped every stage when χ² fell by less than 1e-9 of itself on three steps in a row.
Now the last declared stage stops at the first point where the next undamped Gauss-Newton step would shift no free parameter by 0.1 of its esd, McCusker et al. (1999) §7's test of a converged refinement.
The esd it reads takes χ²_red at no more than 1, so a fit that is still far from the data cannot stop on it.
A stage that declares its ownftolkeeps it.
Single fits end 5 to 14 % earlier and land within 0.035 esd of the old answer, with Rwp within 4e-6.
Evaluations before and after: SRM 660c 71 to 67, fluorapatite 40 to 35, 11-BM NAC 49 to 44, cpd-1a 165 to 145.
The GSAS-II tutorial's 17-pattern CuCr₂O₄ ramp takes 848 evaluations where it took 1 326, and an 8-pattern cpd-1 chain 453 where it took 504.
On the ramp the worst quantity moves 0.68 esd (the cell of a 1 wt% CuO phase on the last pattern), the main-phase cell 0.006 esd and the weight fractions 0.071 esd.
On the chain the worst is 0.13 esd (axial_sl), the cells 0.030 esd and the weight fractions 0.027 esd.
The final shift a fit reports (Statistics.max_shift_over_esd, checkCIF's_refine_ls_shift/su_max) measured under 0.03 on every fit tried, for example 0.003 on SRM 660c and 0.011 on fluorapatite.
Three places keep the 1e-9 stop, because an error there carries into later fits:lab_calibrate, a series that carries Pawley intensities, and the guides that print numbers.
shift_over_esd_tol=Noneon a plan or onrun_stage, orshift nonein the.rxtdocument, brings the 1e-9 stop back for any other fit.
solver="trf"has no such test, and recordsNone. -
A stage's peak windows are sized to the movement its parameters can make, and a stage that outgrew them is solved once more (WP-2317 R7, #1881).
A stage freezes its peak windows at its start.
A stage that a later stage refits now sizes each window's room from the position parameters it frees: 3 FWHM per family (zero, displacement, transparency, capillary offsets, cell or λ), plus half a point step, capped at the old uniform 0.3°.
The last stage, a stage run on its own, a joint fit, a shift equation and a declaredwindow_slack_degkeep the 0.3° window.
A stage whose frozen windows drop more than its tolerance of a peak's area at its answer solves once more on fresh windows, andStageResult.window_refit_lossrecords the loss that triggered it.
Points computed per evaluation fall to 0.20-0.22× on 11-BM NAC, 0.76-0.85× on SRM 660c and 0.98-0.996× elsewhere.
Refined values move under 0.06 esd, and background coefficients under 0.08 esd.
On the cpd-1 chain and the CuCr₂O₄ ramp the largest mean shift from the uniform window is 0.059 esd and 0.005 esd.
The re-solve makes a solo width stage read a synthetic 400 Å size as 400.35 and 401.91 Å, where it read about 409 Å.
STAGE_WINDOWS_STALEno longer fires where the stage's last solve already runs on windows that hold its peaks.
A Le Bail fit withlebail_passesabove 1 that starts from a cell 0.15 % low now ends with theLEBAIL_ALTERNATION_STOPPEDwarning where it ended withinfo. -
A Le Bail fit's intensity partition now solves for its fixed point by projected Newton, after plain cycles have moved the intensities most of the way (WP-2316).
The plain cycles stopped on a step that slows to a crawl where reflections overlap, so a partition could stop short of its fixed point.
On BT-1 LaMnO₃ the closing partition ran into its 25 000-cycle cap and raisedLEBAIL_CYCLES_AT_CAP.
Every partition now reaches the fixed point, so Le Bail answers move by up to 0.66 esd, each to a likelihood no lower than before.
Rwp moves by at most 0.02 points on the nine patterns measured.
Dense patterns fit faster: BT-1 LaMnO₃ in 6.6 s against 85.9 s, and an 886-reflection cell to 120° in 3.8 s against 61.0 s.
lebail_tolnow bounds the share a Newton step moves, and a Newton iteration counts as a cycle inlebail_cyclesandStageResult.lebail_cycles_run. -
Pawley refines reflections that coincide in every cell as one intensity (WP-2315, #1869).
Some reflections have the same d for every cell their space group allows, such as cubic 333 and 511, or hkl and khl under 4/m.
The pattern sees only their sum, so each group now refines as one Pawley column that carries it, as GSAS-II does.
A phase with a Stephens block, a peak equation, satellites or a magnetic component keeps one column per member.
Fluorapatite drops from 329 to 206 columns, SRM 660c from 30 to 24 and corundum (SRM 676a) from 64 to 60.
Fluorapatite'samoves 0.007 esd andc0.016 esd, closer to GSAS-II's value; SRM 660c's and corundum's cells are unchanged to 1e-12.
A merge is not an unresolved overlap, soPAWLEY_OVERLAP_UNRESOLVEDnow fires for accidental overlaps only. -
A Pawley overlap group's restraint scale is relative to its phase (WP-2311, #1857).
The equal-split restraint on overlapped reflections scaled each group by its own mean intensity, floored at an absolute 1e-10.
A start that partitioned nothing, such as a background far above the data, left whole groups on the floor with rows weighing 5e9, and the group's sum could not move.
The floor is now 1e-4 of the phase's largest on-data intensity, and a phase whose on-data intensities all sit on the Le Bail floor gets no group rows for that stage.
With the pattern, σ and background scaled together, a Pawley fit is now the same at every factor from 1 to 1e-4.
Rwp moves by -1.8e-4 on 11-BM NAC and -2e-6 on fluorapatite, and no unmatched count or status moves. -
A parameter on a combination the data do not determine has no esd (WP-2219).
ItsRefinedParameter.stderrisNone, as a parameter the data never moved already was.
So is a tie built on it and a quantity derived from it, unless the data determine that combination (WP-2230).
COVARIANCE_DIRECTION_DISCARDEDnames these parameters, in single, joint and Pawley fits.
Before, each kept the esd of the directions the data did measure, short by a factor nothing bounds.
On synthetic LaB₆ with W,gauss_sizeandgauss_strainfree, two starts landed 140 of those esds apart in W.
Those three now have no esd.
An unheld floating origin is another case: neither atom's coordinate along the polar axis has an esd, andhold_floating_origin()gives one. -
A tie or a derived number the data determine keeps its esd although its sources have none (WP-2230).
A combination of such parameters can still be determined:zero_shift = za + zb + zcis, when no single term is.
Such a tie now reports the esd of the combination, as do a bond length, a cell volume and a moment pair's quadrature sum built the same way.
On synthetic LaB₆ the tied zero shift's esd is 1.0002× the esd of a fit that frees the zero shift alone.
Each source parameter still has no esd.
A geometry row or cell volume kept this way has nostderr_diagonal, because the sources' own variances are not measured. -
A joint fit on the blocked layout reports the same esds as the dense one on a flat direction (WP-2028, #1668).
A joint fit whose dense Jacobian passes 256 MiB inverts each pattern's own block, then the shared block.
Where the shared block has an exactly flat combination, such as W withgauss_sizeandgauss_strain, that path answered as if the shared column were held and gave it only rounding.
On three LaB₆ patterns with W shared it read ± 2.7e-17 and now reads ± 3.924e-7, equal to the dense path's.
The fit itself does not move.
The correlations of the columns on the discarded direction, which columnsCOVARIANCE_DIRECTION_DISCARDEDnames, and whetherFLAT_DIRECTIONfires on a rounding correlation change with it. -
A joint fit's identifiability carrier is filled in (WP-2028).
It holds the worst correlations and the softest modes of the joint matrix, named by the joint paths, and each pattern's declared-peak screen, keyedhist.<h>.like its background screen.
In 1.12.0 those three tables were empty on a joint fit.
for_histogram(h)keeps each pair and mode that touches that pattern's rows or a shared one, whole, its own rows bare (nohist.<h>.prefix), and leaves out one made only of other patterns' own rows.
A joint report's summary can therefore gain a soft-mode sentence it did not have in 1.12.0. -
A joint fit that frees a Stephens anisotropic-strain block treats it as a single fit does (WP-2239, #1781, issue #1663).
Stage.strain_seednow seeds each Stephens coefficient of a joint stage, so a block starting at zero no longer sits on the square root's unbounded slope.
A shared block is seeded in every histogram or in none, from histogram 0's isotropic ray when cells differ.
The default driver also holds σ²(M) ≥ 0 and the texture positivity rows in every histogram, where 1.12.0 held neither in a joint fit.
On a two-pattern fixture the stage took 5 iterations where it took 32, and the values, esds and Rwp agree to the printed digits.
TheSTEPHENS_STRAIN_NOT_POSITIVEsuggestion no longer tells the reader to fit each histogram alone. -
A fit whose peak width comes from a width equation can no longer step through the width floor under the default driver (WP-2153, #1784).
The default driver holds each peak's total width positive inside the step, and its rows now include a peak equation's term wherever it is exact at the stage's frozen angles.
Any other term is left out, andPEAK_WIDTH_NOT_POSITIVEstill reports it at the answer.
On a synthetic LaB₆ fixture with U, V, W held and a width equation carrying the Gaussian width, the default driver now reaches Rwp 0.0416, within 0.0025 esd ofsolver="trf", where it stalled at Rwp 0.195. -
A fit that frees an FCJ axial ratio sitting on zero now returns a different answer (#1075; WP-1955).
A stage that newly frees S/L or H/L on zero (or on a positive lower bound) starts S/L at 0.02 and H/L at 0.01 (a start that would equal the other ratio's value takes the other number), and records the rows inStageResult.seeded.
Before, the column at zero was nearly zero, and a Gauss-Newton fit could endconvergedon zero with an esd of order 1.
The aperture columns themselves are now a second-order difference, within 5e-4 of the exact column at one zero aperture, so an esd moves where it was read off them.
Fits that start both ratios positive are unchanged to under 0.02 esd on LaB₆, fluorapatite and cpd-1a.
In a joint fit the two histograms of one instrument may end on opposite orders of the pair, which the pair's symmetry allows. -
A value held in a series stays held when a pattern is refitted from your own models (WP-2081).
When warm starts from the neighbour fail, a series refits the pattern from the models you passed in.
A parameter held withref.holdin theconstrainhook used to take your starting value on that refit, and the next pattern carried it on.
It now keeps the last accepted pattern's value, unlesscarryleaves the path out or a hook set the value for that pattern.
Theverify_stepsrefits hold the value the series held on their own pattern.
On a LaB₆ ramp with a held zero shift of 0.00797°, the restarted pattern used to hold 0.0 and its cell sat 546 ppm off; it now holds 0.00797° and the cell is within 2 ppm.
SeriesEntry.held_valuesrecords every held path's value on each pattern. -
ExtinctionScreen.best_or_none()names the leading extinction class only when its ΔBIC lead over the runner-up strictly exceeds max(10, 2·ln N + d), with N the fitted points and d the tested positions where the two classes differ (WP-2076).
A position that shows nothing buys a class ln N and no more, so a lead built from two silent positions no longer decides.
GSAS-II's PbSO₄ X-ray pattern, which named the wrongP c - aat the old margin of 10, now returnsNone, andEXTINCTION_SYMBOL_AMBIGUOUSgives the bar and names the two positions.
Corundum (SRM 676a) and 11-BM NAC keep their classes. -
Under a whole-run ceiling, each indexing engine gets a share of it on each crystal system (#1374).
Withtotal_budget_secondsdeclared, one engine's search of one system now runs for at mostbudget_secondsor the search's time divided by the number of engines, whichever is shorter.
Before, a caller who raisedbudget_secondsto the ceiling let the first unfinished search hold all of it, so the other engines never started and the run could return no cell.
On 15 synthetic rows the share was never worse; it found the cell in 3 of the 5 rows that returned nothing and added a second finder in 9 of the other 10.
The default 30 s slice is below the share of thequickceiling (34 s), so a default run is unchanged, and so is a run with no ceiling.
To give one engine the whole search, name it inengines.
INDEX_BUDGET_EXHAUSTEDstates the share when it bound. -
After a fit,
Refinement.predicton the fit's own grid returns the fitted curve (WP-2235, #1773, issue #1652).
In 1.12.0predict(result.two_theta)compiled at the default peak cut (1e-3 of each peak's area), while the fit'sy_calccame from the cut of its last stage, so the two differed in the tails.
On the fluorapatite tutorial all 5751 channels differed, by at most 1.4e-3 of the strongest peak; they now agree bit for bit.
predict(grid)takes the peak cut of the last stage at or above the working state, soset_values, a checkout and a reopened project keep it.
ARefinementthat has never fitted still compiles at the default cut. -
Under the opt-in
shape="voigt", a peak's reported width is Olivero & Longbothum's formula (WP-1926, #1605, issue #790).
It was the Thompson-Cox-Hastings quintic's width, 0.43 % off the exact Voigt width at worst; the formula (Olivero & Longbothum 1977, J. Quant. Spectrosc. Radiat. Transfer 17, 233) is 0.024 % off at worst.
The width diagnostics,effective_observationsand the satellite and magnetic reports read this width, so under"voigt"each can move by up to 0.43 %.
The fit itself does not move, and under the defaultshape="tchz_pv"nothing changes. -
The GUI's preview draws at the fit's own peak cut (WP-2226, #1751).
The Interactive-tab preview drew at 0.1 % windows while a default fit computes at 2 %, so before any slider moved the preview's curve and Rwp header differed from the fit's (on fluorapatite, 9.380 % against the fit's 9.250 %).
The preview now matches the fit at the head bit for bit, and a reopened project draws at the right cut too.
A moved peak's window is rebuilt wherever the sizing rule gives a different window at the new value.
Files that change
-
1.12.0 refuses every file this release writes, and this release opens every file 1.12.0 wrote.
Measured on a synthetic fit's files, written by each of 1.12.0 (from PyPI) and 1.13.0 and read by the other.
A structure carriespeak_equationson every phase and an instrument carries it too, as an empty list when none is declared (WP-2107).
A pattern carriesdiagnostics(WP-2304), and a result's stages carryshift_over_esd_tolandwindow_refit_loss(WP-2317).
A series entry carriesheld_values(WP-2081), a project's plan carriesshift_over_esd_tol, and a history node carriesmovement_slackandshift_over_esd_tol, withmerged_groupson a Pawley node (WP-2315).
1.12.0 forbids unknown keys, so it refuses each of them (docs/contracts/schema.md, 0.61 → 0.62). -
A saved plan with no
shift_over_esd_tolreads 0.1 (WP-2317 R6, #1890).
Aproject.jsonplan without the key takes the new stop on its next fit.
A history node without it readsNone, the 1e-9 stop it ran, soreplayof an old node is as it was, and the same holds formovement_slack, which readsFalse.
The.rxtdocument shows ashiftline only where the value is not 0.1. -
A refined value with no esd writes
?in its CIF su item (WP-2219), such as_atom_site_U_iso_or_equiv_su.
The value itself is written bare, and the other rows of that loop write their su in the same column. -
The reflection-table export gains a
merged_groupcolumn (WP-2315, #1869).
The rows of one merged Pawley group share a number there, empty for every other row, and their summedintensityis the measurement.
Requirements that rise
- rietx needs
gemmi0.6.6 or later, where it accepted 0.6.5 (WP-1933, #913).
Under 0.6.5 everystructure_from_cifcall raisedAttributeError, so no install that read a CIF is affected.
New
-
An equation over a reflection (WP-2107, #1635).
rx.PeakEquation(target, expression, coefficients)sets a peak's width, position or intensity from itsh,k,l,m,d,thetaandtwo_theta.
The targets arelor_fwhm,gauss_fwhm,gauss_fwhm_squared,shiftandintensity_factor, and an instrument-level equation takesshiftonly.
Each coefficient is a table entry with an exact derivative.
An equation that differs between the images of one Laue orbit is refused, naming the reflection;orbit_mean(...)averages over the orbit andharmonic(l, n)reads a symmetric harmonic of the direction.
Three diagnostics are new:PEAK_WIDTH_NOT_POSITIVE,QPA_INTENSITY_FACTORand, in a joint fit across wavelengths,PEAK_EQUATION_SHARED_ACROSS_WAVELENGTHS.
Each target agrees in Y_calc with the built-in term of the same physics to under 1e-12 relative.
The guide isguides/peak_equation.md. -
A phase's peak equation reads
wavelength(WP-2152, #1785).
wavelengthis the λ in Å of the emission line the peak is drawn at, so a Kα2 image reads its own.
A size term is then written once, asy*wavelength/cos(theta), withyshared by patterns at several wavelengths.
An instrument-level equation cannot read it, and a coefficient namedwavelengthis refused.
PEAK_EQUATION_SHARED_ACROSS_WAVELENGTHSis silent on an equation that readswavelength, so it also misses a size term in degrees written beside it, as+ x/cos(theta). -
A fit names a coefficient or variable no stage freed (WP-2101, #1714).
A coefficient refines only where a stage frees it, so an equation whose target no plan stage reached, or a formula variable left atvary=False, used to end the fit at its starting values with nothing said.
The new warningVARIABLE_NOT_FREEDfires in a joint fit, once per parametric equation with a coefficient no stage'sfreedorheldnames, and in a single fit, once pervars.variable that other parameters follow.
No preset plan frees avars.row, so a single-fit variable keeps its start unless a stage'sturn_onnames it, even atvary=True.
A variable held withref.hold("vars.<name>")is not named, since the hold says its start is meant. -
A fit says when it held an instrument width beside a specimen width of the same shape (WP-2225, #1722).
A plan can free U, X or Y beside the specimen width with the same angular shape.
Since 1.10 the stage then holds the instrument half of the pair, so the specimen widths are what the plan's stage order left over.
Such a fit now carries the warningINSTRUMENT_WIDTH_HELD.
It names the held width terms, the specimen widths beside them and the stage whose values they keep, and suggests calibrating the instrument on a standard first.
It is a warning under the microstructure and calibration purposes, and moves no number.
While it fires,summary(deliverable="microstructure")prints the size and strain as not quotable.
Of the eightrietx comparestandards, it fires on zincite, fluorite, corundum and brucite. -
render_structurewrites an SVG (WP-1536, #1606):render_structure(structure, path="figure.svg").
Each atom is a shaded ellipse, each bond a run of short stick pieces, each polyhedron face a translucent polygon, and the letters are text.
Every element carries a class naming its kind and site (atom Ti1,stick O1,face TiO₆,cell).
The suffix picks the format,.pngor.svg, and any other suffix is refused naming both.
The manual'sfigures.mdsays what the SVG holds. -
The Kβ and W Lα ghost screen can be judged against the pattern's own coincidences (WP-1447, #1609).
rietx.background.ghost_control(...)counts the screen's consensus at the real wavelength ratio and atkmade-up ratios on the same peak list.
It returns aGhostControlper search with a Monte Carlo p-value (ghost_p_value, North, Curtis and Sham 2002) anddecide(alpha=, floor=).
k,alpha, the span and the floor are the caller's arguments and the picker does not read them, so no picked peak moves.
On the 16 CPD round-robin patterns withk=199the smallest p-value on a clean pattern is 0.145, and a Kβ image injected at 10 % gives p = 0.005 on all 16. -
rietx runssummarises a batch's runs (WP-1464, #1695).
rietx runs [dir] [--label NAME] [--json]reads the recorded runs under a directory, one block perlabel=.
Each block counts the runs by state, gives the wall clock from first start to last end, and names the slowest run with its ratio to the median.
Failed runs are timed too.
--labeltakes a glob, so--label 'screen-1/*'gathers a screen whose runs are each named after their candidate.
rietx.runs.job_summaryreturns the same summary in Python.
Checked while a job runs, it addsrunning: N, longest so far …with that run's ratio to the median, so a runaway shows before it ends.
A run whose process died readsabandonedand is not counted as running. -
The GUI's Series panel has a trace along the series (WP-1317, #1395).
It draws every pattern of the chain, failed ones included, on the experiment's own axis, with the series verdicts as glyphs, each pattern's own findings as bars and the largest step of the parameter on show as a band.
Dragging along it, or the arrow keys, Home and End, shows each pattern's own fit in the plot below with the reader's zoom kept, and a row's History button still opens that pattern's tree. -
The rebuilt GUI at
/nextgains its peaks-and-indexing workflow, a series workflow, a History tab, a Python-shaped Console, and its Plan, Text and Instrument pieces (WP-2211, WP-2212, WP-2218, WP-2227, WP-2231, WP-2240, WP-2243, WP-2244).
The page opens withrietx gui --new; it is still unfinished,/is still the default, and the manual does not yet document/next.
Pick peaks, Fit peaks, Index and Judge run the peaks-and-indexing workflow, with click, drag and Option-click edits on the Pattern graph, and ⌘Z and ⇧⌘Z undo and redo any peak edit.
Judge shows one candidate's cell with esds, grade and caveats, its Le Bail check and the extinction classes by ΔBIC, and Adopt as a Le Bail start waits for Apply.
The series workflow has Patterns, Run and Results steps, a Map of every staged pattern on one 2θ axis, and a Trends tab that plots any refined value against the series coordinate with esd bars.
The History tab draws the node graph or table, overlays a node's calculated curve on the Pattern graph (Compare), and loads a node's differing values as pending edits (Restore).
The Console shows each call as Python, folds a fit's engine events under the call that started it, and exports the calls through File › Export › "Console as a Python script".
A Refine on a model the last fit converged runs one stage there, and the Pattern graph says which way the run went.
The Plan tab reads as a recipe of stage blocks with Free and Fix chips, and the Text tab shows the project as.rxttext whose typed changes preview on the plot and count as one pending edit.
The Instrument band's ⋯ menu opens a dialog for source, geometry, peak shape and loading an instrument profile.
(#1684, #1755, #1763, #1764, #1769, #1772, #1776, #1788, #1791, #1792, #1794, #1803, #1820, #1823, #1825.)
Magnetic structures
-
The magCIF readers find a propagation vector by its loop's header and skip comments and a text field's opening line (#1378, follow-ups of #1284).
A magCIF that read in 1.12.0 can now be refused: a k ≠ 0 listed before itsidin a loop read as Γ, and now reaches the supercell refusal.
A magCIF that was refused can now read: a commented-out k line no longer counts as a k.
A quoted bracketed k,'[1/2 0 0]', still reads as k. -
A magCIF whose stated
_space_group_magn.number_BNSornumber_OGis not the group its operator and centring loops generate is now refused with aMagCifError(#193).
It used to load under the operators' number with aCIF_MAGNETIC_NUMBER_MISMATCHwarning.
The reader cannot tell which side is wrong, and a forgotten anti-centring line makes the operators the wrong, smaller group.
The message names the file, the stated number and its tag, the group the loops generate, and each side's operation count per cell, so one corrected line makes the file readable.
A file in a non-standard setting of its stated group still loads. -
A phase whose space group is an operation list no tabulated setting names can be reported and written to CIF (WP-2221, #1721, issue #1688).
report()used to raise and drop the whole FitReport for such a phase.
The NiO magnetic child on rhombohedral axes (BNS 2.7,R-3m [unnamed in 2a,a+b,a+c]) and the displacive children of WP-1419 (Cm [unnamed in 2a,a+b,a+c]) are of this kind.
The crystal system now comes from the operators' rotation traces, which agree with gemmi's on all 564 tabulated settings.
A call that needs a setting (hm,ext,number,monoclinic_unique_axis,cell_constraints) still refuses such a list, and the message now names the crystal system and points atPhase.parent_cell.
The GUI's symmetry panel still shows an error row for these children. -
A fit with a separate magnetic width is faster where the magnetic group forbids rows.
The second family of windows (magnetic_lor_size,magnetic_lor_strain) is now built only on reflections whose Laue orbit has a member the magnetic space group lets scatter.
A k ≠ 0 structure such as NiO at k = (½ ½ ½) no longer evaluates a magnetic window on every nuclear reflection.
A dropped row's magnetic intensity is zero by symmetry, so no refined value moves beyond floating-point summation order.
rietx.crystallography.magnetic.isotropy.group_absencesnow decides exactly, by a cyclotomic character sum in integer arithmetic (rietx.crystallography.magnetic.operators.magnetically_allowed), instead of a 1e-9 cut on singular values.
Its answers are unchanged on every group tested. -
Scores for a k-vector search on a rational grid (WP-1418, #1549, #1703, #1732, #1734).
rietx.indexing.kvector, imported by its path and not exported fromrietx, holds the first half of the k-search.
kgrid_strata(space_group, denominator=n)lists one representative for each class of rational k on the (1/n)³ grid, n ≤ 64, under the star, -k and G - k, grouped by the little co-group at that k.
kgrid_positionsbuilds the satellite positions once,score_kvectorscores one k andscore_kgridscores every grid k, with a local Poisson-binomial chance model over a band about each peak.
kgrid_nullshuffles the peaks to give the null's grid maximum, andkvector_equivalents(parent, k, tol=...)lists the other k a near-symmetry of the cell's metric maps k onto, reported as the info diagnosticK_SEARCH_PARTNER.
Nothing here ranks or picks:KGridScoresandKNullhave no.kor.best, andradius,band_deg,tol, the shuffle count and the percentile are the caller's.
Each grid record carriesgrid_step,denominators,strata_searched,strata_leftand acoveragesentence that claims nothing about a k off the grid.
On a synthetic Pnma pattern the planted k on the 1/64 grid scores 9.61 against a 99th-percentile null of 5.09, and a pattern with no satellites put 0 of 200 maxima above its own null.
kgrid_boundgives an analytic chance level for the k ascore_kgridrun scored: log₁₀(n_s / (wₛ·α)) per stratum, which by Boole's inequality chance reaches anywhere on them with probability at most α.
alphaand theweightingof α across strata ("flat"or"stratum") are the caller's.
score_kvectorandscore_kgridtakeexclude=, the windows the peaks were sorted off, andkgrid_null(exclude_in_score=True)scores its shuffles the same way.
A budget stops a k-grid search inside a stratum:score_kgridandkgrid_nullread theirbudgetbefore every block of 2048 k, and a stratum stopped part-way is reported instrata_cutand incoverage.
Changed
-
A large cell's structural Jacobian is cheaper, and its tied columns are exact (WP-2314, #1862, #1876, #1882, #1884).
Each coordinate and ADP column used to re-run the structure factor over every site to get one atom's derivative, and to rebuild the intensity factors for itself.
One pass over the sites per phase per Jacobian now serves every such column, and the columns of one phase share one pass through the intensity chain.
Both steps are byte-identical: on a 40-atom P2₁2₁2₁ test structure to 90° the first took the fit from 29.7-29.9 s to 11.2-11.3 s with the same sha256 over all 83 Jacobians, and the second makes one Jacobian 1.21-1.35× faster.
Biso and occupancy columns, and columns that move several atoms (a co-sited coordinate tie, a named variable over several sites, a distortion-mode amplitude), are now analytic, where they were finite differences of the phase's structure factor.
Those columns were up to 7.1e-5 off in relative terms and are now exact to 4e-10 against a Richardson difference, so converged values that read them move by at most 2.3e-4 esd.
On a simulated Nb₁₈W₁₆O₉₃ cell (COD 2107344, 43 sites, 219 parameters) these two steps took the fit from 17.7-18.5 s to 11.1-11.2 s and from 10.6-11.6 s to 7.2-7.4 s, each on the tree of its day.
Rigid-body, Z-matrix and cell columns still take the finite difference. -
A large Pawley fit builds its preconditioner far less often, and decomposes its normal matrix once (WP-2315, #1878, #1883).
The projected conjugate-gradient step rebuilt its incomplete-LU preconditioner each time it cut an intensity onto its zero floor.
It now rebuilds only when the free set gains a variable, so 1 290 builds fall to 67.
The covariance and the test for directions the data do not move now read one eigendecomposition, bit-identically.
On the Nb₁₈W₁₆O₉₃ cell to 120° the fit took 14.25-14.73 s, then 7.87-8.28 s, then 6.78-6.82 s.
Parameters move by at most 2.4e-7 esd, and Rwp by at most 7.2e-10 in relative terms. -
A FullProf
.pcr'sNrehard limits are applied as bounds where FullProf's manual maps them (WP-2058, the follow-up of #1199).
1.12.0 read these limits and applied none (it reportedFULLPROF_LIMITS_NOT_APPLIED), so the same file now builds aStructurewith bounds it did not have, and a refit can land elsewhere.
FullProf clamps a limited parameter in least squares, not only in simulated annealing (fp2k 8.20 on its ownce1.pcr,docs/practice.md§ Limits a control file declares), so a file read without its limits fits a different model from the one its author ran.
to_structuresets each limit as theminandmaxof the first value from the top of the file carrying its parameter number at multiplier +1, where that value is a cell entry rietx refines, aBisoor Marchr(FullProf manual p. 126).
Every other limit is reported with its reason, one diagnostic per limit:FULLPROF_LIMITS_NOT_APPLIED(info), or the newFULLPROF_BINDING_LIMIT_NOT_APPLIED(warning) where the file's value sits on the limit or past it.
rietx.io.projects.fullprof.limit_readings(model)says where each limit lands. -
A linear rigid body typed within the site tolerance of its mirror or axis now builds (WP-1807, #1551, issue #1386).
RigidBodyBlockcompared the sines of a linear body's tilt with the fractionalSITE_TOL, which mixes radians with a fraction of a cell edge, so it disagreed with the site check whenever the body was short against its cell.
A CO₂-like body on the P n m a mirror passed the site check but was refused withRIGID_BODY_NOT_INVARIANTwhen one O was typed 4e-5 off the mirror at b = 6 Å.
The tilt is now held to the bound the site snap can give it, and the refusal says how far the axis is tilted and names the atom lying furthest off. -
RigidBodyBlock(site_reach=None)is the default, and means the body's atoms were not typed on a site (WP-1807, #1551's review).
The old default,0.0, refused a linear body typed exactly along or across its site's one turn axis, because the axis read back from its quaternion is off by rounding (5.5e-17 rad measured on Linux, up to 5.9e-16 rad on macOS arm64).
With no reach, the axis test does not apply and the body takes the nearer case: one turn about the axis, or none.
An explicit number keeps the test, and a structure's rigid bodies, which pass one whenever the site fixes a direction, build as before. -
The GUI's Series panel showed the wrong fit for every pattern after a failed one in 1.12.0 (#1396, fixed in #1395).
The GUI's server indexed the session's results by position and the staged members by their chain index, and the two disagree after a failed pattern, so each member after one showed its neighbour's fit.
A series with no failed pattern was never affected, and the library'sSeriesResultwas right throughout.
If you looked at a series with a failure in the 1.12.0 GUI, look at it again here. -
Opening another project in a GUI window shows that project in every panel (WP-2242, #1793).
A panel that reloaded when the history's head node changed kept the last project's parameters, plan, history and text whenever the two projects' histories had the same length, since node ids repeat across projects.
The Report tab could also undo a suggestion by checking out a node id from the last project's history in the new one.
Each page now rebuilds every per-project panel when another project opens; in 1.12.0 the workaround was to reload the page. -
The GUI's Console keeps receiving events after another project opens (WP-2237, #1787).
Opening a project used to renumber the event stream from 1, so the Console missed the new project's first events or counted a false gap.
The event count now keeps rising across an open, and a dropped connection resumes at the browser'sLast-Event-ID, where 1.12.0 replayed the whole event ring.
The Console's "N frames dropped" now counts the frames the ring lost, where it was always zero. -
An instrument edit in the GUI releases the holds and free flags it ends (WP-2229, #1741).
PATCH /api/instrumentdoes it for every instrument edit from any screen, where before only the Background graph at/nextdid when the background changed kind or length.
A path the edit removes, redefines (a background kind change, or a re-knotted P-spline) or rebuilds loses its hold, and a path the new model builds takes that model's flag.
Its answer gainsreleased,freed,fixedandended; GUI routes are provisional by declaration.
The Terms box on/now builds an added term free. -
A value clicked in the GUI opens on its full stored value (WP-2223).
The Parameters panel's editor and the Interactive tab's value box draw a number rounded and edit it to its last digit, as a spreadsheet cell does:4.1568(2)opens as4.15678.
Text left as it opened is no edit, so a click in and out, or Enter on it, records nothing.
Before, Enter on an unchanged Interactive value moved it by its 13th digit and recorded an edit.
The Interactive value box reads1.5×10⁻³and1.5x10^-3, as the range fields do. -
The GUI's "One cycle" choice is now "As ticked" (WP-2227, #1776).
It always ran every ticked parameter together to convergence, and in the field a cycle is one least-squares iteration, so only the words change. -
A chart pane with nothing to draw prints no axis labels (WP-2245, #1822).
The difference pane before a fit read 100 and 0 under the intensity axis.
A pane that draws no finite value in view now prints no y labels, ticks, gridlines or zero line, inrietx watch,rietx compareand both GUI pages.
These notes were written by Claude Code from the release's records, on behalf of @yue-here.