What’s New in Revision 0.10.0
These are the changes in SpectroChemPy-0.10.0. See Release notes for a full changelog, including other versions of SpectroChemPy.
New Features
Added the official
spectrochempy-tensorplugin for TensorLy-backed tensor decompositions, exposing CP/PARAFAC asscp.tensor.CP.find_peaksnow accepts physical units for point-spacing constraints (#1078). When coordinate units are available,distanceandwidthcan now be passed asQuantityobjects or unit strings such as"10 cm^-1", andwlen/plateau_sizefollow the same coordinate-aware conversion to sample points. Plain numeric values keep their previous behavior, incompatible units now raise a clear error, and coordinate-aware spacing constraints are now explicitly rejected on non-linear axes instead of being interpreted approximately. Peak interpolation near dataset borders is also more robust.
Bug Fixes
Fixed
interpolatedimargument resolution whendims=Noneis in scope. Callinginterpolate(dim=0, ...)orinterpolate(dim="y", ...)now honours the requested dimension instead of incorrectly defaulting to the last axis.Fixed history tracking for
squeeze()anddiagonal(): both now preserve existing history and append their own operation entry, consistent with other shape-like operations.Restored historical hypercomplex/quaternion dataset display (#1147). Detailed terminal and HTML representations once again show explicit
RR/RI/IR/IIcomponent blocks and preserve complex-dimension shape annotations, instead of falling back to raw quaternion scalar dumps.JCAMP-DX I/O is more robust (#1080, #1132, #1150).
read_jcampnow handles##YUNITS=TRANSMITTANCEas thetransmittanceunit, accepts header values containing=, reports invalid axis metadata with a clear formatted error, and keeps the deprecatedread_jdxalias pointed atread_jcamp.write_jcampnow exports masked samples as JCAMP-DX missing values (?), excludes them from##MAXY/##MINY, and preserves masking on round-trip instead of leaking stale values.interpolatenow preserves coordinate metadata and target semantics (#1093, #1094, #1098, #1100). Bare-array targets keep the source coordinate’s units and title; PCHIP interpolation honoursfill_value; output follows the requested target order even when the source coordinate is decreasing; masks and secondary coordinates stay aligned; and labels now follow only target points that exactly match original coordinate values.write_csvnow exports masked samples as missing values (NaN) instead of writing their underlying data (#1135). Masked values now round-trip as missing values through CSV I/O instead of leaking the stored data beneath the mask.Baseline correction now preserves masked regions more consistently (#1097). Masked areas now remain masked not only on corrected outputs but also on the computed baseline itself, including the AsLS path and the public baseline helper functions.
Fixed
Project.__str__()tree formatting when a project contains both sub-projects and sibling datasets or scripts at the same level. Project trees now render with correct line breaks instead of collapsing sibling entries onto the same line.concatenatenow handles coordinate metadata more consistently (#1101). Coordinate values expressed in compatible but different units are converted to the units of the first dataset, incompatible coordinate units raise aUnitsCompatibilityError, and mixed labeled/unlabeled coordinates no longer crash during concatenation. Coordinate-aware operations now also report incompatible coordinate units more clearly (#1099):align,concatenate, andinterpolateidentify the failing operation, the dimension involved, and the mismatched units.read_opusnow supports more assembled and time-resolved OPUS files (#1035, #1036): data series blocks such asa,sm,igsm,phsm, andtrare read, theTRACE,GCIG, andGCSCtype selectors are exposed, and malformed acquisition sub-second fields now fall back to whole-second precision instead of returningNone.Fixed parsing of the
a.u.(absorbance) andK.M.(Kubelka-Munk) unit symbols from strings, which previously failed because the dots were read as a multiplication.CoordSetand same-dimension coordinate handling are more stable. Native save/load now preserves selected non-first default coordinates and restores reference-based coordinates, while copyingCoordSetandNDDatasetobjects keeps reference-based coordinates intact. Same-dimension coordinate replacement is also more reliable, which improves concatenation of multi-coordinate datasets. EmptyCoordSetobjects now behave consistently instead of raisingTypeErrororIndexError.Stabilized 1D CSV round-trip support:
read_csvnow tolerates header rows (e.g., column titles) written bywrite_csv, and correctly handles both single-column (data-only) and multi-column (coordinate + data) CSV files (#1077).Preserved scientific-context metadata (
meta,author,description,origin, andfilename) in wrapper-based processing and analysis outputs such asFilter(...).transform(...)(#1103).NDDataset.var()now squares the units on the result instead of preserving input units unchanged (#1191). Variance is the average of squared deviations from the mean, so the result units are U² when the input has units U. This alignsvarwith correct dimensional semantics — all other reductions (sum,mean,std,min,max) already handled units correctly.
Dependency Updates
pint >= 0.24 is now required
Breaking Changes
Removed the
Scriptclass and the entirespectrochempy.core.scriptmodule, along with therun_script,run_all_scriptsfunctions and the%addscriptIPython magic (#1196).Projectloses all Script integration (add_script,add_scripts,clear_scripts,remove_all_script,scriptsproperty,makescriptdecorator) — no deprecation period.Projectis now a typed container forNDDatasetandProjectonly. Legacy.pscpfiles containing_scriptsentries remain load-compatible — the field is silently ignored on deserialization.Removed legacy
Project._otherssupport. The_othersdict and its_set_from_typefallback are removed —Projectnow rejects objects that are neitherNDDatasetnorProjectwith a clearTypeError. Legacy.pscpfiles containing_othersentries remain load-compatible — the field is silently ignored on deserialization.Mixed arithmetic between
NDDatasetandCoordis now rejected (e.g.dataset + coordorcoord * dataset).Coordis treated as axis support, not as a signal-bearing operand. Workflows needing correction vectors, weighting profiles, response curves, or other signal-like 1D operands should represent them as 1DNDDatasetobjects instead.Removed the orphaned
roiandNDDataset.modeldataattributes from the public data model (#1168). Fit/model outputs should be stored and plotted as explicitNDDatasetobjects or dedicated fit-result objects rather than hidden structural state onNDDataset. Legacy serializedroiandmodeldatafields in native SpectroChemPy files remain load-compatible and are ignored during loading.
Deprecations
scp.CPandspectrochempy.analysis.decomposition.cp.CPare now deprecated compatibility paths forscp.tensor.CP.
Developer
MAINT: Continued the Display / Representation Architecture work (#843). The semantic
DisplayItem/DisplaySectionrepresentation layer now drives HTML rendering acrossCoord,CoordSet,NDDataset, andProject. This consolidates notebook and HTML display on a shared section-based model, produces cleaner inline summary metadata and collapsible content sections, removes exposure of internal UUIDs from headings, and keeps project hierarchies and same-dimension coordinate groups readable through the unified semantic rendering path. The docs cache key was also updated so sphinx-gallery invalidates cached output when display source files change.TEST: Added synthetic, offline tests for multi-variable Matlab (
.mat) import and documented the behavior in theread_matlabdocstring: numeric variables are converted toNDDatasetobjects and then grouped by the importer when shapes are compatible (same-shape arrays are stacked into one dataset, incompatible ones returned separately), while non-numeric and Matlab-internal (__header__,__version__,__globals__) variables are skipped (#1142).MAINT: Moved CP/PARAFAC implementation and TensorLy dependency ownership into the new tensor plugin, keeping the core package tensor-agnostic.
MAINT: Completed the internal
CoordSetstorage migration. Mutation paths now resolve through the group-backed projection-resolution-reconstruction pipeline, lookup and serializer adapters share transient group metadata, and runtime storage uses a plain_storagelist instead of the legacy trait-based_coordsvalidator. NestedCoordSetsetup, sorting, copying, and name validation are handled explicitly in lifecycle and mutation paths while preserving public behavior, serialization, alias invariants,default_idsemantics, label metadata, reference pass-through, and coordinate metadata.MAINT: Removed stale commented
docrepresidue and the unused commentednumpydocpre-commit hook block.TEST: Added a project-wide source-docstring guard to detect stale
docrep-style placeholders inspectrochempysource docstrings.MAINT: Harmonized plugin release workflows and maintainer documentation: the
release_plugin.ymlworkflow now gracefully handles first plugin releases (where the version is already committed) by skipping the commit and push steps instead of failing, and automatically unsets the GitHub “Latest” flag on plugin releases so the core release remains the primary release on the repository front page. The maintainer documentation now describes the role ofplugin_version_status.py, the first-release workflow, and the “Latest” flag policy (#1082).