What’s New in Revision 0.12.2
These are the changes in SpectroChemPy-0.12.2. See Release notes for a full changelog, including other versions of SpectroChemPy.
Bug Fixes
CSV export and JCAMP writing now reject datasets they cannot represent honestly before creating or truncating any file: complex datasets for both formats, and JCAMP datasets without a
ycoordinate. No partial or corrupt file is left behind and the source dataset is unmodified.JCAMP
LINKfiles now computeFIRSTY,LASTY,MAXYandMINYseparately for each spectrum block instead of repeating the first or global extrema across all blocks. The scientific payload and singleton exports are unchanged.JCAMP writing now emits truthful
XUNITS/YUNITStags instead of always claiming1/CMandABSORBANCE. Numeric values are written unchanged: only exact-scale mappings are accepted (cm^-1,um,nm,absorbance,transmittance, or no unit), while merely convertible or arbitrary named units such asm^-1,dimensionlessandcountare rejected before any file is created. The reader now mapsYUNITS=ARBITRARY UNITSback to an unset dataset unit.Native
.scpand.pscppersistence now preserves dataset history entries exactly across load/save round-trips instead of collapsing non-empty history to the first entry and retimestamping it during native reconstruction.Filter and smoothing outputs (
smooth,savgol,savgol_filter,whittaker) now preserve the source datasetnameand append a single history entry while retaining all prior entries, instead of renaming with a_Filter.transformsuffix and replacing the history. Savitzky-Golay derivative outputs (deriv > 0),denoiseand analysis outputs are unchanged.concatenate()andstack()now treat their outputs as multi-source derived datasets for identity and provenance metadata. They no longer silently inheritname,origin,filename,metaor timestamps from a single source dataset, use deterministic synthesizeddescriptionandhistorytext, and preservetitleandacquisition_dateonly on exact consensus. All scientific assembly behavior and the input datasets are unchanged.Arithmetic on masked datasets now follows the explicit-mask policy: only the explicit operand masks are preserved (as their broadcast union for two datasets) and newly invalid numeric values are no longer auto-masked. Division by zero on the masked path leaves visible
inf/nanexactly like the unmasked path,2 / dswith a masked zero preserves the mask, and ufunc domain errors on masked inputs (e.g.logorsqrtof a masked negative) never extend the mask.Domain errors on visible values (division by zero, overflow, invalid value) now emit the standard NumPy
RuntimeWarningand return the visibleinf/nan(or complex promotion) instead of raising aValueError, identically to the unmasked path.np.ma.maskedis usable as either operand of+,-,*and/, although thenp.ma.masked <op> dsoperator forms may still be intercepted by NumPy and return anumpy.ma.MaskedArray(the type asymmetry is inherent to NumPy, not to SpectroChemPy).
Deprecations
Writer keyword arguments
protocol=anddescription=are now deprecated across the generic, specialized and namespace writer APIs. Writer dispatch continues to be determined only by the filename suffix and exported description metadata continues to come fromdataset.description. Passing either keyword emits aDeprecationWarningin 0.12.x and will raiseTypeErrorin 0.13.0.