rainbow-api 1.4.0__tar.gz → 1.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. rainbow_api-1.5.0/CHANGELOG.md +678 -0
  2. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/MANIFEST.in +10 -0
  3. {rainbow_api-1.4.0/rainbow_api.egg-info → rainbow_api-1.5.0}/PKG-INFO +78 -7
  4. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/README.md +64 -2
  5. rainbow_api-1.5.0/pyproject.toml +82 -0
  6. rainbow_api-1.5.0/rainbow/__init__.py +750 -0
  7. rainbow_api-1.5.0/rainbow/_arguments.py +83 -0
  8. rainbow_api-1.5.0/rainbow/_binning.py +186 -0
  9. rainbow_api-1.5.0/rainbow/agilent/__init__.py +291 -0
  10. rainbow_api-1.5.0/rainbow/agilent/acaml.py +193 -0
  11. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow/agilent/chemstation.py +307 -65
  12. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow/agilent/masshunter.py +394 -110
  13. rainbow_api-1.5.0/rainbow/agilent/method.py +380 -0
  14. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow/agilent/openlab.py +41 -6
  15. rainbow_api-1.5.0/rainbow/agilent/sequence.py +336 -0
  16. rainbow_api-1.5.0/rainbow/asm.py +2471 -0
  17. rainbow_api-1.5.0/rainbow/datadirectory.py +235 -0
  18. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow/datafile.py +17 -4
  19. rainbow_api-1.5.0/rainbow/datasequence.py +230 -0
  20. rainbow_api-1.5.0/rainbow/debug/__init__.py +233 -0
  21. rainbow_api-1.5.0/rainbow/debug/_util.py +88 -0
  22. rainbow_api-1.5.0/rainbow/debug/chemstation_header.py +199 -0
  23. rainbow_api-1.5.0/rainbow/debug/chemstation_text.py +688 -0
  24. rainbow_api-1.5.0/rainbow/debug/dotnet.py +170 -0
  25. rainbow_api-1.5.0/rainbow/debug/ini.py +122 -0
  26. rainbow_api-1.5.0/rainbow/debug/method.py +115 -0
  27. rainbow_api-1.5.0/rainbow/debug/mzxml.py +165 -0
  28. rainbow_api-1.5.0/rainbow/debug/reg.py +112 -0
  29. rainbow_api-1.5.0/rainbow/debug/waters_header.py +128 -0
  30. rainbow_api-1.5.0/rainbow/debug/waters_inf.py +160 -0
  31. rainbow_api-1.5.0/rainbow/debug/xml.py +490 -0
  32. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow/waters/__init__.py +23 -8
  33. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow/waters/masslynx.py +148 -28
  34. {rainbow_api-1.4.0 → rainbow_api-1.5.0/rainbow_api.egg-info}/PKG-INFO +78 -7
  35. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow_api.egg-info/SOURCES.txt +20 -9
  36. rainbow_api-1.5.0/rainbow_api.egg-info/requires.txt +21 -0
  37. rainbow_api-1.4.0/pyproject.toml +0 -54
  38. rainbow_api-1.4.0/rainbow/__init__.py +0 -222
  39. rainbow_api-1.4.0/rainbow/_binning.py +0 -72
  40. rainbow_api-1.4.0/rainbow/agilent/__init__.py +0 -118
  41. rainbow_api-1.4.0/rainbow/datadirectory.py +0 -143
  42. rainbow_api-1.4.0/rainbow_api.egg-info/requires.txt +0 -10
  43. rainbow_api-1.4.0/tests/test_accelerator.py +0 -170
  44. rainbow_api-1.4.0/tests/test_agilent.py +0 -63
  45. rainbow_api-1.4.0/tests/test_binning.py +0 -95
  46. rainbow_api-1.4.0/tests/test_datadirectory.py +0 -85
  47. rainbow_api-1.4.0/tests/test_datafile.py +0 -111
  48. rainbow_api-1.4.0/tests/test_masshunter.py +0 -1285
  49. rainbow_api-1.4.0/tests/test_read.py +0 -81
  50. rainbow_api-1.4.0/tests/test_waters.py +0 -31
  51. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/COPYING +0 -0
  52. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/COPYING.LESSER +0 -0
  53. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow/agilent/_chdelta.pyx +0 -0
  54. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow/agilent/_msprofile.pyx +0 -0
  55. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow/agilent/_uvdelta.pyx +0 -0
  56. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow_api.egg-info/dependency_links.txt +0 -0
  57. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/rainbow_api.egg-info/top_level.txt +0 -0
  58. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/setup.cfg +0 -0
  59. {rainbow_api-1.4.0 → rainbow_api-1.5.0}/setup.py +0 -0
