Skip to content

Releases

rietx 1.13.0

Choose a tag to compare

@yue-here yue-here released this 29 Nov 17:25
30929c1

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 rietx

Upgrading

Code written against 1.12.0 runs unaltered, with the exceptions in this list.

Code to check

  • capabilities().schema_version is 0.62, where 1.12.0's was 0.61.
    0.62 adds Phase.peak_equations and Instrument.peak_equations (WP-2107), SeriesEntry.held_values (WP-2081) and PatternData.diagnostics (WP-2304).
    It adds StageResult.window_refit_loss and NodeAction.movement_slack (WP-2317 R7), and PlanSpec.shift_over_esd_tol, StageResult.shift_over_esd_tol and NodeAction.shift_over_esd_tol (WP-2317 R6).
    It adds ReflectionState.merged_groups, a list of MergedGroup (WP-2315).
    capabilities().expression_grammar_version is 2: the grammar gains orbit_mean and harmonic, which only a peak equation may call.
    A tie, a variable or a ParametricEquation that names either is refused at declaration.
    capabilities().report_thresholds_version is 1.16, where 1.12.0's was 1.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 reads result.stages[-1].name == "closing" or counts len(plan.run_stages()) == len(plan.stages) + 1 now sees the declared stages alone.
    Set plan.closing_window_tol = rietx.schemas.plan.CLOSING_WINDOW_TOL to get the 1.10-1.12 behaviour.

  • The last stage records the new stop, and termination gains "shift_over_esd" (WP-2317 R6, #1890).
    PlanSpec.shift_over_esd_tol defaults to 0.1, and RefinementPlan.shift_over_esd_tol, RefinementPlan.stage_shift_tols() and run_stage(shift_over_esd_tol=0.1) take it.
    StageResult.shift_over_esd_tol and NodeAction.shift_over_esd_tol record what a stage stopped on, and are None for a stage that stopped on its ftol alone.
    Code that tests StageResult.termination == "ftol" on a last stage meets "shift_over_esd" now.

  • A second fit on a converged model runs one stage (WP-2224, #1711).
    Refinement.fit and refine take refit="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's result.stages by name now sees warm_refit where it saw the plan's stages, and summary() 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 through edit.
    refit="stages" runs the plan as before.
    On the eight rietx compare standards 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 carries WARM_REFIT_REJECTED (info).

  • structure_from_cif refuses a CIF whose operator loop is a different group from its H-M symbol (WP-1933, #913).
    A loop that lost the C-centring of C 1 2/m 1, or a P6₁ loop under P 61 2 2, used to build the loop's smaller group, with half the atoms and no diagnostic.
    It now raises ValueError naming both groups, and no keyword overrides it: correct the symbol or the loop.
    Where the loop lists x, y, z alone, it names both remedies: write P 1 or 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,-z under P 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 -1 or I -1 whose loop lost its centring is still type 4 or 2, but used to build half the atoms.
    A loop on rhombohedral axes under a bare R symbol still reads.
    A loop of x, y, z alone 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 as P 1 with the atoms listed, which was right when the atom list is the full cell.
    Drop the symbol, or write P 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).
    Under F m -3 m, b and c must equal a; under P 4/m m m or P 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 than SYMMETRY_LENGTH_RTOL (1e-5, 10 ppm in d) from its source, naming the entry, both values and the symbol.
    A script that edits cell.a.value on a cubic phase edits cell.b and cell.c with it, or calls Refinement.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 reports CIF_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 says HISTORY_CELL_TIE_CORRECTED.

  • A choice outside its set is refused at the call, and some refusals changed type or wording (WP-2302).
    A misspelt mode (refine, Refinement.fit, run_stage, parameters, suggest, SequentialRefinement.fit, Project.create) raises ValueError before 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, and Refinement.parameters(mode=...) answered without a word.
    An unknown backend raises ValueError, where it raised NotImplementedError.
    RefinementTree.best(metric=...) refuses a name that is not a numeric Statistics field; it used to say that no node carried statistics.
    auto_background(kind=...), index_pattern(preset=..., engines=...), merge(prefer=...) and solve_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_range is two_theta_limits wherever it requests a window (WP-2302): pick_peaks, fit_peaks, rx.viz.plot_result, rx.viz.plot_pattern, and the plot methods that forward to them.
    The old keyword raises TypeError.
    A field that describes a span keeps the name two_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's statistics.gof are still on the result, so read the two side by side.
    rietx.sequential.WIDTH_GROWTH_FACTOR, WIDTH_GROWTH_GOF_FACTOR and WIDTH_GROWTH_SIGMA are gone, so code that reads any of them raises (ImportError from a from … import, AttributeError on 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 accepted and fires can be None (WP-2220, #1717, issues #1685 and #1686).
    FreedComparison gains status_restricted, status_full, chi2_ordered, n_identified and diagnostics.
    chi2_ordered is 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_identified counts the freed columns the data measured, beside the count the BIC charged.
    FreedParameter gains at_bound and t_reason, the reason a t-ratio is missing, such as "no gradient".
    A new warning, COMPARISON_UNCONVERGED, fires when either fit's status is not converged or 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...

Read more

rietx 1.12.0

Choose a tag to compare

@yue-here yue-here released this 18 Nov 21:42
9064333

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 rietx

Upgrading

Code written against 1.11.0 runs unaltered, with the exceptions in this list.

Code to check

  • capabilities().schema_version is 0.61, where 1.11.0's was 0.60.
    0.61 makes Phase.extinction optional (WP-1944) and adds Phase.parent_cell (WP-1419).
    It adds IndexingControls.formula and IndexingControls.temperature (WP-2030), and ExtinctionCandidate.tested_hkl and ExtinctionCandidate.tested_two_theta (WP-2076).
    It adds the "expression" basis and expression field to ParametricEquation, makes its target optional, and removes Parameter.expr (WP-1964).
    It adds TieSpec.expression (WP-2118), StageSpec.turn_off and StageResult.fixed (WP-2208), and StageSpec.lebail_tol, StageResult.lebail_cycles_run and StageResult.lebail_settled (WP-1542).
    It adds RefinementResult.sigma_rule, HistogramResult.sigma_rule and PatternData.nonpositive_sigma (WP-1952).
    Files that change says which documents open where.

  • Parameter.expr is gone (WP-1964). It only ever held None, and any other value raised.
    Parameter(..., expr=None) still constructs, and a stored "expr": null still reads.
    Code that reads param.expr raises AttributeError.
    A formula is now a joint fit's ParametricEquation(basis="expression"), or a tie's expression=.

  • Extinction is opt-in per phase (WP-1944, #1391, issue #877). Phase.extinction
    now defaults to None, so code that reads phase.extinction.value on a phase
    that never declared it raises. On such a phase, set_vary and set_values
    naming phases.N.extinction raise ValueError for an unknown path. A custom
    plan's phases.*.extinction glob frees nothing there, and no code says so.
    phase.extinction = 0.0 declares it, and mccusker_structural then 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 raises ValueError.
    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_TURN is refused at the stage's start, so a stage that ran in 1.11.0 with a hold, a tie or a set_vary glob 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's name and particle_radius_um may always differ.

Numbers that move

  • mccusker_structural frees 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 a FLOOR_HIT warning 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 cell b moves 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 Parameter to 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 other Parameter objects.
    So an object held beforehand, such as g = phase.gauss_size, was no longer the model's, and g.vary = True freed 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.microstructure reads a width on its floor as no broadening under either solver (WP-1914, #1506).
    Under solver="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_size stored 3.4e-24 deg² and read as 4.3e13 Å.
    It now reads at_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_bodies keeps a body's riding hydrogens riding in its released refit (WP-1989 part 1, #1008), so on a body with riding H chi2_released, n_added, p_value, delta_bic, deviations and fires can 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_added is 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° returns R - c - at ΔBIC −45.9, where it was −3435.
    FAP now abstains, with P 63 - - leading on one testable line at 68.0°.
    NAC still returns I - - -.
    PbSO₄ returns P c - a, where the specimen is P 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 carries parent_cell and, on a phase that declares no extinction, extinction: null.
    A result carries sigma_rule, and each stage's fixed, lebail_cycles_run and lebail_settled.
    A project's project.json carries the indexing controls' formula and temperature, as null when unset.
    capabilities().project_format_version is 1.6, where 1.11.0's was 1.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.
    So mccusker_structural...
Read more

rietx 1.11.0

Choose a tag to compare

@yue-here yue-here released this 04 Nov 19:55
b1741da

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 rietx

Upgrading

Code written against 1.10.0 runs unaltered, with the exceptions in this list.

Code to check

  • capabilities().schema_version is 0.60, where 1.10.0's was 0.59.
    0.60 adds RefinementResult.radiation and HistogramResult.radiation (WP-2042), Phase.distortion_modes and RefinementResult.distortion_totals (WP-1419), IndexingResult.formula, IndexingResult.temperature, PeakList.instrument_undeclared and CellCandidate.formula_units (WP-2030), PlanarityRestraint (WP-1809), GeometryTable.torsions and TorsionRestraint (WP-1815), StageResult.rwp, StageResult.termination and StageResult.window_loss (WP-1334, WP-2047), and SeriesResult.code_counts, SeriesResult.direction_gaps and SeriesEntry.rwp_over_median (WP-2003).
    RestraintRow.kind gains "planarity" and "torsion".
    Files that change says which documents open where.
  • RefinementResult.parameters lists 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 cubic b and c stayed beside a held a, 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 with Refinement.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_calibrate and lab_bragg_brentano refine 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 refined instrument.geometry.axial_hl from either plan now reads the value it declared.
    The refine_axial_asymmetry suggestion names S/L alone.
    An imported GSAS-II recipe still frees both ratios from its single SH/L flag.
  • Refinement.fit no longer raises ValueError: array must not contain infs or NaNs when a stage's model turns non-finite (WP-2048).
    The stage ends at its start with status="diverged", the warning STAGE_NOT_FINITE names 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.
  • PeakList refuses a line whose q_esd does not follow from its two_theta_esd (WP-2071, issue #1236), in the validator that already refuses a stale q.
    The engines weight lines by q_esd, so in 1.10.0 an edit to one line's two_theta_esd loaded clean and never reached the search.
    Set both together through q_esd_of_two_theta, or rebuild the list with pick_peaks or from_positions.
  • read_fullprof_pcr refuses Nor = 0 with a non-zero Pref1, the exponential preferred-orientation function (WP-2058).
    1.10.0 built such a file with no preferred orientation and said nothing.
  • write_topas_inp refuses a tie_equal group whose members hold two values (WP-1911), at the 1e-6 bar the TOPAS reader refuses one on read.
  • SplitFamily(...) built without emission_line raises (WP-1339), since a default of 0 read as an answer.
    A stored dump still loads.
  • predicted_but_absent is a capping caveat (C3, issue #916, PR #941): a cell carrying it alone grades medium, where 1.10.0 graded it low; INDEX_REFUTING_CAVEATS no longer names it.
    Code that read the caveat as a refutation reads supercell_refuted instead, which is what refutes an oversized cell now.
  • LeBailValidation gains predicted_but_absent_uncancellable, predicted_but_absent_uncancellable_in_window and absent_source; SupercellCheck gains relation, and its index is 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.mode records which (schema 0.60), and a 1.10.0 document reads "lebail".
    The type, CellCandidate.lebail, validate_by_lebail and lebail_rwp keep their names.
  • Under a time ceiling (quick, or a declared total_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_diagnostic loses its ceiling_hit argument, since a validation fit no longer has a share of its own to run out of.
    Code that compared two candidates' lebail.rwp reads 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_symbol now refines the cell before it screens (refine_cell=True is the default, issue #726).
    A caller that hands it a certified cell and wants that cell held passes refine_cell=False.
    A caller that reads best_or_none() gets None on a new reason as well: ExtinctionScreen.status == "unreliable".
    0.60 also adds ExtinctionScreen.prefit_rwp, ExtinctionScreen.reference_rwp_net and ExtinctionScreen.perfect_fit_rwp_net, each defaulting to None.
  • SearchSpec.from_formula sets a volume ceiling only, for every formula (WP-2030).
    1.10.0 also set min_volume to 0.8 × z formula units by Hofmann's volumes, which excluded the true cell of 15 of 16 inorganic standards; min_volume now stays at the 15 ų default unless you pass it beside the formula.
    With z=None the 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_window tests the same ceiling alone: it read False on 15 of 16 true inorganic cells under the 0.8 floor.
  • INDEX_Z_NOT_INTEGER is withdrawn, with rietx.indexing.diagnostics.Z_INTEGER_TOLERANCE, and candidate_diagnostics no longer takes formula or temperature (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 as CellCandidate.formula_units when index_pattern is given formula=.
  • A chemical formula whose full stop reads two ways is refused (WP-2030): formula_unit_volume, SearchSpec.from_formula and index_pattern(formula=) raise ValueError on "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's StageResult.ftol reads None.
    A stage's own Stage.ftol still wins.
  • Code that filters a joint result's BISO_NEGATIVE, BISO_UNUSUALLY_LARGE or ADP_NOT_POSITIVE_DEFINITE findings by the bare path of a per-histogram parameter (WP-2028).
    Such a finding's path now reads hist.<h>.…, where 1.10.0 wrote it bare from pattern 0.
  • Code that reads a joint result's ticks or tick_hkl as 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_DISCONTINUITY is gone, with its three thresholds DISCONTINUITY_FACTOR, DISCONTINUITY_SIGMA and MIN_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.discontinuities is renamed SeriesResult.steps, and it now lists every refined path's step between consecutive patterns, in esds of the later fit (SeriesStep.size_esd)...
Read more

rietx 1.10.0

Choose a tag to compare

@yue-here yue-here released this 24 Oct 20:31
ac1ee1e

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 rietx

Upgrading

Code written against 1.9.0 runs unaltered, with the exceptions in this list.

Code to check

  • Code that reads the text print(result) or summary() 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, and result.diagnostics holds every row as before, which is what code should read.

  • SearchSpec.n_unindexed and SearchSpecSpec.n_unindexed default to None, where they were 2, and also take "inliers".
    None keeps 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 reads None.

  • ParametricTie is now ParametricEquation, with no alias.
    Code from 1.9.0 that builds parametric=[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's ParametricCoefficient rows carry the key tie, and they open here with that key read as equation.
    Reading .tie on a ParametricCoefficient raises, because the attribute is now .equation.

  • capabilities().schema_version is 0.59, where 1.9.0's was 0.55.
    0.56 adds RefinementResult.parametric_form.
    0.57 adds Phase.texture and RefinementResult.texture.
    0.58 adds RigidBody.riding.
    0.59 adds RefinedParameter.equations, .interval and .stderr_uncorrected, and RefinementResult.parametric_equations and .parametric_form_joint.
    It also adds StageResult.cell_reset, .collapsed, .width_twins_held, .window_area_tol and .n_lapack_fallbacks.
    It adds NodeAction.phase_support_sigma, .correlation_guard and .window_area_tol, and PlanSpec.phase_support_sigma and .closing_window_tol.
    For indexing it adds CellCandidate.n_search_unindexed and .unindexed_two_theta, ObservedPeak.two_theta_esd_fit, ExtinctionCandidate.excluded_groups and .laue_classes, and ExtinctionScreen.prior.
    For QPA it adds QuantitativePhaseAnalysis.unmeasured_phases and .unmeasured_held and NodeMetrics.held_scale_phases, and lets PhaseQuantity.weight_fraction be None.
    What this means for stored files is in Files that change.
    A 1.9.0 result opens here with equations set to None on every row, meaning not recorded.

  • capabilities().indexing_thresholds_version is 1.11, where 1.9.0's was 1.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 undriven weak_line lines, the inlier retry, the search window sized by the list's widths, the intensity-weighted indexed fraction, and the extinction prior.
    capabilities().report_thresholds_version is 1.13, where it was 1.12, because the noise MAGNETIC_WIDTH_UNMODELLED divides by has moved (Magnetic structures).

  • Every plan now ends in a stage it does not declare, named closing, so RefinementResult.stages holds one entry more than the plan's stages (WP-2002).
    Code that reads result.stages[-1] as the last declared stage, or counts stages against plan.stages, should read plan.run_stages() instead.
    compile_model, Refinement.predict and Refinement.run_stage now compute at the closing stage's windows by default, so a pattern they draw carries tails a 1.9.0 one lacked.
    Pass window_area_tol=rietx.model.forward.WINDOW_AREA_TOL to compile_model or run_stage for 1.9.0's windows.
    What the closing stage changes in an answer is under Numbers that move.

  • build_report takes instrument= beside structure=, and refuses a Rietveld or Le Bail model= 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.order has no default, where it was 2, and rietx.schemas.instrument.DEFAULT_HARMONIC_ORDER is 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 as harmonics=[2].
    A stored instrument carries its order and opens as before.

  • Refinement.tie and tie_equal refuse 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_supercell refuses a magnetic candidate or group given without magnetic_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 message and suggestion is 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, to Diagnostic.explanation and rietx.help.explain(code).
    str(d) prints warning[CODE]: message, then an at: line with the paths and a help: line with the suggestion.
    The rewrite renames no code, so code that matched on message text should match on code and where instead.
    The parameter help, the plan descriptions in PLAN_INFO and the API summaries are rewritten in the same voice.

  • rietx.help.PEAK_DIAGNOSTIC_HELP is now rietx.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 its Gsas2Hap.preferred_orientation is None (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_MAX and rietx.schemas.instrument.HARMONIC_WEIGHT_MAX.
    rietx.params.vector.size_cap takes the fitted range alone, size_cap(tt_min, tt_max), where it also took a wavelength.
    rietx.schemas.structure.MARCH_R_MIN is now 1e-6, where it was 0.15.

  • auto_background returns a BackgroundChoice, the background with the scores it was chosen on beside it (WP-2002, B12).
    Assign its background to Instrument.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 naming BackgroundChoice.
    The background itself is the one 1.9.0 built.

  • solve_magnetic no longer takes tie_r, and rietx.strategy.magnetic.SOLVE_TIE_R_MAGNETIC is gone (WP-2002, B12; the ranking change is under Magnetic structures).

  • QPA_FRACTION_UNDETERMINED is now QPA_FRACTION_RANGE, an info record on every width profile whose fit has an esd, and rietx.schemas.fraction.FRACTION_PROFILE_EXCESS is 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's value is that distance, FractionProfile.excess, so a filter on the old code becomes a test of value.

  • rietx.viz.indexing no longer has the colour constants OBS, CALC, BKG, DIFF, ABSENT and UNMATCHED (WP-1972).
    Their values are the index_obs, index_calc, index_bkg, index_diff, absent and unmatched entries of rietx.viz.plots.PALETTES["light"].
    CANDIDATE_COLORS stays.

  • CandidateSet.classes is 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_classes holds the old union-find partition beside it.
    solve_magnetic th...

Read more

rietx 1.9.0

Choose a tag to compare

@yue-here yue-here released this 14 Oct 12:09
ea1800d

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 rietx

pip 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_theta is None for a time-of-flight pattern, which carries PatternData.tof in µs instead (WP-1927, schema 0.53).
    Code that reads two_theta as always present should ask PatternData.axis first ("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, and rietx.io.formats.gsas.gsas_banks lists 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 .xy file whose header states its x-axis unit is read in that unit (WP-1927).
    A stated time of flight goes to PatternData.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).
    Its parameters keep histogram h's rows without their hist.<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_version is 0.55, where 1.8.0's was 0.49.
    0.50 adds the tether and anti-bump restraints, and 0.51 adds SeriesResult.relative_paths and .angle_paths.
    0.52 adds Phase.floating_origin and ParameterRow.origin_axis, 0.53 the time-of-flight axis and source, and 0.54 the "centroid" origin.
    0.55 adds RefinementResult.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_sl and axial_hl is 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 the profile stage 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, and HIGH_CORRELATION names them.
    On the LaB₆ + cBN fit with six Lorentzian widths free, 1.8.0 raised no HIGH_CORRELATION on 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 with COVARIANCE_DIRECTION_DISCARDED naming 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 on converged far 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 reported converged at 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_interval on 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.ticks added 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_pick and 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, and HIGH_CORRELATION on 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 it high.
  • determine_extinction_symbol now refits every declared HumpComponent in each class fit, beside the background, its FWHM floored at HUMP_MIN_WIDTH_MULT instrument 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...
Read more

rietx 1.8.0

Choose a tag to compare

@yue-here yue-here released this 12 Oct 14:53
56427c4

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 rietx

rietx 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.transform is gone (WP-1938).
    Passing transform= to Parameter still works and becomes bounds, but reading .transform raises AttributeError.
    ParameterRow.transform is gone too.
  • Refinement.add_variable and ParameterTable.add_parameter no longer take transform=.
    Pass the bounds instead, for example min=0.0.
  • strategy.suggest.Candidate.dp_du is gone, since every column is in physical units.
  • A parameter that refines onto a lower bound of 0 reports FLOOR_HIT, where it reported BOUND_HIT (WP-1929).
    That covers a scale, a width, a B with min=0, and W on its floor.
    Code that finds rows on a bound by code == "BOUND_HIT" should read both codes, or RefinedParameter.at_bound, which is True under either.
  • An event log opened by EventStream now starts with a header line, {"record": "run", …} (#902 by @mustachefeeling, issue #223).
    The line goes to the file only, so no callback sees it, and read_events skips it.
    A reader of your own that validates each line as an EventRecord, or reads e["kind"], needs to skip it too.
    EVENT_SCHEMA_VERSION is 3, where it was 2.
  • The module rietx.params.transforms is gone, and logaddexp and sigmoid left the backend op list.
    A custom backend no longer needs to provide them.
  • The isotropy Witness stores one more field, interior, so a Witness built by hand needs it.
  • capabilities().schema_version is 0.49, where 1.7.0's was 0.43.
    0.44 adds StageResult.seeded, 0.45 adds RigidBody.torsions, and 0.46 removes Parameter.transform.
    0.47 adds BackgroundSelection.diagnostics, 0.48 adds ParameterInterval, and 0.49 adds StageResult.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's min and max are 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 is max_iter × 4 residual evaluations, as TRF's is, where it was max_iter outer iterations.
    A stage that starts at its minimum reports converged.
    It said diverged, 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, the profile stage 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 offers refine_sample_transparency at 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_POSITIVE and STEPHENS_STRAIN_NOT_POSITIVE still fire under solver="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.
    Under solver="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 stored w below that is raised to it on read, as March r is raised to its floor.
    read_gsas_prm, read_gsas2_instprm and read_recipe raise 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 its RefinedParameter.at_bound read None.
    FLOOR_HIT says the data push the parameter below zero, and to fix it at 0.
    BOUND_HIT said to widen the bound, which a scale or a width cannot use.
    GuardFinding.limit carries 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_HIT and FLOOR_HIT read 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.
    Under solver="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 u and v is 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 into u's Jacobian column.
    Every fit that frees u or v can move.
  • A stage's seed lifts 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.seeded lists what each stage lifted and the value it started from.
    Of the presets, only the roughness stage seeds now.
    The extincti...
Read more

rietx 1.7.0

Choose a tag to compare

@yue-here yue-here released this 08 Oct 21:53
a9eaebb

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 rietx

Upgrading

Code to check

Code written against 1.6.0 runs unaltered, with the exceptions in this list.

  • schemas.structure.BISO_BOUNDS, biso_bounds and biso_widening_diagnostic are gone.
  • rietx.crystallography.magnetic.irreps and .modes moved to rietx.crystallography.representation.irreps and .modes.
    The old paths raise ModuleNotFoundError.
    Both are internal modules, but 1.6.0 shipped them.
  • print(x) and str(x) on a schema give a new form (below), and so does history.summary().
    Code that parsed either text needs the change.
  • capabilities().schema_version is 0.43.
    0.42 adds RefinementState.free_declared, and 0.43 adds Phase.rigid_bodies.
    A document that carries a rigid body is refused by a build older than 1.7.0.
  • pip install rietx now installs matplotlib (>=3.10.5), so figures work on a base install.
    The install grows by about 58 MB.
    The viz extra is empty and still accepted, so pip install "rietx[viz]" keeps working.
    An environment on a matplotlib older than 3.10.5 is upgraded.
  • A new notebooks extra (ipykernel, nbclient, nbformat) runs notebooks headless.
    Using rietx in a notebook does not need it.
    The docs extra gains myst-nb.
  • examples/fap_lab.py is gone.
    examples/tutorials/02_simple_rietveld.py and 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_NEGATIVE warns on a negative B, and BISO_UNUSUALLY_LARGE on one past the phase's melting estimate.
  • A bound you pass on a Parameter still 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), and floating_origin_basis(group) returns those directions.
    It reports ORIGIN_FIXED_ON_POLAR_AXIS for each phase it held, and ORIGIN_NOT_FIXED where 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 by write_fullprof_pcr and write_gsas2_phase_cif, and reported by FULLPROF_RHOMBOHEDRAL_RESTATED and GSAS2_CIF_RHOMBOHEDRAL_RESTATED.
    1.6.0 wrote the rhombohedral cell under R -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, so predict() on it equals the original's.
  • BISO_BOUND_WIDENED is gone. Readers keep a file's B whatever its value, so there is no bound to widen.
  • SCALE_B_INSEPARABLE fires 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 reports BISO_NEGATIVE.
  • INDEX_PRIOR_USED is a warning where a declared prior lies outside the search's axis box.
    Its suggestion names the SearchSpec(max_d_axis=…) or min_d_axis to pass.
    A prior still never widens the box itself.
  • STAGE_PATH_NOT_FREE is new, a warning. 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_MOMENT fires 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_RUNAWAY can 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, and Refinement.fit raised DegenerateCellError.
  • INDEX_DATA_INSUFFICIENT names an undeclared instrument first when index_pattern is 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_REFUTED says the cell is ranked below its parent, not directly below it.
  • SPECIES_FALLBACK_NEUTRAL no longer fires on Y3+, nor on a digitless one-charge ion the table holds.
    It used to call Na+ and the others absent from the table, and that was wrong.
    It still fires on Fe+ 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 .EXP included.
    Each now writes the atom rietx computed, in its program's spelling: Cu+ is Cu+1 in TOPAS, CU+1 in 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_NEUTRAL and GSAS2_CIF_SPECIES_WRITTEN_NEUTRAL.
    write_topas_inp and write_fullprof_pcr take diagnostics= for it, as the GSAS writers already did.
    An isotope a file has no place for is still refused.
  • write_topas_inp writes origin choice 1 as TOPAS's own S suffix (Fd-3mS), where 1.6.0 wrote F d -3 m:1 and 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 stored 0.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's str states a phase's size and strain widths and its Stephens anisotropic-strain block as lor_fwhm/gauss_fwhm equations, 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_inp writes 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_inp still gives all three components the flag any one carries.
  • Structure.from_cif reads 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_cif names ...
Read more

rietx 1.6.0

Choose a tag to compare

@yue-here yue-here released this 03 Oct 20:15
03e3008

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 rietx

Upgrading

Code to check

Code written against 1.5.0 runs unaltered, with the exceptions in this list.

  • capabilities().features["secondary_extinction"] is now features["primary_extinction"].
    A powder has only primary extinction (Sabine, Von Dreele and Jørgensen 1988), so only the name changed.
    The model and phases.N.extinction are as they were, and the manual's anchor is now corrections.html#primary-extinction.
  • write_reflection_table writes 13 columns on every table, magnetic or not.
    satellite_order and component follow intensity, and ReflectionRow gains the same two fields.
    Code that reads the CSV by column position needs the change.
  • BackgroundPSpline.air_scatter is None wherever no air term is declared.
  • report.background.worst_absorption is None, and absorption beside it is None rather than {}, wherever the absorption screen had nothing to screen.
    That is every Le Bail and Pawley fit, and a comparison such as worst_absorption < 0.25 raises there.
  • RefinedParameter.at_bound is None on a free row sitting at a zero floor, such as an absent phase's scale.
    Code that tests at_bound is False needs the change.
  • write_html no longer takes include_plotlyjs, because the page carries everything it draws with.
    viz.html.figure_from_arrays is gone, and viz.html.page returns 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.fit in that exception.
    It now records the pattern as a failure and carries on, which is the new default on_error="carry".
    Pass on_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_exp and write_gsas2_phase_cif each refuse by name what their format cannot state, and spell an ion as their program reads it.
    The sections on isotopes and on the .pcr writer list each case.
  • A FullProf .pcr with a Jbt = ±1 phase at k = 0, and a TOPAS .inp with mag_space_group and 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_VERSION 0.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_HIT fires on some fits that were silent before, which is the point of it.
    Its message ends with a parenthetical carrying its evidence, and Diagnostic.value is a number where it was None.
  • 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.
    A SEQUENTIAL_DISCONTINUITY into or out of such a pattern, or a diverged one, is no longer reported.
  • GSAS2_GPX_PHASE_MAGNETIC on a project whose phase names a magnetic partner but holds no magnetic phase is info, where it was a warning.
    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_inflation converts one esd into the other.
    ΔBIC from suggest and compare_freed, the profile_fraction interval 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 by auto_background without 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_neutron builds 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_mm or thickness_mm and no mu_r or mu_t now gets an estimated one.
    Absorption trades with scale and Biso, so both move on such a fit.
    The Brindley correction of particle_radius_um now reads the neutron table on a neutron histogram, so its weight fractions change.
  • b_Sears.dat corrected 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_bic is now charged at N/f², which makes it smaller on every candidate the raw count favoured.
    CandidateGroup.delta_bic_raw_n holds 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.k is 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_INSEPARABLE and PAWLEY_OFF_DATA_RIDGED.
    The sections below say what each one changes.

Files that read differently

  • A GSAS .EXP or .prm numeric 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_58 reads as ⁵⁸Ni²⁺, where 1.5.0 read a "+258" ion of natural Ni.
    A GSAS-II .gpx reads 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(...) or SST(...) now counts.
    Two such datasets no longer build into one Structure, and a lone one gives its phase dataset = 0 where it gave None.
    A time-of-flight dataset is refused by to_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...

Read more

rietx 1.5.0

Choose a tag to compare

@yue-here yue-here released this 18 Sep 07:27
13bce50

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 rietx

Watch a fit while it runs

rietx watch

No 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 verbs

Every 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 not

RIETX_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 list

Write 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θ/λ is s in equations and stol in 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_spacings raises
    DegenerateCellError where it produced a RuntimeWarning and a silent NaN.
    StageResult.n_degenerate_cell_probes and the CELL_DEGENERATE_PROBE
    diagnostic count how often a stage reached one.
  • RefinementResult.tick_hkl pairs each tick with its reflection, by index.
    A result written before this release opens with the mapping empty.
  • The GUI, the watcher and rietx compare share 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's scale is 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, free instrument.background.c* instead. This was not made opt-in because
    the P-spline's air_scatter has 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_fixed was bare np.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 with two_theta_min/two_theta_max, or supply a curve
    that covers it. A curve from background.estimate or auto_background is
    already on the pattern's own grid and is unaffected.

  • You build an instrument with constant_wavelength_neutron(fwhm_deg=...).
    It seeded w = (0.5·fwhm)² and x = fwhm together, double-counting the
    width and climbing with angle: at fwhm_deg=0.3 the seeded FWHM was 1.179° at
    2θ = 150, which is 3.93× the width you asked for. It now seeds w = fwhm² and
    leaves x alone, 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, set w and x on the profile directly. A
    fwhm_deg above 1.0° now raises, w's default upper bound being 1.0 and the
    seed being fwhm_deg²; declare a coarser instrument by setting
    instrument.profile.w explicitly, with its own bounds.

  • You catch RuntimeWarning around a cell that can go degenerate. It is a
    crystallography.lattice.DegenerateCellError now, which is a ValueError.
    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=False or
    telemetry=<path> each decline it.

  • You passed events=LiveSession(...) to get a live view. LiveSession no
    longer writes fit.html; it writes snapshot.json per stage, which is what
    rietx watch reads. rietx html still 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 ...

Read more

rietx 1.4.0

Choose a tag to compare

@yue-here yue-here released this 14 Sep 15:30
7c3ad41

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 rietx

Fit 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 .pcr

read_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.
    A direction="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.magnetic converts
    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...

Read more