This is development documentation. Some features are not available in the stable release. View stable documentation.

What’s New in Revision 1.1.0

These are the changes in SpectroChemPy-1.1.0. See Release notes for a full changelog, including other versions of SpectroChemPy.

New Features

  • Added a structured operation history for NDDataset. history is a readable, list-compatible, read-only view; history_entries returns a detached structured copy; and annotate(), replace_history(), and clear_history() provide explicit editing operations. Structured entries cover selection and transposition, supported arithmetic and reductions, shape operations, shifts and zero filling, apodization, phasing, mc(), ps(), ht(), dc(), and numerical integration. Entries identify the executed kernel and, where meaningful, requested and effective parameters plus the requested and resolved dimension and source axis. Existing chronology is preserved by copies, supported persistence, trapezoid(), simpson(), and snv(); structured and text-only entries coexist normally, with snv() retaining the single text entry SNVTransformer applied. This journal is not an exhaustive provenance or replay system (PR #1676, PR #1677, PR #1678, PR #1679, PR #1680, PR #1681, PR #1703, PR #1704, PR #1705, PR #1706, PR #1707, PR #1708, PR #1709, PR #1710, PR #1711, PR #1712, PR #1714).

  • Added bounded supervised cross-validation for PLS and PLS-ending Pipelines. cross_validate fits preprocessing inside each fold and returns an aligned CrossValidationResult with out-of-fold predictions, per-target metrics, fold records, and optional fitted estimators. KFold, GroupKFold, and LeaveOneOut adapters are available from the SpectroChemPy namespace, with a user guide and Gallery example (PR #1658, PR #1659, PR #1660).

Bug Fixes

  • PLSRegression.predict now verifies that masked feature positions match those used at fit time, and cross-validation preserves the original feature geometry for preprocessors such as MSC (PR #1657).

  • Dataset arithmetic rejects incompatible same-unit coordinate grids, reconstructs dimensions and coordinates correctly after positional broadcasting, refuses duplicate result dimension names, and rolls back data, units, masks, titles, history, and other trait replacements made by a refused in-place operation. Side effects performed by custom Traitlets observers remain the observer’s responsibility (PR #1665, PR #1667, PR #1668).

  • Spectral-processing wrappers now forward their documented selectors and execution options consistently. hamming(), hann(), and pk_exp() no longer fall back silently to the default dimension or an out-of-place result; unsupported inverse phasing is refused; discrete shifts move masks with values and handle zero shifts correctly; and refused zero filling or a later kernel failure restores any temporary in-place permutation (PR #1682, PR #1683, PR #1705, PR #1709).

  • ifft(size=...) now honors larger and smaller sizes on final and non-final dimensions and reconstructs physical time coordinates from the retained frequency-bin spacing (PR #1694).

  • SPC interferograms are detected from their format code without inventing a laser frequency. Their raw peak position is retained, undated files remain readable on Windows, and FFT validates calibration before mutation while accepting explicitly calibrated time and optical-path-difference axes. Multidimensional FFT applies the existing Mertz correction independently to each trace and its own zero path difference (PR #1700, PR #1701).

  • mc(), ps(), and ht() honor dim, dims, and axis. ht() uses the selected dimension length when N is omitted or None, supports equal or larger transform sizes on multidimensional data, preserves the input shape and real component, and rejects invalid or smaller sizes before mutation (PR #1709, PR #1710).

  • trapezoid() and simpson() exclude masked values from quadrature and publish incomplete slices as masked raw NaN values. They consume all supported dimension selectors consistently, including integer zero, and explicitly refuse the removed SciPy even option (PR #1698, PR #1699).

  • concatenate() refuses partial coordinate information and shared coordinate references whose geometry cannot survive the concatenated size, rather than returning an inconsistent dataset (PR #1697).

  • detrend() rejects unsupported keyword arguments, and align() refuses unsupported target-sampling requests instead of silently ignoring them. Omitting interpolate_sampling or using "auto" preserves alignment on the first dataset grid; use NDDataset.interpolate() for an explicit alternative grid (PR #1695, PR #1702).

  • NDDataset.acquisition_date is preserved by copies, out-of-place arithmetic, and native .scp round trips, including timezone offsets (PR #1688).

  • Reader and exporter metadata are no longer lost in several partial or multi-spectrum cases: SPC sub-spectra retain their associated coordinates, CSV round trips preserve each recognized title and unit independently, JCAMP-DX LINK exports retain labels in column zero, and NMR plugin readers honor explicit origin and description overrides (PR #1691, PR #1692, PR #1693, PR #1696).

  • Newly generated histories from core readers, spectral treatments, analysis results, and OMNIC SRS imports now use consistent messages without duplicate timestamps while preserving useful vendor history. Corresponding official plugin releases apply the same message conventions (PR #1681).

Dependency Updates

  • SpectroChemPy continues to require Python 3.11 or later and now requires scipy>=1.14.1 for the supported Simpson integration behavior (PR #1699).

  • The next NMR 0.1.13, PerkinElmer 0.1.6, IRIS 0.1.10, and Tensor 0.1.7 plugin releases require SpectroChemPy 1.1.0 or later and remain restricted to versions below 2. Existing compatible plugin releases remain available for installations pinned to SpectroChemPy 1.0.0 (PR #1684).

Breaking Changes

  • Direct mutations of the readable NDDataset.history view now raise TypeError instead of being silently lost. Use annotate(), replace_history(), clear_history(), or supported history assignment; assigning a list now retains every supplied entry (PR #1676, PR #1681).

  • Native .scp/.pscp files containing structured histories use format version 3, and portable xarray/NetCDF mappings use version 2. The new readers accept native version 2 and portable version 1 textual histories, but older SpectroChemPy versions are not guaranteed to read the new formats (PR #1676, PR #1680).

  • Arithmetic now refuses ambiguous broadcast results with duplicate dimension names and different same-unit coordinate grids on a non-expanded final axis. Rename colliding dimensions or align coordinate grids explicitly (PR #1665, PR #1667).

  • Requests that previously appeared to succeed while being unsupported now fail explicitly: pk(..., inv=True), unknown detrend() options, and non-default align(interpolate_sampling=...) targets. Use forward phasing, supported detrending options, or NDDataset.interpolate() with an explicit grid respectively (PR #1682, PR #1695, PR #1702).

  • simpson() no longer accepts even because SciPy removed that option. These strategies were functional with earlier SciPy versions: omitting even selects the current SciPy behavior and can change results for an even number of samples compared with the former "avg", "first", or "last" strategies. trapezoid() never accepted even (PR #1699).

  • FFT of an interferogram now requires an explicitly calibrated time or optical-path-difference coordinate; raw sample indices and unrelated units are refused before mutation (PR #1700).

  • Conda development builds are no longer published to the dev label for either core or official plugins. Stable releases remain on the main spectrocat channel; install unreleased versions from a source checkout (PR #1685).

Developer

  • Added the cross-validation building blocks used by the public API: aligned fold validation and slicing, unfitted Pipeline cloning, per-target metrics, structured result assembly, and the supervised execution engine (PR #1653, PR #1654, PR #1655, PR #1656, PR #1657).

  • Improved the public units and masks documentation and simplified examples to favor SpectroChemPy-native construction, plotting, and arithmetic where that preserves the scientific intent (PR #1661, PR #1662, PR #1663).

  • Corrected development-package version selection so stable core tags sort after older release candidates, and strengthened documentation builds and selector examples used by the release documentation (PR #1666, PR #1686, PR #1687, PR #1689, PR #1690).