@@ -0,0 +1,678 @@
1
+ # Changelog
2
+
3
+ All notable changes to `rainbow-api` are documented here. This project adheres
4
+ to [Semantic Versioning](https://semver.org/).
5
+
6
+ ## [1.5.0] - 2026-08-27
7
+
8
+ ### Added
9
+ - **`rainbow.debug` metadata-inspection subsystem.** A new opt-in module with
10
+ two entry points, `rb.debug.inspect(path)` and `rb.debug.fields(path)`, that
11
+ decode the many vendor sidecar files a run directory ships (ChemStation
12
+ registers and INIs, .NET and XML blobs, mzXML and Waters headers, method and
13
+ macro dumps, audit trails) into structured fields on demand. It is never run
14
+ by the normal `rb.read` path, and is imported only on first use, so it adds
15
+ no overhead unless called. A catalogue of the formats it decodes is part of
16
+ the documentation.
17
+ - **Allotrope Simple Model (ASM) export and import.** Any `DataDirectory`
18
+ exports to one open, JSON-based ASM document with `datadir.to_asm()` (a dict)
19
+ or `datadir.export_asm(path)` (a file); `rb.from_asm(document)` reconstructs a
20
+ `DataDirectory`. Export is detector-driven and covers UV (a chromatogram cube
21
+ per single-wavelength trace and a 3D spectrum cube per diode-array
22
+ acquisition), charged-aerosol, evaporative-light-scattering, and
23
+ refractive-index channels, mass spectrometry (every monitored ion of a SIM
24
+ acquisition automatically, and chosen ions of a full scan via
25
+ `to_asm(ions=[...])`), and flame-ionization channels, which route to a
26
+ gas-chromatography document. Integrated peaks become processed data. New
27
+ documentation page, "Open data: the Allotrope Simple Model"
28
+ (`docs/source/asm.rst`). Documents target Allotrope revision `REC/2026/06`,
29
+ the current one, and an opt-in test suite validates rainbow's own output
30
+ against the published liquid- and gas-chromatography schemas.
31
+ - **`rb.from_asm` also reads ASM documents rainbow did not write** (for example
32
+ a third-party converter's richer envelope): it reconstructs the UV traces it
33
+ recognizes, ignores unfamiliar fields, and skips cubes it cannot represent
34
+ rather than failing.
35
+ - **`rb.read_sequence(path)` and the `DataSequence` container** for Agilent
36
+ multi-injection sequences: a container of per-injection `DataDirectory`
37
+ objects, with the shared instrument, operator, and injection count as
38
+ metadata. `rb.read_sequence(path, peaks=True)` attaches each injection's
39
+ integrated peaks. A whole sequence exports to one ASM document with
40
+ `sequence.to_asm()` / `sequence.export_asm(path)`, or to one document per
41
+ injection with `export_asm(directory, per_injection=True)`, and
42
+ `rb.sequence_from_asm` reconstructs it. `DataSequence` is exported at the
43
+ package level. The sequence workflow is Agilent-only. New "Sequences"
44
+ documentation guide (`docs/source/sequences.rst`).
45
+ - **Per-injection method and sample metadata** read from the Agilent `acq.macaml`
46
+ and `SAMPLE.XML` sidecars (injection volume, column temperature, flow rate,
47
+ modules, dilution, operator), merged onto each injection. This also enriches
48
+ the metadata returned by a single `rb.read`.
49
+ - **MS acquisition-mode tagging.** Each MS `DataFile` carries a
50
+ `metadata['acquisition_mode']` of `'SIM'` or `'Scan'`, read from authoritative
51
+ vendor metadata (Agilent `acqmeth.txt`, Waters `_FUNCTNS.INF` function types)
52
+ rather than guessed from the data.
53
+ - **The ASM export options are keyword-only.** `to_asm`, `export_asm`, their
54
+ sequence equivalents and the `DataDirectory` / `DataSequence` methods take
55
+ their run or file positionally and everything else by name, so no caller has
56
+ to remember an order and the list stays free to grow. Nothing here shipped
57
+ before 1.5.0, so no existing call changes meaning.
58
+ - **Controls for ASM document size.** `to_asm` / `export_asm` accept
59
+ `export_dad_cube=False` to omit the large diode-array spectrum cube,
60
+ `wavelengths=[...]` to keep only chosen wavelengths, and `decimal_places=N` to
61
+ round emitted numbers. `export_asm` streams one injection document at a time,
62
+ so even a long sequence of large spectra never has to fit in memory at once.
63
+ - **`rb.mz_resolution(path)`** reports the finest m/z spacing a run actually
64
+ records, the practical ceiling on `bin_width`. It is opt-in and never runs
65
+ during an ordinary `rb.read`.
66
+ - **`lxml`-accelerated sequence parsing.** The large `sequence.acaml` is read
67
+ with a tag-filtered iterparse, with the same output as the standard-library
68
+ fallback.
69
+ - **Refractive index detector (RID) support** for Agilent data.
70
+ - **More `.dx` archive manifest metadata** surfaced from the OpenLab `.dx`
71
+ manifest.
72
+ - **Opt-in ASM conformance tests** against a pinned Allotrope schema and the
73
+ Allotrope Foundation Ontology (AFO), enabled with `RAINBOW_TEST_ASM_SCHEMA=1`.
74
+ - **ASM export covers the Agilent MassHunter DAD support added in 1.4.0.**
75
+ Export routes on the detector rather than the file format, so a MassHunter
76
+ run's signals and spectra map as a Chemstation `.ch`/`.uv` pair does: one
77
+ chromatogram cube per single-wavelength signal and one 3D spectrum cube for
78
+ the wavelength grid, both honouring `export_dad_cube` and `wavelengths`. A
79
+ DAD's telemetry stays analog data and is never exported as a detector
80
+ channel.
81
+ - **`rb.iso_timestamp(value)`** converts a vendor timestamp to ISO 8601, or
82
+ returns `None` for a spelling rainbow cannot read. The vendors write
83
+ day-first wall clock and name the month, so `metadata['date']` does not sort
84
+ chronologically as text; this is the conversion the ASM export uses, and what
85
+ it returns does sort. The "Sequences" guide uses it to recover acquisition
86
+ order.
87
+ - **`DataDirectory.path`**, the path the run was read from, alongside the
88
+ `name` it already carried. `DataSequence` has had both all along.
89
+
90
+ ### Changed
91
+ - **A diode-array channel in a 179 `.ch` container is now read as UV, not
92
+ FID. Breaking:** the container version says how the data is encoded, not what
93
+ measured it, and Chemstation writes both kinds into the same one. (The 181
94
+ layout of the same container records no signal string, so there is nothing to
95
+ read a detector from and a 181 file is still always read as FID.) The
96
+ detector now comes from the channel's own signal string, so a channel
97
+ reporting `DAD1A,Sig=210,4 Ref=off` in mAU is ultraviolet absorbance at
98
+ 210 nm rather than a flame ionization trace in pA. `DataDirectory.detectors`
99
+ and `by_detector` change accordingly for such a run, and
100
+ `get_detector('FID')` on one now raises where it previously returned the
101
+ diode-array channels. Those channels also gain a `wavelength` ylabel and
102
+ their optics in metadata. Reading the detector from the version byte was also
103
+ what sent whole liquid chromatography runs out as gas chromatography
104
+ documents measuring picoamps.
105
+ - **A binned Waters function's ylabels are `float64` rather than `float32`.**
106
+ The values are unchanged; the array they are handed back in is wider. This
107
+ is the binning change above reaching the axis, so it applies to the formats
108
+ that bin: a function whose labels come from `_FUNCTNS.INF` rather than from
109
+ the data (the 2- and 4-byte formats, which include every single-wavelength
110
+ UV function) is still `float32`. Code that concatenates axes across vendors
111
+ should keep widening rather than assume one dtype.
112
+ - **Chemstation header strings are decoded as UTF-16 rather than by taking
113
+ every other byte.** The two agree while the text is ASCII; for anything else
114
+ the mangled bytes were not valid UTF-8, so the field was dropped and came
115
+ back empty. Headers written in any other script now read correctly, which
116
+ can add `notebook`, `method`, and similar fields to `DataFile.metadata` for
117
+ runs where they were previously missing.
118
+ - **`import rainbow` is about five times faster** (roughly 165 ms to 35 ms on
119
+ the machine this was measured on). `pandas`, needed only for the Waters
120
+ transition table, was imported at module load and was by a wide margin the
121
+ largest cost of importing the package. It is now imported where it is used,
122
+ as `matplotlib` already was, and `rainbow.debug`, the next largest cost, is
123
+ imported on first use.
124
+ - **Declared `requires-python = ">=3.8"`.** rainbow already needed 3.8, but
125
+ said so nowhere pip could see, so an older interpreter would install this and
126
+ fail at import instead of resolving an older rainbow. No upper bound.
127
+ - **`matplotlib` and `pandas` are no longer installed by default. Breaking:**
128
+ neither is needed to read a file. `DataFile.plot` is the only thing that
129
+ draws, and one Waters helper is the only thing that returns a DataFrame, so
130
+ a default install no longer carries either. Both now say which extra to
131
+ install if called without it: `pip install rainbow-api[plot]` and
132
+ `pip install rainbow-api[waters]`. `lxml` stays a default dependency, since
133
+ without it `rb.read_metadata` is about 2.5 times slower.
134
+ - **rainbow reads without `lxml` if it has to.** The vendor XML paths that used
135
+ lxml-only XPath were rewritten against the standard library, and the parsers
136
+ fall back to it when lxml is absent; every bundled fixture parses to an
137
+ identical result either way. This is a robustness fallback, not the intended
138
+ configuration, and `rainbow.debug` still needs lxml outright: recovering
139
+ structure from malformed and mis-encoded sidecars is exactly what its
140
+ recovering parser is for.
141
+ - **m/z binning split into `display_precision` and `bin_width`. Breaking:** the
142
+ `precision` argument to `rb.read` (and the vendor parsers) is replaced by two
143
+ independent controls. `display_precision` (default `'auto'`) is cosmetic and
144
+ rounds only the displayed m/z labels; `bin_width` is the lossy step that sums
145
+ intensities into a shared m/z grid, and applies to MS channels only.
146
+ `bin_width` defaults to nominal mass (1 Da) for unit-resolution data, and for
147
+ HRMS profile data defaults to the per-scan axis (no shared grid at all), so
148
+ binned output is unchanged by default. A `display_precision` too coarse to
149
+ label a `bin_width`'s bins distinctly is raised to fit, so labels always name
150
+ the columns one to one, and a per-scan centroid is left unrounded because its
151
+ labels are its data. Use `rb.mz_resolution(path)` to see how fine a
152
+ `bin_width` a run can actually support. Code passing `precision=` must now
153
+ pass `display_precision=`, or `bin_width=` to control the binning step.
154
+ **A positional call changes meaning silently.** `precision` sat where
155
+ `display_precision` now sits, so `rb.read(path, 3)` still runs and no longer
156
+ bins: it used to mean a 0.001 Da grid and now means nominal mass with three
157
+ label decimals. A keyword call gets a `TypeError` naming the replacement; a
158
+ positional one cannot be told apart from a deliberate `display_precision`.
159
+ Search for positional calls before upgrading.
160
+
161
+ `display_precision` no longer applies to a per-scan channel at all: on an
162
+ HRMS profile or a centroid, `mass_labels(i)` is the m/z axis itself rather
163
+ than a display of it, so rounding it discarded measured precision. A
164
+ calibrated TOF centroid kept only 4 decimals on read, and an HRMS profile at
165
+ the vendor default of 0 decimals returned 105,152 points under 2,398 distinct
166
+ labels. `ProfileDataFile.mz_decimals` now defaults to `None` and can still be
167
+ set on the returned file.
168
+ - **`rb.read(path, centroid=True)` returns a `CentroidDataFile`. Breaking:** a
169
+ MassHunter `MSPeak.bin` holds a separate peak list per scan, so there is no
170
+ one m/z axis to put them on. The returned object exposes `scan(i)` and
171
+ `mass_labels(i)` and deliberately refuses the shared-axis operations
172
+ (`ylabels`, `data`, `extract_traces`, `to_csvstr`, `plot`), each with an
173
+ explanation, rather than inventing a grid. Pass a `bin_width` to opt into one.
174
+ - **`ProfileDataFile.tof` is renamed `flight_times`. Breaking:** the attribute
175
+ holds the shared flight-time axis, and the old name read as though it were the
176
+ instrument rather than the quantity.
177
+ - **`display_precision` is bounded above as well as below.** Past about 306
178
+ decimals numpy's rounding overflows and every m/z label becomes NaN, which
179
+ breaks the rule that the labels name their columns one to one. The read entry
180
+ points now refuse a `display_precision` above 17, the point at which a float64
181
+ label stops carrying more information.
182
+ - **A `bin_width` of infinity or NaN is refused.** Infinity is greater than
183
+ zero, and then divides every m/z into one bin, so a run came back as a single
184
+ column labelled NaN that matched any ion asked for. NaN lost every comparison
185
+ and reached the parser's overflow guard, which reported a width that was too
186
+ small.
187
+ - **`rb.agilent.read` and `rb.waters.read` validate their arguments.** They are
188
+ documented entry points, but only `rb.read` checked `display_precision` and
189
+ `bin_width`, so a negative width silently produced duplicate m/z labels there
190
+ and a non-integer precision raised a `TypeError` from inside the parser.
191
+ - **`MZ_FLOORS['agilent']` is 0.05, not 0.1.** A Chemstation `.ms` stores each
192
+ m/z as a big-endian short over 20, a 0.05 Da lattice. Chemstation usually
193
+ writes one decimal place, so a run resolves 0.1 and every bundled fixture
194
+ does, but warning that 0.05 is too fine would be false of a file that
195
+ resolves it. `rb.mz_resolution` still answers per file.
196
+ - **Injections are looked up without regard to case**, the way
197
+ `DataDirectory.get_file` already matched a channel: `sequence["RUN.D"]`,
198
+ `"run.d" in sequence` and `get_injection` all agree. `by_name` still spells
199
+ each name the way its directory does.
200
+
201
+ ### Fixed
202
+ - **A UV channel's wavelength ylabel is a number.** It arrived as text out of
203
+ the signal string, so `extract_traces(254.0)` raised on a ChemStation or
204
+ OpenLab channel and worked on the MassHunter channel beside it, and the
205
+ spelling followed the vendor's own (`'210'` against `'210.0'`). A channel
206
+ with no wavelength (FID, CAD, ELSD, a bare analog input) has no number to
207
+ give and keeps the empty label it always had.
208
+ - **ASM export no longer writes absorbance a thousand times too small.** The
209
+ AU-to-mAU normalization was keyed on an exact `"AU"`, while every other unit
210
+ table in the exporter case-folds and strips. The unit is whatever text the
211
+ vendor file carried, so a Waters run spelling it `au` exported unscaled into
212
+ a document that then passed strict validation.
213
+ - **A relabeled RID channel says so.** The detector documentation promised that
214
+ CAD, ELSD and RID all warn when the values go out under a measure they are
215
+ not in; the absorbance path returned early and RID's `nRIU` was the one
216
+ relabeled detector that stayed quiet.
217
+ - **A malformed member no longer aborts a `.dx` inspection.** `zipfile` raises
218
+ `NotImplementedError` for an unsupported compression method and
219
+ `RuntimeError` for an encrypted member, neither of which is an `OSError`, and
220
+ the archive walk is advanced outside `inspect`'s per-file guard, so one bad
221
+ member took down the whole run.
222
+ - **`rainbow.debug` recovers Windows-codepage characters** instead of replacing
223
+ them. The documented latin-1 fallback was unreachable, because decoding with
224
+ `errors="replace"` never raises, so a cp1252 copyright sign or an accented
225
+ operator name became U+FFFD.
226
+ - **`rainbow.debug.xml` reports a UTF-16 placeholder as empty,** not as a
227
+ malformed document: only the UTF-8 BOM was stripped before the emptiness
228
+ test, and these sidecars are commonly UTF-16.
229
+ - **The first line of a ChemStation report is classified by its own
230
+ neighbours.** `is_banner[i - 1]` wrapped to the last line of the file when
231
+ `i` was 0.
232
+ - **The mzXML reader closes the file it abandons.** It stops at the first scan,
233
+ which left the handle open until the iterator was collected.
234
+ - **The instrument module inventory is read from the `acq.macaml` Agilent
235
+ actually writes.** It looked for section headers spelled `DAD (G7117B)`;
236
+ ChemStation names the section for the module and puts the model in the
237
+ section ID, so the inventory was empty for every real acquisition method and
238
+ `metadata['modules']` was absent. The ASM device system fell back to the bare
239
+ chromatograph entry as a result.
240
+ - **`rainbow.debug.fields` returns the same answer on every filesystem.** The
241
+ walk sorted names within a directory but took sibling directories in
242
+ `readdir` order, which is creation order on APFS and a hash order on ext4.
243
+ Since a scalar field keeps the first value seen, the reported instrument and
244
+ method depended on the machine. The whole stream is now sorted by relpath,
245
+ which is what the walk already claimed.
246
+ - **UTF-16 method and macro files are parsed rather than called binary.** The
247
+ text-or-binary test counted non-printable bytes in the raw file, and UTF-16
248
+ is about half NUL, so every UTF-16 member of that family was classified
249
+ binary and skipped. Seven of the nine committed `.MTH`/`.MAC` fixtures are
250
+ UTF-16.
251
+ - **`rainbow.debug` decodes BOM-less UTF-16BE.** The byte order is now inferred
252
+ from where the NULs fall rather than assumed little endian, which turned
253
+ every big-endian sidecar into mojibake.
254
+ - **`rainbow.debug.xml.canonical` no longer raises on an empty root.** A
255
+ document like `<Sample/>` converts to a bare string rather than a mapping,
256
+ and the handlers read fields off a mapping. `fields` hid the `AttributeError`
257
+ behind a blanket except; the documented `canonical(parse(path))` call did not.
258
+ - **The lxml sequence parser no longer drops peaks from a nested document.** It
259
+ pruned earlier siblings unconditionally after each matched element, so a
260
+ `Signal` inside a `SignalResult` destroyed the `Signal_ID` and `Peak`
261
+ siblings that `SignalResult` had not been read for yet. Agilent's own exports
262
+ do not nest that way, but the reader is pointed at documents rainbow did not
263
+ write, and the two backends are documented to agree.
264
+ - **The m/z probe reaches partial `.ms` files.** `_labels_only` was not passed
265
+ to the partial reader, so `rb.mz_resolution` built the full intensity grid for
266
+ those channels to read nothing but the axis off it.
267
+ - **ASM export refuses a non-finite value instead of writing `NaN`.** Bare
268
+ `NaN` and `Infinity` are not JSON, and a document holding one is rejected by
269
+ any strict reader outside Python.
270
+ - **`export_asm` no longer truncates a file on a handle that cannot hold
271
+ Unicode.** It forced characters through as themselves, so a handle the caller
272
+ opened as cp1252 or latin-1 raised `UnicodeEncodeError` partway through and
273
+ left a file that looked complete. Such a handle now gets escaped JSON, which
274
+ says the same thing; a UTF handle is unchanged.
275
+ - **ASM export says when it emits a timestamp with no UTC offset.** That is the
276
+ single reason a default export of most ChemStation and Waters runs does not
277
+ validate, and only the changelog and the concepts page said so. Warned once
278
+ per document, and not at all when the source recorded an offset or
279
+ `utc_offset=` supplied one.
280
+ - **A Waters sequence directory is told why it cannot be read.** It was told it
281
+ holds no injection subdirectories, which was untrue of a directory full of
282
+ `.raw` injections; the reason is that sequence reading is implemented for
283
+ Agilent.
284
+ - **`pip install rainbow-api[test]` installs `python-lzf`,** so CI runs the two
285
+ LZF `MSProfile.bin` decode tests instead of skipping them.
286
+ - **ASM timestamps are ISO 8601.** `measurement time` and `injection time`
287
+ passed the vendor's own spelling straight through, so an exported document
288
+ carried values like `27-Feb-18, 10:11:50` where the Allotrope core schema
289
+ types an ISO 8601 timestamp ("All timestamps MUST be in ISO8601 date/time
290
+ format"). Every vendor path was affected except OpenLab `.dx`, which already
291
+ stores ISO. The ChemStation, Waters, and Agilent sequence spellings are now
292
+ converted; one rainbow cannot parse is omitted rather than passed through,
293
+ since a vendor-format string there is a value no ASM reader can read.
294
+
295
+ Most of those formats record local wall clock with no UTC offset, and rainbow
296
+ will not invent one: a fabricated offset would move the recorded instant by
297
+ up to a day. So the default output is ISO 8601 without an offset, which is
298
+ not strict RFC 3339 (what `format: date-time` means). Pass the new
299
+ `utc_offset=` argument to `to_asm`, `export_asm`, and their sequence
300
+ equivalents to supply the offset and get a fully conforming document; an
301
+ offset the source did record is never overridden. See the ASM documentation.
302
+ - **The ASM conformance test now checks string formats.** It built its
303
+ validator without a format checker, and jsonschema treats `format` as an
304
+ annotation unless you supply one, so the suite validated structure and never
305
+ checked a single timestamp. That is why the non-ISO timestamps above passed
306
+ it. The `validate` extra now also installs `rfc3339-validator`, without which
307
+ jsonschema silently skips `date-time` even when a checker is supplied, and
308
+ the test skips loudly rather than passing vacuously if it is missing.
309
+ - **A non-ultraviolet detector module is no longer reported as an ultraviolet
310
+ one** in a document's instrument inventory. Any module whose type was
311
+ `detector`, or whose name merely contained the word, was filed under the
312
+ ultraviolet class, so an FID, RID, ELSD, mass-spectrometer, or
313
+ charged-aerosol module contradicted the very cube it described. Each now maps
314
+ to the AFO class its cube already uses, matched as whole words with an
315
+ optional module index (`FID1`, `RID1A`, `FID_2`) so `hybrid` and `cascade`
316
+ are not mistaken for detectors. Thermal-conductivity, electron-capture, and
317
+ fluorescence modules get their own AFO classes, and the spelled-out
318
+ ultraviolet names (`Variable Wavelength Detector`, `TUV`, `PDA`) are
319
+ recognized alongside the acronyms.
320
+ - **A detector in a gas chromatography document is no longer typed as a liquid
321
+ chromatography one.** AFO makes `liquid chromatography detector` and `gas
322
+ chromatography detector` disjoint siblings, so the generic class used for a
323
+ detector AFO cannot name (a charged-aerosol detector, an analog input) has to
324
+ follow the document it rides in; it was fixed at the liquid one. This applies
325
+ to both the instrument inventory and the per-channel device control document.
326
+ A run with no module inventory at all likewise now declares itself a
327
+ `gas chromatograph` rather than a `liquid chromatograph` when exported as GC.
328
+ - **`rb.from_asm` no longer raises on documents rainbow did not write.** It
329
+ tolerated one shape and crashed on the rest: a missing measurement aggregate,
330
+ a lone object where a list is declared, an empty device-control list, and a
331
+ cube described without its `data` member, which the published cube structure
332
+ does not require. It also no longer raises when a field holds something other
333
+ than its declared type: a cube, injection document, or device system that is
334
+ not an object, a device document that is not a list, a name or analyst that is
335
+ not a string, a timestamp written in the `{"value": ...}` form the core schema
336
+ also permits, or cube values that are not the numbers the cube declares.
337
+ Anything it cannot represent is skipped, as an unrepresentable cube always
338
+ was, and an unreadable field costs only itself: the channel still comes back.
339
+ Verified by mutating every field of five documents, rainbow's own and two
340
+ third-party, to each of eleven wrong shapes (10,362 reads, no exception).
341
+ - **`rb.read(path, centroid=True, bin_width=...)` no longer warns falsely.** The
342
+ m/z floors describe unit-resolution data, but were applied to calibrated
343
+ MassHunter TOF centroids, which resolve far below them, so a perfectly
344
+ sensible bin was reported as too fine.
345
+ - **`rb.mz_resolution(path, centroid=True)`** can inspect a centroid run. MS
346
+ data in an `MSPeak.bin` is parsed only under that flag, so such a run
347
+ previously came back as though it had no MS at all. A quantized centroid
348
+ (an uncalibrated quadrupole, whose peak m/z sit near nominal mass) reports
349
+ its quantization. A calibrated TOF centroid is parsed but reports nothing:
350
+ its peaks carry continuous m/z, so there is no lattice to state, and the
351
+ channel is absent from the result rather than given an invented number.
352
+ - **`DataDirectory.list_analog()` no longer raises on a MassHunter DAD's
353
+ telemetry.** It read a trace's description from a key MassHunter does not
354
+ use, so listing the analog traces of a run acquired with a DAD raised
355
+ `KeyError` instead of printing them.
356
+ - **`rainbow.debug` reports a missing `lxml` instead of hiding it.**
357
+ `inspect()` recorded the failure per file and `fields()` returned an empty
358
+ record, so an environment without `lxml` looked like a run with no metadata.
359
+ - **The `sequence.acaml` reader closes its file deterministically.** The parse
360
+ stops as soon as it has the instrument, which abandons the iterator
361
+ mid-document and left the handle to be closed whenever the interpreter got
362
+ round to it. It is now closed as the reader unwinds.
363
+ - **An Agilent MassHunter DAD signal now reports its optics.** The `.cd`
364
+ descriptor gives each signal the same `Sig=`/`Ref=` description Chemstation
365
+ writes, but it was left unparsed, so a `.cg` channel carried no `wavelength`,
366
+ `bandwidth`, or reference band in its metadata while the equivalent `.ch`
367
+ channel did. They are now read with the parser the `.ch` and `.dx` readers
368
+ already share. An ASM export of a MassHunter DAD consequently records each
369
+ channel's detector wavelength setting, and a document that had lost the
370
+ wavelength on the way back through `rb.from_asm` now round-trips intact.
371
+
372
+ ## [1.4.0] - 2026-08-13
373
+
374
+ ### Added
375
+ - **Agilent MassHunter DAD support.** A MassHunter `.d` stores its DAD data in
376
+ four files that the Chemstation decoders do not read, so until now a `.d`
377
+ acquired with a diode-array detector returned no UV data at all - silently,
378
+ since MassHunter parsing is opt-in and an unread detector looks the same as
379
+ an absent one. `rb.read` now parses them: `DAD1.cd` describes the signals in
380
+ `DAD1.cg` (one chromatogram each), and `DAD1.sd` describes the spectra in
381
+ `DAD1.sp` - the same two views the Chemstation format splits into `.ch` and
382
+ `.uv` files.
383
+
384
+ The spectra become a single (retention time x wavelength) `DataFile` named
385
+ after the `.sp`, and each signal its own, carrying the Chemstation signal
386
+ letter (`DAD1A.cg`, `DAD1B.cg`, ...) since here they share one file. Both
387
+ descriptors give the byte offset of every record they describe, so the data
388
+ files are indexed rather than walked at an assumed stride - signals sampled at
389
+ different rates, and spectra that are not evenly spaced, are read correctly.
390
+ Unlike the Chemstation `.uv`/`.ch` formats there is no delta encoding and no
391
+ scaling factor: the values are plain little-endian float64.
392
+
393
+ Spectra whose wavelength axis changes during a run cannot form one grid, and
394
+ are declined with a warning rather than reshaped.
395
+ - `rb.read(..., telemetry=True)` also parses the traces a DAD records beside
396
+ its signals (lamp voltage, board and optical-unit temperature). Off by
397
+ default and returned as analog data, matching `.dx` telemetry — including
398
+ that naming one in `requested_files` parses it regardless of the flag.
399
+ - `tests/test_masshunter.py::test_dad_*` and the `bronze.D` fixture: a
400
+ four-retention-time slice of a real QQQ+DAD acquisition keeping all five
401
+ absorbance signals, all three telemetry traces, and the full 190-550 nm axis,
402
+ with the telemetry deliberately at a different point count from the signals.
403
+
404
+ ### Changed
405
+ - **The MassHunter parser is now always consulted for a `.d`, not only under
406
+ `hrms`/`centroid`.** DAD data is parsed unconditionally, as the Chemstation
407
+ UV formats are; the MS parsing inside remains gated on those flags. A `.d`
408
+ that holds DAD data therefore yields UV `DataFile`s where it previously
409
+ yielded none.
410
+
411
+ ### Fixed
412
+ - **`rb.read_metadata()` now reports a MassHunter run's DAD files** alongside
413
+ its MS ones. The MassHunter branch returned as soon as it had found
414
+ `MSProfile.bin`/`MSPeak.bin`, so a run carrying both came back as MS-only
415
+ while `rb.read()` returned its chromatograms and spectra.
416
+
417
+ ## [1.3.1] - 2026-07-22
418
+
419
+ ### Added
420
+ - **`hrms` optional-dependency extra** (`pip install rainbow-api[hrms]`), which
421
+ installs `python-lzf` for LZF-compressed Agilent MassHunter `MSProfile.bin`
422
+ segments. The extra was referenced in the docs but never declared, so the
423
+ install warned the extra did not exist and silently installed nothing.
424
+ - **`hrms_available` metadata hint** on `rb.read(path)` and
425
+ `rb.read_metadata(path)`, mirroring `centroid_available`: a MassHunter `.D`
426
+ whose `MSProfile.bin` was not parsed now advertises that profile data is
427
+ present and needs `hrms=True`.
428
+
429
+ ### Fixed
430
+ - **`rb.read_metadata()` on Agilent MassHunter `.D` folders** now reports the
431
+ `MSProfile.bin`/`MSPeak.bin` datafiles (plus the `hrms_available` /
432
+ `centroid_available` hints) instead of returning an empty datafile list.
433
+
434
+ ## [1.3.0] - 2026-06-24
435
+
436
+ ### Changed
437
+ - **Agilent HRMS profile data is now per-scan by default. Breaking:**
438
+ `rb.read(path, hrms=True)` returns the faithful per-scan representation (a
439
+ `rainbow.agilent.masshunter.ProfileDataFile` per flight-time grid) instead of
440
+ the shared-grid `DataFile`. A Q-TOF/TOF `MSProfile.bin` has a per-scan m/z
441
+ axis (the flight-time-to-m/z calibration drifts between scans), so projecting
442
+ every scan onto one shared grid inserts zeros and merges peaks. Pass a
443
+ `bin_width` to opt into the shared grid.
444
+ - **`prec` renamed to `precision`** on `rb.read` (and the vendor parsers).
445
+ **Breaking:** code passing `prec=` must now pass `precision=`.
446
+ - **`precision` now defaults to `'auto'` and is resolved per file from the
447
+ actual data type:** 4 decimals for high-resolution data (the HRMS profile and
448
+ TOF centroids) and 0 (whole numbers) for unit-resolution data (UV,
449
+ GC/quadrupole MS, ICP-MS, Waters). Previously the default was a flat `0`,
450
+ which silently reduced high-resolution m/z to nominal mass. Pass an explicit
451
+ integer to override (including `0`).
452
+
453
+ ### Added
454
+ - **Per-scan (unbinned) HRMS profile representation** (now the default; see
455
+ Changed). `ProfileDataFile` exposes `scan(i)`, `mass_labels(i)`, the shared
456
+ `tof` axis, and the raw `data` matrix. It has no single `ylabels`, and the
457
+ `DataFile` operations that need one shared m/z axis (`ylabels`,
458
+ `extract_traces`, `to_csvstr`, `export_csv`, `plot`) raise a clear error
459
+ pointing at `scan(i)`/`mass_labels(i)` and the documentation. New
460
+ documentation page, "HRMS Profile Data"
461
+ (`docs/source/agilent/hrms_data_model.rst`).
462
+ - **`bin_width` argument on `rb.read`** is the single switch for HRMS
463
+ shared-grid binning: omit it for the per-scan representation, pass a width (in
464
+ daltons) to project onto one shared grid. It is fully independent of
465
+ `precision` (which only rounds the reported m/z labels and has no effect on the
466
+ grid). A `bin_width` finer than `10**-precision` is allowed but warns, since
467
+ two bins may then round to the same m/z label.
468
+
469
+ ### Fixed
470
+ - **`MSProfile.bin` RLE segments whose first scan opens with a literal run
471
+ (#27).** The run-length-encoded intensity stream is `[point-count word]
472
+ [negated leading-zero count][token stream]`, with the token stream opening at
473
+ 4-byte width. The reader instead read a second int32 as a "width flag", which
474
+ happened to decode correctly only when the first token was a width switch
475
+ (the common case) but raised `Malformed MSProfile.bin RLE segment` on
476
+ high-signal scans that open with a literal 4-byte intensity. Fixed in both the
477
+ pure-Python `decompress_inten_list` and the Cython accelerator
478
+ (`_msprofile.pyx`); validated on two real Agilent Q-TOF datasets (every scan's
479
+ decoded maximum matches the independently stored `MaxY`, 0 mismatches across
480
+ all 1256 scans of each).
481
+ - **Shared-grid binning no longer emits all-zero columns.** A column of the
482
+ shared grid is meant to be a bin some scan actually filled (empty bins are
483
+ dropped), but the sparse-path branch of `bin_to_grid` keyed its columns off
484
+ point presence rather than nonzero intensity, so points whose recorded
485
+ intensity is `0` produced phantom all-zero columns (about 90 of ~315,000 on
486
+ the default fine grid). The sparse path now drops zero-sum columns, matching
487
+ the dense path.
488
+
489
+ ## [1.2.0] - 2026-06-22
490
+
491
+ ### Added
492
+ - **Agilent MassHunter ICP-MS support (issue #25).** ICP-MS `.D` directories
493
+ (e.g. Agilent 7700 / 8900) now parse via a new `parse_icpmsdata`, detected by
494
+ the presence of `MSScan_XSpecific.bin`. Single tune mode and one measurement
495
+ per isotope. Contributed by Jeremy Hourigan (UC Santa Cruz).
496
+ - **`format` argument on `rb.read` and `rb.read_metadata`** to force the vendor
497
+ parser (`'agilent'` or `'waters'`), bypassing detection.
498
+ - **Content-based vendor detection.** A directory whose name lacks a
499
+ `.D`/`.raw`/`.dx` suffix is identified from its contents; suffixed paths are
500
+ unaffected.
501
+ - **Optional Cython accelerator for the Agilent `.ch` decode**
502
+ (`rainbow/agilent/_chdelta.pyx`) - ~11x faster, bit-identical, with a
503
+ transparent pure-Python fallback.
504
+
505
+ ### Changed
506
+ - **Faster MS spectrum parsing.** Vectorized binning (shared
507
+ `rainbow/_binning.py`) and lookup-table exponentials replace the per-scan
508
+ loops in the Waters `_FUNC.DAT` and Agilent `.ms` decoders. Output unchanged;
509
+ ~2-3x faster.
510
+ - **Test suite migrated to pytest** (added a `test` extra; run with `pytest`).
511
+
512
+ ## [1.1.0] - 2026-06-17
513
+
514
+ ### Fixed
515
+ - **MassHunter HRMS profile data is parsed when scans also store centroids.**
516
+ When an acquisition writes `MSPeak.bin` alongside `MSProfile.bin`, each
517
+ `MSScan.bin` record carries two `SpectrumParamValues` blocks (a profile and a
518
+ centroid block; the schema element is `maxOccurs="unbounded"`) instead of one.
519
+ The reader assumed exactly one block, so after the first scan it mis-parsed
520
+ the centroid block as the next scan's fields and crashed (`struct.error`).
521
+ `rainbow` now reads each record at its true stride - taken from the MSTS.xml
522
+ scan count when consistent, otherwise inferred from the record geometry - and
523
+ reads the profile block. Validated on real Agilent Q-TOF (issue #27) and
524
+ TOF-MS datasets.
525
+ - **HRMS calibration without `MSMassCal.bin`.** Some Q-TOF/TOF acquisitions omit
526
+ the per-scan `MSMassCal.bin` and keep only the default calibration in
527
+ `DefaultMassCal.xml`; the parser raised `FileNotFoundError` opening the former.
528
+ `rainbow` now falls back to reconstructing each scan's calibration row from
529
+ `DefaultMassCal.xml` (by `CalibrationID`). The per-scan refinement is sub-ppm,
530
+ so the m/z reproduce the per-scan values to <0.0001 Da (checked against the
531
+ `magenta`/`cyan` fixtures, which carry both files).
532
+ - **Interrupted acquisitions no longer fail.** When `MSScan.bin` describes more
533
+ scans than `MSProfile.bin` actually contains (an aborted run, sometimes with a
534
+ stale `MSTS.xml` scan count), `rainbow` keeps the complete leading scans
535
+ instead of raising on the truncated segment.
536
+
537
+ ### Added
538
+ - **Agilent MassHunter centroid (`MSPeak.bin`) support (issue #37).** `MSPeak.bin`
539
+ stores the peak-picked (centroid) spectrum of each scan - the counterpart to
540
+ the dense profile trace in `MSProfile.bin`. `rb.read(..., centroid=True)` now
541
+ parses it (off by default, like `hrms`). GC-quadrupole centroids are stored as
542
+ m/z directly (validated to 7e-5 relative agreement against the same
543
+ acquisition's `data.ms`); Q-TOF/TOF centroids are stored as time-of-flight and
544
+ are calibrated with the same `DefaultMassCal.xml`/`MSMassCal.bin` path as the
545
+ profile. When a `.D` contains `MSPeak.bin` but is read without the flag,
546
+ `centroid_available` is set in the directory metadata so the option is
547
+ discoverable. The centroid decoding was contributed by denisshragin.
548
+ - `tests/test_masshunter.py::TestMasshunterMultiBlock` and
549
+ `TestMasshunterCentroid`: trimmed real TOF-MS fixtures (`gold.D`, a 3-scan
550
+ profile+centroid slice; `copper.D`, the same with a truncated `MSProfile.bin`)
551
+ covering the two-block record stride, the `DefaultMassCal.xml` calibration
552
+ fallback, geometry-based stride inference, incomplete-acquisition recovery, and
553
+ the centroid path (block selection, GC-quad and calibrated-TOF axes, the
554
+ `centroid=True` flag, and the metadata note).
555
+
556
+ ## [1.0.16] - 2026-06-17
557
+
558
+ ### Added
559
+ - **Agilent MassHunter HRMS Q-TOF profile support (issue #27).** Q-TOF
560
+ acquisitions store `MSProfile.bin` intensities with a run-length encoding
561
+ rather than LZF compression, which made the parser raise `ValueError: error
562
+ in compressed data`. `rainbow` now detects the encoding from each scan
563
+ segment's own header and decodes it (`decompress_inten_list`). The decode is
564
+ validated against two real datasets (474 and 1256 scans): every scan's
565
+ decoded maximum intensity matches the `MaxY` value stored independently in
566
+ `MSScan.bin`.
567
+ - Support for the newer MassHunter `MSScan.xsd` variant, whose complex-type
568
+ references are qualified with the schema's target-namespace prefix (e.g.
569
+ `mstns:ScanRecordType`). These previously raised `KeyError` while reading
570
+ `MSScan.bin`.
571
+ - **Polynomial m/z calibration for HRMS.** When `DefaultMassCal.xml` provides a
572
+ polynomial `ValueUseFlags`, `rainbow` now applies the polynomial correction
573
+ (`MSMassCal.bin` stores `[coeff, base, left, right, c0..c5]` per scan) on top
574
+ of the traditional calibration. Validated to <0.0001 Da against m/z that
575
+ Agilent MassHunter BioConfirm exports for the reporter's spectra; the
576
+ traditional calibration alone is ~1-2 ppm off. Files without
577
+ `DefaultMassCal.xml` keep the traditional calibration.
578
+ - **Optional compiled accelerator for the MSProfile.bin run-length decode**
579
+ (`rainbow/agilent/_msprofile.pyx`). The decode is an inherently sequential,
580
+ variable-width byte loop; the Cython version is ~100x faster than the
581
+ pure-Python loop and bit-identical. Like the `.uv` accelerator it is optional
582
+ — without a compiler or Cython, `rainbow` falls back to pure Python.
583
+ - `tests/test_masshunter.py`: parses trimmed real Q-TOF profile fixtures
584
+ (`magenta.D`, `cyan.D`) end to end without `python-lzf`, cross-checking the
585
+ decoded intensities and validating the calibrated m/z against BioConfirm.
586
+ `tests/test_accelerator.py` adds parity tests for the `_msprofile` extension.
587
+
588
+ ### Changed
589
+ - **MassHunter HRMS no longer requires `MSTS.xml`.** The number of retention
590
+ times is now recovered by reading `MSScan.bin` to EOF instead of from
591
+ `MSTS.xml`, which is absent from Agilent OpenLab `.rslt`/`.sirslt` result
592
+ folders. Validated against the `yellow` fixture (centroided) and two real
593
+ HRMS profile datasets, where the recovered count matches `MSTS.xml` exactly.
594
+ - The `python-lzf` import is now lazy and only happens when an LZF-compressed
595
+ `MSProfile.bin` segment is actually encountered, so the rest of the
596
+ MassHunter module - including the run-length-encoded Q-TOF profile path -
597
+ imports and runs without `python-lzf` installed.
598
+ - **Faster HRMS profile parsing (~8x end to end** on large files; e.g. a 185 MB
599
+ `MSProfile.bin` went from ~35 s to ~4.5 s). The compiled decoder removes the
600
+ decode bottleneck, the per-scan m/z arrays are concatenated instead of routed
601
+ through a ~100M-element Python list, and the (retention time x m/z) grid is
602
+ binned with integer keys in a single pass instead of a global sort (with a
603
+ memory-bounded fallback to the sort-based path). Output is unchanged.
604
+
605
+ ## [1.0.15] - 2026-06-17
606
+
607
+ ### Added
608
+ - **Agilent OpenLab CDS (`.dx`) support.** OpenLab 2.x exports a single OPC
609
+ (zip) archive rather than a `.D` directory. `rb.read` now accepts a `.dx`
610
+ path and parses its payloads with the existing Chemstation decoders: the DAD
611
+ spectrum (`.UV`), single-wavelength signals (`.CH`), and—opt-in—instrument
612
+ telemetry (`.IT`). Trace names, units, and detector roles are recovered from
613
+ the `injection.acmd` manifest, since the payload files are named by GUID. The
614
+ DAD spectrum's absorbance is corrected by a `2**-17` fixed-point shift unique
615
+ to this format, validated against the file's own single-wavelength channels.
616
+ Decoding and test data were contributed by an anonymous collaborator.
617
+ - `rb.read(..., telemetry=True)` parses `.dx` instrument-telemetry traces
618
+ (pressure, temperature, flow, etc.) as analog data. Off by default, since
619
+ most users only want the detector signals; a telemetry trace named in
620
+ `requested_files` is parsed regardless of the flag.
621
+ - `tests/test_agilent.py::test_teal` and `test_teal_telemetry_off`: a `.dx`
622
+ fixture (DAD spectrum, two wavelength channels, two telemetry traces)
623
+ verified end-to-end, plus coverage of the telemetry opt-in behavior.
624
+
625
+ ### Changed
626
+ - The `OL` `.uv` decoder (`decode_uv_array`) now reads its raw-double data
627
+ with a single strided NumPy view instead of a per-value Python loop, decoding
628
+ roughly **30× faster** with bit-identical output. This speeds up both `.dx`
629
+ spectra and the existing `131 OL` `.uv` files.
630
+
631
+ ## [1.0.14] - 2026-06-16
632
+
633
+ ### Fixed
634
+ - **Cross-platform determinism in directory parsing.** `parse_allfiles` now
635
+ iterates the `.D` directory in sorted order instead of raw `os.listdir`
636
+ order. Directory-level metadata (date, vial position) is chosen by
637
+ `Counter.most_common`, whose tie-break follows insertion order; with an
638
+ unsorted listing this made the chosen value depend on the filesystem's
639
+ ordering, so a `.D` containing files with differently-formatted date strings
640
+ could yield different metadata on macOS vs. Linux. Parsing is now identical
641
+ on every platform.
642
+
643
+ ### Added
644
+ - Pre-merge CI (`.github/workflows/ci.yml`): runs the test suite on Python 3.8
645
+ and 3.13 and builds a wheel + sdist on every pull request, so packaging and
646
+ test regressions are caught before merge rather than at release time.
647
+
648
+ ## [1.0.13] - 2026-06-16
649
+
650
+ ### Added
651
+ - **Optional compiled accelerator for Agilent `.uv` (DAD) decoding.** The
652
+ retention-time × wavelength absorbance "cube" is delta-encoded and inherently
653
+ sequential, so it cannot be vectorized with NumPy. A new Cython extension
654
+ (`rainbow/agilent/_uvdelta.pyx`) runs this inner loop in C, decoding large
655
+ diode-array files roughly **100× faster** while producing **bit-identical**
656
+ results. See the Performance section of the README.
657
+ - `tests/test_accelerator.py`: parity tests asserting the compiled path matches
658
+ the pure-Python fallback across all `.uv` decode paths (delta, partial,
659
+ array), plus a truncated-input safety test.
660
+
661
+ ### Changed
662
+ - Releases now build **cross-platform binary wheels** with `cibuildwheel`
663
+ (Linux/macOS/Windows, CPython 3.8–3.13) alongside a source distribution, so
664
+ `pip install rainbow-api` ships the accelerator with no compiler required.
665
+ - Unit tests compare decoded absorbance arrays with a floating-point tolerance
666
+ instead of exact text equality, fixing pre-existing 1-ULP failures from
667
+ retention-time accumulation (`test_yellow`, `test_orange`).
668
+
669
+ ### Fixed
670
+ - The accelerator is fully optional and transparent: if the extension is not
671
+ built (no compiler or no Cython), `rainbow` falls back to a pure-Python
672
+ decoder with identical output.
673
+ - Truncated or corrupt `.uv` streams now raise `ValueError` from the compiled
674
+ path instead of risking an out-of-bounds read (the extension disables Cython
675
+ bounds checks for speed, so the bounds are guarded explicitly).
676
+ - The source distribution now includes `_uvdelta.pyx`, so installs on platforms
677
+ without a prebuilt wheel compile the accelerator from source instead of
678
+ failing the build.