Framework Changes#
Algorithms#
New features#
A new algorithm SaveMDToAscii v1 has been added to save an
MDHistoWorkspaceto a plain ASCII file, with configurable exclusion of integrated dimensions, normalization, column separator and numeric precision.Added optional duration- and monitor-count normalization to HFIRGoniometerIndependentBackground v1. Backgrounds can now be calculated from exposure-normalized rotations and either retained in normalized units or restored to the per-rotation exposure scale. WAND (HB2C) and DEMAND (HB3A) sample-log naming conventions are supported.
HFIRGoniometerIndependentBackground v1 no longer accepts a negative
BackgroundLevel. The property is a percentile and must be between 0 and 100.MDNorm now supports continuous rotation data (generated by ConvertToMD with
useLogTimes).HFIRPowderReduction v1 now attempts to autopopulate the sample absorption parameters if correct data is found in sample run files
SumSpectra v1 algorithm has been optimized for better performance.
RenameWorkspace can now assign a name to a workspace object that is not already in the Analysis Data Service (ADS). In this case, the workspace will be added to the ADS.
The Fit v1 algorithm now allows setting step sizes to customize the perturbation applied to each parameter value while fitting. Setting the
StepSizeMethodtoCustomwill allow the step sizes list to be passed using theCustomStepSizesparameter.EstimatePeakIntensities v1 allows parallel, fit-free estimation of peak intensities within specified windows, using a skew-seeded background estimation.
MDNormDirectSC v1 can now handle MDEvent workspaces created by ConvertToMD v1 with the
UseLogTimesproperty.HFIRPowderReduction v1 now has an
IDFFilenameproperty to optionally override the instrument geometry from the sample file, and loads MIDAS data with LoadEventAsWorkspace2D v1.Algorithm ConvertToMD v1 with option UseLogTimes can use the time series logs at event times as coordinates for extra dimensions when log names are added in OtherDimensions property.
Parallelisation added to ConvertToMD v1 and improved in MDNormDirectSC v1.
FileFinder and
MultipleFilePropertynow resolve multi-run hint strings (ranges and lists) in a single batched archive lookup for HFIR and SNS data, replacing the previous per-run network round trips to ONCat.FitPeaks v1 now has
StrictConvergenceflag, which decides whether fits which have finished due to the parameter step size passing below the stopping threshold should be considered as successful - default isTrueto match previous behaviour.FitPeaks v1 now accepts
Unweighted least squarescost function.FitPeaks v1 now has
PositionToleranceModeinput which controlsPositionTolerancebehaviour. Default isCheckwhich maintains previous behaviour of the positional tolerance being checked after the fit and discarding any fits outside tolerance. This parameter enablesConstrainmode, which will instead apply the tolerances as constraints on the fit.Constrainmode requiresConstrainPeakPositionsbe disabled.FitPeaks v1 now has
CalculateUnconstrainedErrorswhich controls whether the errors for fits should be recomputed after the fit, without the constraints applied. Default isFalse.FitPeaks v1 now has
PositionToleranceFractionalwhich controls whether thePositionToleranceshould be treated as a fraction of the peak window (True) or as an absolute value (False, default).Algorithm ConvertToMD v1 now accepts an option, UseLogTimes, to use log times of neutron events in coordinate calculations instead of their average.
Stitch1D and Stitch1DMany now have a
UseValidDataOnlyoption which, whentrue, ignores the contribution of invalid signal values to overlap bins when another workspace has valid data in the same bin. Whenfalse(default) previous behaviour is maintained, where presence of invalid data in an overlap bin from either workspace results in the same invalid value in the output workspace.The VesuvioTransmission v1 algorithm has been added which evaluates the transmission spectrum on the
VESUVIOspectrometer for measured sample and empty run numbers.A new property
OutputWorkspaceSuffixeshas been added to the Stitch1DMany v1 algorithm, which allows users to specify custom suffixes for the child workspaces in the output group when stitching workspace groups.
Bugfixes#
Unreadable instrument geometry cache is now deleted, and the cache gets recreated to prevent a load failure
SaveDaveGrp v1 algorithm now optionally converts the spectrum numbers into
Qvalues using GetQsInQENSData v1 when creating the.grpfile.SavePlot1D v1 no longer fails when run with plotly 7.0 or later. The
plotlyandplotly-fulloutput types used plotly interfaces that were deprecated and then removed.CopySample v1 no longer causes a crash when called with
CopyShape = False,CopyMaterial = Trueand an input workspace that is subsequently overwritten.BinaryOperateMasks v1 no longer throws a spurious validation error when acting upon input workspaces with non-default detector mapping.
Algorithm SaveYDA now correctly distinguishes between spectra and bin center axes when saving data.
In
BeamProfileFactorythe auto-generated beam profile dimensions are now correct when the sample bounding box is offset from the origin. The beam half-extent is now taken from the furthest sample face on either side, so the beam remains valid for samples that are translated or rotated into a negative half-space.In EstimateScatteringVolumeCentreOfMass the shape object now accounts for the goniometer set on the workspace. Previously this was not the case which gave erroneous values in non-rotationally symmetric situations.
FileFinder now recognises compound file extensions (e.g.
.nxs.h5) listed inFacilities.xmlwhen expanding multi-run hints, so ranges such asCNCS100:105.nxs.h5resolve correctly instead of being misinterpreted as a stem ending in.nxsplus an.h5extension. As a consequence, a hint that explicitly specifies one extension (e.g.BSS_24234_event.nxsorSXD30904.raw.md5) no longer silently resolves to a file with a different extension; specify the run number without an extension to let the facility’s preferred extensions apply.In FitPeaks v1, the
PeakParameterValueTableinput option now reads and applies row-per-spectra parameter starting values. Previously this functionality was declared but was not applied.In HFIRPowderReduction v1, the
OutputWorskspacefield now has a default based on the IPTS and run number.OutputDirectorynow browses to a directory and user can manually set the file name by typing it in the box.:ref: CreateDetectorTable <algm-CreateDetectorTable> has received some performance improvements that should speed up the algorithm significantly for large workspaces with many spectra. This algorithm is used in the new Instrument View when opening, so this should improve the performance of that interface as well.
ExtractSpectra no longer gives an error when the argument
DetectorListis used on focused workspaces where a workspace index maps to several detector IDs.Removed
MultipleScatteringcheckbox from CylinderAbsorptionCW v1, and renamedAttenuationXSectiontoAbsorptionXSection
Deprecated#
The
DPDFreductionalgorithm has been deprecated and has no direct replacement.
Removed#
Removed SofQWCentre and SofQWPolygon (deprecated since release 6.12.0).
Removed the deprecated BayesQuasi and BayesStretch algorithms, which were based on the
quasielasticbayeslibrary. Users should now use the newquickbayesreplacements, BayesQuasi2 v1 and BayesStretch2 v1, respectively.
Fit Functions#
New features#
Poisson deviance is now a cost function for the Levenberg-Marquardt minimizer in fitting.
Bugfixes#
In an Instrument Parameter File, defined fitting parameters no longer erroneously overwrite if they have the same name but for different functions (e.g.
Bk2BkExpConvPV:GammaandIkedaCarpenterPV:Gamma).
Deprecated#
Removed#
Data Objects#
New features#
InstrumentMetadata is now exposed on workspaces and ExperimentInfo objects through instrumentValidFromDate(), instrumentValidToDate(), instrumentFilename(), instrumentXmlText(), instrumentDefaultView() and instrumentDefaultAxis()
Sample Environment is now saved in the Nexus File
getInstrumentName() can be used on workspaces or ExperimentInfo objects to get the name of the underlying instrument. Use this instead of getInstrument().getName().
Bugfixes#
Fixed a boundary-condition bug in
MDGridBoxsplitting where events exactly on a child box’s upper boundary could be dropped during serial or threaded splitting.
Live Data#
New features#
The live-data algorithms gain an optional
Facilityproperty, naming the facility thatInstrumentis resolved against. The Mantid default facility is used when it is not set. An instrument name is only meaningful with respect to a facility, so the two are now validated together, and a mismatch is reported against the offending property rather than raising an exception.
Bugfixes#
The
SNSLiveEventDataListenerstate machine is refactored to simplify its structure, remove race conditions, and make all state transitions explicit. These changes primarily add to theILiveListenerinterface, deprecating itsrunStatusmethod, but otherwise leave mostILiveListenerimplementations largely unchanged.The live-data algorithms, such as StartLiveData, previously could not use an instrument outside the default facility at all, since the allowed values for
Instrumentwere built from the default facility alone. Naming the newFacilityproperty now selects the facility thatInstrumentis resolved against.Resolving
Instrumentno longer falls back to searching every other facility once the resolved facility has been tried. That fallback made instrument names shared between facilities ambiguous, and worked against the purpose of having a default facility. Scripts that relied on an instrument being found outside the default facility must now name itsFacility.The socket-read poll loop of the
SNSLiveEventDataListeneris refactored to provide clean detection of a peer disconnect, and to improve its responsiveness. These changes are expected to fix several cases where the live-data system hung up in response to changes in the ADARA-server state.
Python#
New features#
Instrumentnow hasgetXmlTextexposed to python.Output workspace properties of the generic type
Workspacenow return aWorkspaceGroupobject after an algorithm is automatically dispatched over an input workspace group. Previously, the value component of the property would be set to equal theWorkspaceGroupname but the workspace component would be null.The dimensions of an
IMDHistoWorkspacecan now have theirnameandunitsedited from Python viagetDimension(i).setName(...)andgetDimension(i).setUnits(...). Editing units is supported for HKL and general frames; an HKL dimension acceptsr.l.u.or an inverse-Angstrom-style label such asin 2.5 A^-1. This is useful for relabelling the dimensions produced byMDNormfor unusual projections.MeshObjectnow hasgetBoundingBoxexposed to python.Grid spacing, pixel counts and detector-ID numbering for rectangular/grid arrays can now be accessed from
ComponentInfo, using thepixelGrid*methods such aspixelGridNXandpixelGridXStep. Whether a component has such a grid can be tested withisGridDetector.Added
mantid.api.MinimizerStatus, exposing the status strings a function minimizer reports through a fit’sOutputStatusand anisConvergedtest for them, so Python callers no longer have to hard code the wording. By default the tolerance-limited stopping conditions count as converged alongsidesuccess; passstrict=Truefor an exact match.MDHistoWorkspacenow providessetNumEventsArrayto overwrite the number-of-events array from a numpy array, mirroring the existingsetSignalArrayandsetErrorSquaredArraymethods. Manual updates through these array setters clear any link to the originalMDEventWorkspaceso downstream rebinning or slicing cannot bypass the manually-set values.
Bugfixes#
Fixed a crash where a
Peakretrieved from aPeaksWorkspacein Python could reference deleted memory after the owning workspace is deleted. Peaks now share ownership of their workspace, keeping it alive for as long as the peak is in use.
Deprecated#
MatrixWorkspacenow exposes the preferredHistogramdata accessors to python:x(),y(),e(),dx()(read-only numpy wrappers) andmutableX(),mutableY(),mutableE(),mutableDx()(writable numpy wrappers). These replace the legacyreadX()/readY()/readE()/readDx()anddataX()/dataY()/dataE()/dataDx()methods, which are now deprecated and emit aDeprecationWarningnaming the replacement, but continue to work and return the same data. See the Transition to the HistogramData module concept page for more information on theHistogramdata model.The deprecation warnings above are emitted via PyErr_Warn(PyExc_DeprecationWarning, …), equivalent to
warnings.warn(message, DeprecationWarning), and follow Python’s standard warnings filtering: by default they are printed only for deprecated calls made directly from a user script or interactive session (__main__), once per call site, while calls from inside imported modules are silent. Run Python with-W default(or usewarnings.simplefilter("default")) to surface every occurrence, orerrorin place ofdefaultto raise them as exceptions when hunting call sites in tests or CI.dx()/mutableDx()behave the same wayreadDx()/dataDx()always have: if no Dx (x-error) data has been set on the spectrum, it is first initialized to zeros, so these methods are always safe to call without first checkinghasDx().Much of the legacy
Instrumentobject tree exposed to python is now deprecated in favour of the index-basedSpectrumInfo/DetectorInfo/ComponentInfoaccess layers. Calling the deprecated members now emits aDeprecationWarningnaming the replacement. Affected members includegetInstrument(),Instrument.getComponentByName/getDetector/getSample/getSource/getNumberDetectors/findRectDetectors/findGridDetectors,IComponent.getPos/getName/getFullName/type/getRelativeRot,Component.getRotation/getRelativePos,ICompAssembly.nelements/__len__/__getitem__,IObjComponent.shapeandIDetector.getID/solidAngle/getTwoTheta/getPhi. The methods continue to work for now; see the Instrument Access via SpectrumInfo, DetectorInfo, ComponentInfo concept page for the recommended replacements.The deprecation warnings above are emitted via PyErr_Warn(PyExc_DeprecationWarning, …), equivalent to
warnings.warn(message, DeprecationWarning), and follow Python’s standard warnings filtering: by default they are printed only for deprecated calls made directly from a user script or interactive session (__main__), once per call site, while calls from inside imported modules are silent. Run Python with-W default(or usewarnings.simplefilter("default")) to surface every occurrence, orerrorin place ofdefaultto raise them as exceptions when hunting call sites in tests or CI.ComponentInfonow exposessolidAngle(index, observer)andcomponentType(index)(returning aComponentType) to python. These provide index-based replacements forIDetector.solidAngleand theRectangularDetector/GridDetectortype checks, as part of the migration to theComponentInfo/DetectorInfoaccess layers.PanelSurfaceCalculator.getSideBySideViewPos() will no longer take an instrument parameter.
MatrixWorkspacenow exposes the preferredHistogramdata accessors to python:x(),y(),e(),dx()(read-only numpy wrappers) andmutableX(),mutableY(),mutableE(),mutableDx()(writable numpy wrappers). These replace the legacyreadX()/readY()/readE()/readDx()anddataX()/dataY()/dataE()/dataDx()methods, which are now deprecated and emit aDeprecationWarningnaming the replacement, but continue to work and return the same data. See the Transition to the HistogramData module concept page for more information on theHistogramdata model.dx()/mutableDx()behave the same wayreadDx()/dataDx()always have: if no Dx (x-error) data has been set on the spectrum, it is first initialized to zeros, so these methods are always safe to call.The deprecation warnings above are emitted via PyErr_Warn(PyExc_DeprecationWarning, …), equivalent to
warnings.warn(message, DeprecationWarning), and follow Python’s standard warnings filtering: by default they are printed only for deprecated calls made directly from a user script or interactive session (__main__), once per call site, while calls from inside imported modules are silent. Run Python with-W default(or usewarnings.simplefilter("default")) to surface every occurrence, orerrorin place ofdefaultto raise them as exceptions when hunting call sites in tests or CI.
Dependencies#
New features#
Upgraded python to 3.13. See the changes made to python here.
Automatically set
MPLCONFIGDIRto$XDG_CACHE_HOME/matplotlibwhenXDG_CACHE_HOMEis setRemove ArielToMantidXML tool. This is a tool that was used when transitioning instruments to mantid from other reduction software.
Removed dependence on the
quasielasticbayeslibrary to facilitate the upgrade to Qt6.