What’s New in Revision 0.12.4
These are the changes in SpectroChemPy-0.12.4. See Release notes for a full changelog, including other versions of SpectroChemPy.
Bug Fixes
SPC files using explicit X coordinates are now read correctly for
MXYandX-MYlayouts.MXYsubfiles previously read coordinate values from the fixed header boundary instead of their own X-array offset, whileX-MYfiles failed to propagate their shared X axis to later subfiles. Because the data shape and Y values could still appear valid, users who previously importedMXYorX-MYfiles should re-read the original SPC files and regenerate any derived datasets.Passing
axis=ordims=toNDDatasetreduction methods now correctly reduces along the requested axis instead of computing a global reduction.axis=anddims=are accepted as aliases ofdim=; passing more than one dimension selector simultaneously raisesTypeError. Unrecognised keyword arguments now raiseTypeErrorinstead of being silently stored as attributes.Multi-axis reduction methods (
sum,mean,std,var,ptp,amax/max,amin/min,all,any,average) now accept tuple and list selectors for specifying multiple dimensions at once, e.g.ds.mean(dim=('y', 'x'))ords.sum(dim=[0, 1]). Mixed dimension names and positional indices are normalised, order is preserved, andkeepdims=Trueis supported. Single-axis methods (argmax,argmin,cumsum,coordmax,coordmin) reject tuple/list selectors with a clear error. Empty sequences, boolean values, nested sequences, and duplicate dimensions are rejected.Python operators, in-place variants, and
numpyufunc counterparts now produce identical titles onNDDataset/NDArrayarithmetic. Identity-preserving operations keep the source title; unary transforms compose it (e.g.sqrt(source)); dataset-dataset operations composeadd(...)/subtract(...)/multiply(...)/divide(...); powers composepower(source, p). Composed titles longer than 120 code points collapse to an absent title. Reflected powers such as2.0 ** dsno longer mutate the source dataset.Optimizepost-fit diagnostics now align with the executed optimization. Mutations to the publicOptimize.fpview (e.g. settingfp.fixed) are no longer silently ignored by the reported state. The canonical model spec is the sole source of truth after a fit, andOptimize.predict()/Optimize.result.residualsattach detached writable metadata copies instead of attempting in-place updates against locked source-derived metadata.PLSRegression.coefno longer fails when the fitted multivariate target dataset carries both an observation coordinate and a target-variable coordinate. The coefficient wrapper now preserves the target-axis coordinate instead of attaching the observation axis to the result.PCA.transform()andPCA.scoresno longer fail when the fitted source dataset has feature coordinates but no explicit observation-axis coordinate entry. The result now preserves the available feature metadata and keeps the missing observation axis as an empty coordinate instead of raisingKeyError("y").MCRALSnow rejects unsupported constructor keywords such asn_components=...with the normal invalid-parameterKeyErrorinstead of incorrectly triggering a pre-fitNotFittedErrorduring initialization.Empty unit suffixes are no longer emitted in plot labels when the dataset has no units attached.
The documentation warning shown on development builds now links to the actual latest stable release again. Stable-doc discovery now accepts the current prefixed release tags and no longer falls back to obsolete legacy versions such as
0.8.4.The AsLS baseline-correction path now avoids the SciPy
SparseEfficiencyWarningpreviously exposed by published gallery examples, without changing the underlying baseline-correction algorithm or the scientific results.Gallery example pages now use a consistent RST heading hierarchy. Top-level page titles are emitted at the correct level in the generated gallery, and nested section markers were normalized so the HTML navigation is structured consistently.
The User Guide import pages now render with correct rich HTML formatting and link to the current stable documentation version.
Stray Matplotlib output and rendering artifacts have been suppressed in jupytext-based gallery examples.
Developer
Optimizeno longer rebuilds its canonical model state by re-parsing the post-fit rendered script. After a successful fit the canonical spec keeps the full-precision optimized values, the publicOptimize.fpview keeps its identity and its in-place synced values, andOptimize.scriptbecomes a rendered representation of the fitted values. No API is removed or deprecated.The
Optimizestructured-validation flow now validates constraint parameter-name references against the canonical_FitModelSpecrepresentation instead of the legacyFitParametersview (Optimize.fp).FitParametersandOptimize.fpremain available and unchanged, and the fitting DSL and scientific results are unaffected.