rainbow-api 1.5.4__tar.gz → 1.6.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 (50) hide show
  1. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/CHANGELOG.md +325 -0
  2. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/PKG-INFO +6 -3
  3. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/README.md +4 -1
  4. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/pyproject.toml +3 -3
  5. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/__init__.py +93 -24
  6. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/_arguments.py +5 -3
  7. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/_binning.py +64 -4
  8. rainbow_api-1.6.0/rainbow/_optics.py +33 -0
  9. rainbow_api-1.6.0/rainbow/_version.py +6 -0
  10. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/agilent/__init__.py +216 -57
  11. rainbow_api-1.6.0/rainbow/agilent/amx.py +429 -0
  12. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/agilent/chemstation.py +292 -84
  13. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/agilent/masshunter.py +599 -141
  14. rainbow_api-1.6.0/rainbow/agilent/method.py +1051 -0
  15. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/agilent/openlab.py +144 -44
  16. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/agilent/sequence.py +100 -2
  17. rainbow_api-1.6.0/rainbow/agilent/sirslt.py +507 -0
  18. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/asm.py +1684 -233
  19. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/datadirectory.py +28 -4
  20. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/datafile.py +5 -2
  21. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/datasequence.py +7 -7
  22. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/waters/__init__.py +14 -4
  23. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/waters/masslynx.py +129 -59
  24. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow_api.egg-info/PKG-INFO +6 -3
  25. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow_api.egg-info/SOURCES.txt +4 -0
  26. rainbow_api-1.5.4/rainbow/agilent/method.py +0 -380
  27. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/COPYING +0 -0
  28. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/COPYING.LESSER +0 -0
  29. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/MANIFEST.in +0 -0
  30. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/agilent/_chdelta.pyx +0 -0
  31. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/agilent/_msprofile.pyx +0 -0
  32. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/agilent/_uvdelta.pyx +0 -0
  33. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/agilent/acaml.py +0 -0
  34. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/__init__.py +0 -0
  35. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/_util.py +0 -0
  36. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/chemstation_header.py +0 -0
  37. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/chemstation_text.py +0 -0
  38. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/dotnet.py +0 -0
  39. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/ini.py +0 -0
  40. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/method.py +0 -0
  41. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/mzxml.py +0 -0
  42. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/reg.py +0 -0
  43. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/waters_header.py +0 -0
  44. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/waters_inf.py +0 -0
  45. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow/debug/xml.py +0 -0
  46. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow_api.egg-info/dependency_links.txt +0 -0
  47. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow_api.egg-info/requires.txt +0 -0
  48. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/rainbow_api.egg-info/top_level.txt +0 -0
  49. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/setup.cfg +0 -0
  50. {rainbow_api-1.5.4 → rainbow_api-1.6.0}/setup.py +0 -0
@@ -3,6 +3,331 @@
3
3
  All notable changes to `rainbow-api` are documented here. This project adheres
4
4
  to [Semantic Versioning](https://semver.org/).
5
5
 
6
+ ## [1.6.0] - 2026-11-27
7
+
8
+ ### Added
9
+ - **Agilent OpenLab CDS acquisition methods (`.amx`).**
10
+ `rainbow.agilent.amx.read(path)` reads one, and `rb.read` and
11
+ `rb.read_metadata` read a `.sirslt` folder's (the `.amx` named after the
12
+ folder, else its only one) through the step a .D's sidecars go through
13
+ (`method.state_run`). The settings are read from the method's
14
+ `Agilent/ReportableInformation` part, the same ACAML a .D keeps as
15
+ `acq.macaml`, in the units it states: the driver parts state none, and keep
16
+ some values as codes (the DAD's slit `2` is reported as `4 nm`). The keys a
17
+ .D's `acq.macaml` gives come the same way (`injection_volume`, `flow_rate`,
18
+ `run_time`, `column_temperature`, `modules`, `acq_method`), and
19
+ `acq_method_info` (version, dates, status) and `module_settings` (per
20
+ module: name, model, driver, and the pump's flow, limits, solvents and
21
+ timetable, the DAD's signals, peak width, slit and spectrum, the column
22
+ compartment's temperatures, the sampler's injection volume, speeds and
23
+ wash) are new. Each driver's settings are one table of report parameter IDs
24
+ (`amx.MODULES`); an LC/MSD's goes there once an OpenLab LC/MS method is at
25
+ hand. A value the method does not state is not stated. A run without an
26
+ `.amx` is read as before.
27
+ - **Real `.amx` test data.** `tests/inputs/date.amx`, `pear.amx`,
28
+ `kiwi.amx` and the `tests/inputs/fig.sirslt` folder holding `fig.amx`,
29
+ CC0 from chromConverterExtraTests, anonymised as
30
+ `tests/inputs/README_sirslt.md` describes.
31
+ - **Agilent OpenLab CDS `.sirslt` result folders.** `rb.read` and
32
+ `rb.read_metadata` accept a `.sirslt` folder (or one renamed without the
33
+ suffix, recognized by the `.dx` and `.acaml` inside it; a `.D` folder is
34
+ never taken for one, whatever it holds). The detector signals come from the
35
+ folder's `.dx` archive; the single-quad LC/MS or GC/MS centroid spectrum
36
+ (`MSPeak.bin`, written beside the archive or kept under its `MSData/`) is
37
+ read under `centroid=True`, and flagged as `centroid_available` otherwise.
38
+ MS data that is present but cannot be decoded (no `MSScan.bin`, or no
39
+ `MSData/MSScan.xsd`) warns and is not reported as available. A run with no
40
+ detector signal (a flush) returns its metadata rather than raising.
41
+ - **LC or GC.** A `.sirslt` run's `metadata['technique']` is `'LC'` or `'GC'`,
42
+ read from the instrument in its `.acaml`, else from the MS `Contents.xml`,
43
+ else from a GC injection source or GC-only detector in the manifest (an ECD
44
+ is not counted as one: HPLC electrochemical detectors share the name).
45
+ `rainbow.agilent.sirslt.technique(path)` answers it without reading the data.
46
+ The instrument and its modules are in `metadata['instrument']`, and an MS
47
+ run's spectrometer in `metadata['ms_devices']`.
48
+ - **Real `.sirslt` test data.** `tests/inputs/olive.sirslt` (a UHPLC
49
+ single-quadrupole LC/MS run), `tests/inputs/plum.sirslt` (an HPLC run whose
50
+ DAD spectrum carries the HPLC scale factor) and `tests/inputs/lime.sirslt`
51
+ (an HPLC run with one DAD signal), anonymised as
52
+ `tests/inputs/README_sirslt.md` describes.
53
+ - **`bin_width='recorded'` (`rb.RECORDED`) reads m/z as the file stores
54
+ them.** No width is chosen and nothing is merged: an Agilent .ms file, a
55
+ Waters function and an uncalibrated MassHunter centroid get one column per
56
+ distinct stored m/z, labelled by it unrounded, with
57
+ `metadata["mz_spacing"]`, the smallest gap between two of them as measured
58
+ on the file (not for SIM or MRM). The HRMS profile and a calibrated TOF
59
+ centroid, whose m/z are continuous, stay per scan. `display_precision` does
60
+ not apply.
61
+ - **ChemStation MS files state their method signal by number.**
62
+ `MSD<n>.MS` takes `[Signal n]`'s settings and `metadata["method_signal"]`;
63
+ the ions or range the file recorded are a check. Scan signals state their
64
+ table (`scan_parameters`) and step (`mz_step`). A method of several MS
65
+ detectors is read per detector (`agilent.method.ms_detectors`), each file
66
+ paired with the detector its header names (`method_detector`).
67
+ - **What says an MS file's mode is stated.** `metadata["acquisition_mode_from"]`:
68
+ `scans`, `method report`, `file name` or `one m/z column`.
69
+
70
+ - **Agilent ChemStation LC/MS files state what the method says of their
71
+ signal.** Each MS DataFile's metadata has, where the method's signal it
72
+ holds (`MSD<n>.MS` holds `[Signal n]`) states it,
73
+ `polarity` (`+`/`-`), `ionization_mode`, `fragmentor` (V; where every row
74
+ of the signal's table states the same one) and
75
+ `monitored_ions` (a SIM signal's ions in the method's order, each
76
+ `{mz, fragmentor, compound}`), read from `acq.macaml`, else from the method
77
+ report as run (`acq.txt`, or older ChemStation's `ACQ.M/ACQ.TXT`, UTF-8 or
78
+ UTF-16); see `agilent.method.ms_signals`.
79
+ - **Agilent MassHunter MRM transitions carry their compound names.** A .D
80
+ whose `AcqData/AcqMethod.xml` names the compound for each MRM transition
81
+ now has `metadata["monitored_compounds"]`: one
82
+ `{compound, precursor_mz, product_mz, collision_energy}` per transition, in
83
+ the method's order.
84
+ - **`rb.read_metadata` states an Agilent .D's injection time as `read()`
85
+ does.** It read no data file, so a run with any sidecar came back without
86
+ its `date` (and `utc_offset`, `vialpos`); it now reads them from the
87
+ Chemstation files' headers alone (`chemstation.parse_header`, a few hundred
88
+ bytes per file), and states the method's `technique` too, so its metadata
89
+ equals `read().metadata` for every Agilent fixture. A MassHunter run's own
90
+ `.ch`/`.uv`/`.ms` files, which `read()` parses, are now listed beside its
91
+ `AcqData` files.
92
+ - **Agilent MassHunter MS files state each scan's record.** An MS DataFile
93
+ read from `MSScan.bin` (`MSPeak.bin`, `MSProfile.bin`, ICP-MS) has
94
+ `metadata["scans"]`: one array per field, one entry per row, giving the
95
+ `scan_type` (`Scan`, `SIM`, `MRM`, ...), `monitoring` (SIM or MRM),
96
+ `ms_level`, `polarity` (`+`/`-`), `collision_energy`, `precursor_mz` and
97
+ the measured `mz_range_min`/`mz_range_max`, each where the run's schema
98
+ records it. A simultaneous SIM/Scan run's interleaved scans are told apart
99
+ by it.
100
+
101
+ - **`rb.measurements(datadir)` reads a run's measurements without building
102
+ an ASM document** (also `DataDirectory.measurements()`). One dict per
103
+ measurement `to_asm` writes (DAD spectra aside): its identifier, data file,
104
+ label, technique, detector, m/z, channel metadata and unit, the trace as
105
+ numpy arrays (`times` in minutes, `values` as `from_asm` rebuilds them),
106
+ the sample and injection fields, measurement time, acquisition method, its
107
+ peaks as `peaks_from_asm` reads them, and the measurement document itself.
108
+ The measurements are made by `to_asm`'s own builders and read by
109
+ `from_asm`'s readers, so the two agree (tested field by field on every
110
+ bundled run); no array becomes a Python list, nothing goes through JSON,
111
+ and no trace is rebuilt. What is said only of a document (that it will not
112
+ validate, that a channel is published relabeled or left out) is not said.
113
+ - **A `.sirslt` run states what a `.D` run states after its data files.**
114
+ Both go through one step, `agilent.method.state_run`; a `.sirslt` is laid
115
+ out as a `.D` for it, the archive's `MSData/` as its `AcqData`. Its MS
116
+ files state the acquisition mode their scans state
117
+ (`acquisition_mode`, `acquisition_modes`, `acquisition_mode_from`), and
118
+ the method and sample sidecars it holds (an `MSData/AcqMethod.xml`'s
119
+ `monitored_compounds`) state what they say, in `read` and
120
+ `read_metadata` alike. What the run does not record is not stated: the
121
+ bundled `olive.sirslt` holds no acquisition method, so its MS signal's
122
+ settings and compounds are not stated.
123
+
124
+ ### Changed
125
+ - **MassHunter scan records are read in one pass.** `read_scan_table` reads
126
+ MSScan.bin as a numpy structured array (`record_dtype`, from MSScan.xsd),
127
+ in place of a `struct` call per field; the MS parsers, `scan_times` and
128
+ `scan_metadata` use it, and MSPeak.bin is read once and decoded a block
129
+ width at a time. A 13,811-scan centroid read takes about 7 ms in place of
130
+ about 90 ms, with the same result. `read_scan_records` still gives one
131
+ dictionary per record.
132
+ - **A file's scans decide its acquisition mode over the method report.**
133
+ Where the report states another, the scans' mode and records stay, and the
134
+ report's is kept in `metadata["method_disagrees"]`. A MassHunter file whose
135
+ scans all state one of SIM, Scan or MRM is tagged with it.
136
+ - **A method's setting that disagrees with the file is kept apart.** Where a
137
+ SIM signal's ions are not the ones the file recorded (compared at the
138
+ coarser of the .ms 0.05 m/z step and the method's written precision), or a
139
+ Scan range does not hold the file's m/z, nothing of the signal goes on the
140
+ file: `method_disagrees` holds its `signal` number and whole `settings`. A
141
+ single setting the file states otherwise (its polarity) stays the file's,
142
+ the method's kept in `method_disagrees`. The ±0.5 m/z label match is gone.
143
+ - **A Waters function nothing names is not called UV.** Without
144
+ `_FUNCTNS.INF` and a polarity its detector is unstated (None), its axis
145
+ read as recorded. A multi-column one stays in `DataDirectory.datafiles`
146
+ (in no `by_detector` entry), not among the analog traces; ASM has no cube
147
+ for an axis of unknown kind and says so.
148
+ - **A DAD spectrum in a unit rainbow cannot place says so in ASM**, as a
149
+ chromatogram does: published under mAU, unscaled, with the note naming the
150
+ file's unit, which `from_asm` reads back.
151
+
152
+ - **Python 3.11 or later.** rainbow now requires Python 3.11 (was 3.8), the
153
+ oldest release still supported upstream; wheels are built for 3.11 to 3.13.
154
+ On older Python, pip keeps installing rainbow 1.5.5.
155
+
156
+ ### Fixed
157
+ - **Reading a sequence's injections one at a time parses its `sequence.acaml`
158
+ once.** `rb.read(path, peaks=True)` and `agilent.injection_peaks` parsed the
159
+ whole document, which holds every injection's results, for each injection:
160
+ 384 injections of one sequence with a 27 MB document took 127 s, and now take
161
+ 0.5 s. The peaks of the last four documents read are kept by path,
162
+ modification time and size, so a rewritten document is read again, and each
163
+ call gets its own copy. `agilent.sequence.injection_groups(path, name)` reads
164
+ one injection's groups without copying the rest.
165
+ - **A Waters `_extern.inf` Polarity line reads with one tab or three.** The
166
+ line straight after `Instrument Parameters` was split on three tabs, so a
167
+ single-tab export (`Polarity\tES+`) raised an IndexError; one rule now takes
168
+ the last tab-separated field, after a `Parameter File -` line or without
169
+ one (reported in #74).
170
+ - **A `.dx` DAD spectrum is scaled by its manifest's factor.** The spectrum
171
+ was multiplied by a constant `2**-17`, but the manifest records the factor as
172
+ `<ScaleFactor>` and it depends on the detector: `1000 * 2**-27` on a UHPLC
173
+ DAD, `1000 * 2**-21` on an HPLC DAD. The constant read UHPLC spectra 2.4%
174
+ high and HPLC spectra 62x low. With the manifest's factor a spectrum matches
175
+ its run's single-wavelength channels to within about 2%. The `teal` expected
176
+ output is regenerated accordingly (every value x 0.9765625). A manifest that
177
+ records no factor is scaled by `1000 * 2**-27` and now warns, since that is
178
+ 64 times too small for an HPLC DAD; it was scaled by `2**-17` without a
179
+ word, so such a spectrum also reads 2.4% lower than before.
180
+ - **MassHunter centroid abundances are float64 and no longer truncated.**
181
+ `MSPeak.bin` intensities were cast to unsigned integers, dropping the
182
+ fractional part the file stores. That affected `.D` GC/MS runs as well as
183
+ `.sirslt` ones: every scan of the `yellow.D` fixture holds fractional
184
+ abundances. Centroid intensities are now always float64, per scan and on a
185
+ `bin_width` grid alike, whatever values a run holds, so code that relied on
186
+ an integer dtype for a `.D` centroid sees float64 instead.
187
+ - **`MSScan.xsd` version 2.1 is read.** Its scan record ends in an optional
188
+ `Padding` element whose type is declared inline, which made the schema
189
+ unreadable; it has no stored bytes and is now skipped. Any other element with
190
+ an inline type, which rainbow cannot size, is refused rather than skipped.
191
+ - **Waters file names are matched regardless of case everywhere.**
192
+ `waters.read_metadata` found a .raw folder's `_FUNC`/`_CHRO` files only by
193
+ their names' exact upper case, so a folder named in lower case (a
194
+ PerkinElmer export) seemed to hold none; it now lists them as they are on
195
+ disk. `waters.read(requested_files=)` matched only lower-case names when
196
+ called directly; it now takes them in any case, as `rb.read` does.
197
+
198
+ ## [1.5.5] - 2026-10-17
199
+
200
+ ### Added
201
+ - **`rb.from_asm` and `rb.sequence_from_asm` read every measurement's peaks.**
202
+ They read a measurement's peaks only beside a rebuilt trace, and rebuilt
203
+ only absorbance cubes with inline data, so the peaks of every fluorescence
204
+ channel, of an FID run, and of every measurement in an index document
205
+ (whose cubes carry no values) were dropped. Over 531 local Empower and
206
+ OpenLab exports, 1.5.4 read 15,503 of 20,026 peaks; 1.5.5 reads all of them.
207
+ Each peak group also carries the channel's `detector` and `metadata`, so a
208
+ group with no trace beside it still says which channel it was integrated on.
209
+ - **Peaks carry their units, identifier and index.** `area_unit` and
210
+ `height_unit` say what each value is in; `identifier` and `index` are the
211
+ peak's own; each integration's `processing` gains its `description`.
212
+ - **More of the envelope.** `injection_time`, `sample_role`, `well_plate_id`
213
+ and `acq_method`, and the `data_system`, `analysis_sequence` and `project`
214
+ records, field by field as written; all are written back on export (see the
215
+ round-trip guide for where). A `scalar integer datum` reads as an `int`.
216
+ - **`rb.read(path, peaks=True)`** attaches one injection's integrated peaks,
217
+ found as `read_sequence(peaks=True)` finds them: the `sequence.acaml` beside
218
+ the .D, else its own `sequence.acam_`.
219
+ - **`rb.peaks_from_asm(measurement)`** reads one ASM measurement document's
220
+ peaks. **`rb.sniff_vendor(path)`** is the content check `rb.read` falls back
221
+ to for an unsuffixed folder, and **`rb.asm_technique(run)`** is the `"LC"` or
222
+ `"GC"` the export will use.
223
+ - **`rainbow.__version__`**, the version an export names as its converter.
224
+
225
+ ### Changed
226
+ - **Every chromatogram cube is rebuilt, not only absorbance.** Fluorescence,
227
+ electric current, intensity, refractive index and conductivity channels come
228
+ back as DataFiles with `metadata["unit"]` as written and
229
+ `metadata["measure"]`. The detector is named from the device type, then the
230
+ device identifier, then the cube label, then the measure: `UV`, `RID`, `FLD`
231
+ (new), `ELSD`, `FID`, or `CAD`; a channel rainbow has no name for, such as a
232
+ conductivity detector, is detector `None` and joins the directory's
233
+ `analog` traces. The channel metadata also holds `device_type` and
234
+ `acq_method`, and the optics from the device control settings, the cube
235
+ label, or the processed data description: `wavelength`, `bandwidth`,
236
+ `reference_wavelength`, `reference_bandwidth`, and a fluorescence channel's
237
+ `excitation_wavelength`, `excitation_bandwidth` and `emission_wavelength`.
238
+ - **A peak's `height` and `area` on a non-absorbance channel are kept as
239
+ written.** 1.5.4 read any unit it could not convert to mAU as `None`, which
240
+ lost every fluorescence peak, and converted µV to mAU whatever the channel
241
+ measured. An RFU, pA or ELSD µV value now comes back with its unit. Only on
242
+ an absorbance channel is AU or Empower's µV converted to mAU; the edge
243
+ heights are in the height's unit.
244
+ - **`Ref=off` reads as `reference_wavelength` None**, present, in the vendor
245
+ readers and in `from_asm`, so a channel without a reference is told apart
246
+ from one whose reference was not recorded. Code that reads
247
+ `metadata["reference_wavelength"]` may now find the key with the value
248
+ `None`, where it used to be absent.
249
+
250
+ ### Fixed
251
+ - **`to_asm` wrote every peak area as `mAU.s`**, an FID's or CAD's pA.s
252
+ included. A peak's area and height are now written in the unit of the cube
253
+ it was integrated on. REC/2026/06 gives electric current (pA), intensity
254
+ (RLU), voltage (mV) and fluorescence (RFU) their own peak lists, so such
255
+ a channel keeps its faithful cube when it carries peaks; only
256
+ a measure with no peak list in the schema (nA, V) is still relabeled to
257
+ absorbance. The relabel note now also records the real concept and unit as
258
+ structured custom information, and `from_asm` reads it (or the sentence
259
+ 1.5.4 wrote alone) to put the channel and its peaks back in their real
260
+ unit, so a relabeled channel re-exports to a valid document.
261
+ - **A fluorescence signal is FLD in every Agilent reader.** "FLD1 A, Ex=230,
262
+ Em=310" was typed UV at 230 nm in a ChemStation .ch; it is now an `FLD`
263
+ channel with `excitation_wavelength` and `emission_wavelength`, labelled by
264
+ its emission, in the .ch, OpenLab .dx and MassHunter .cg readers alike, and
265
+ `parse_optics` reads the `Ex=`/`Em=` clause. In the 179/181 .ch container
266
+ 1.5.4 typed it FID instead, which also exported the whole run as gas
267
+ chromatography.
268
+ - **`from_asm` scales an absorbance trace to mAU.** A cube in AU (or Empower's
269
+ µV) was rebuilt in its own unit while its peaks' heights and areas were
270
+ converted to mAU, so the trace minus an edge height was a thousand times
271
+ off. The trace is now scaled to mAU too, the unit rainbow holds UV data in
272
+ and to_asm writes, and `metadata["unit"]` says so.
273
+ - **The processing time and description are where REC/2026/06 puts them.**
274
+ `data processing time` is written in the data processing document, stamped
275
+ with `utc_offset=` (as custom information when it has no offset), and the
276
+ description under `description`, the name REC/2026/06 gave the 2025/03
277
+ `processed data description`; both are read from any of those places. A
278
+ sample role outside the schema's list is written as custom information.
279
+ - **Every peak and peak group has the same keys, whatever it was read from.**
280
+ A peak read from a vendor result document carries `identifier`, `index`,
281
+ `area_unit`, `height_unit`, `start_height`, `end_height` and the four
282
+ baseline keys too, as None, and its group `detector`, `metadata` and
283
+ `processing` as None and `alternates` as an empty list.
284
+ - **A unit published under another's name reads back as itself.** A
285
+ channel whose unit the schema has no term for (red.D's CAD in mAu) is
286
+ published under its detector's default unit, as before, and now with the
287
+ structured note a peak relabel writes, so `from_asm` restores its unit and
288
+ its peaks'. A peak area in a unit per minute is converted to per second,
289
+ and an absorbance area per an unknown time reads as None.
290
+ - **A re-exported data system record names rainbow as its converter.**
291
+ `ASM converter name` and `version` are rainbow-api's, `ASM conversion time`
292
+ is the time of the export (so two exports differ there), and `ASM file
293
+ identifier` is the file written, else one named for the run; the source
294
+ converter's are kept as the record's custom information, prefixed
295
+ `source`, and a second round trip keeps them as they were (the source
296
+ conversion time exactly as written). A record naming both a file and a
297
+ database row keeps the row and carries the file as custom information. The
298
+ record's times take `utc_offset=`. Every chromatogram channel's device
299
+ control keeps the source's device identifier (read into
300
+ `metadata["device_identifier"]`), names the detector there only when the
301
+ source had none, and names rainbow's detector in its custom information
302
+ (`rainbow detector`), which is what reads it back.
303
+ - **Bandwidth, reference and acquisition method survive a round trip.** A UV
304
+ channel's bandwidth and reference are written as their device control
305
+ settings (Ref=off as custom information), an FLD's excitation bandwidth
306
+ too, and the acquisition method as the measurement's custom information.
307
+ A CAD's device control names it in its device identifier, so rainbow's
308
+ own export reads back as CAD.
309
+ - **A vendor peak group names its detector and its peaks' units.**
310
+ `rb.read(peaks=True)` and `read_sequence(peaks=True)` fill each group's
311
+ `detector` and `metadata` from the channel's DataFile, and each peak's
312
+ `height_unit` and `area_unit` from its unit (the peak table is in the
313
+ channel's unit, per second for an area, and does not say so).
314
+ - **The detector is not read from a measurement identifier.** It is a key
315
+ (often a GUID), and a segment such as `adc4` typed a channel CAD.
316
+ - **A gas chromatography document re-exports as one.** `from_asm` records
317
+ the document's technique in `metadata["technique"]`, which the export
318
+ follows; one with no FID channel used to come back as liquid
319
+ chromatography.
320
+ - **A peak in AU or µV beside an absorbance cube is converted to mAU on
321
+ export**, as the cube is, rather than relabeled 1000 times off; a peak
322
+ group's `metadata["unit"]` is mAU when its trace is.
323
+ - **A ChemStation FLD channel is FLD by its name too**, as OpenLab's is by
324
+ its device, when its wavelengths are not numbers.
325
+ - **A Waters fluorescence channel is FLD.** One fluorescence parser serves
326
+ the Agilent readers, the Waters reader and `from_asm`.
327
+ - **`to_asm` dropped peak groups no exported channel carries** (peaks read from
328
+ an index document, or on an analog channel) without a word. It warns once
329
+ per group.
330
+
6
331
  ## [1.5.4] - 2026-10-17
7
332
 
8
333
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rainbow-api
3
- Version: 1.5.4
3
+ Version: 1.6.0
4
4
  Summary: Read chromatography and mass spectrometry binary files
5
5
  Author: Evan Shi and Eugene Kwan
6
6
  Author-email: evanyshi@cmu.edu
@@ -8,7 +8,7 @@ License: LGPL-3.0-or-later
8
8
  Project-URL: Repository, https://github.com/evanyeyeye/rainbow
9
9
  Project-URL: Documentation, https://rainbow-api.readthedocs.io
10
10
  Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
11
- Requires-Python: >=3.8
11
+ Requires-Python: >=3.11
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: COPYING
14
14
  License-File: COPYING.LESSER
@@ -47,6 +47,9 @@ Dynamic: license-file
47
47
  | **Agilent `.dx`** (OpenLab CDS) | `.UV` | DAD spectrum | |
48
48
  | | `.CH` | single-wavelength UV/DAD signals | |
49
49
  | | `.IT` | instrument telemetry, as analog data | `telemetry=True` |
50
+ | **Agilent `.sirslt`** (OpenLab CDS result folder) | `.dx` | everything a `.dx` holds (UV/DAD, FID, telemetry) | |
51
+ | | `MSPeak.bin` | single-quad LC/MS or GC/MS centroid spectrum | `centroid=True` |
52
+ | | `.acaml` | instrument, and whether the run is LC or GC (`metadata['technique']`) | |
50
53
  | **Waters `.raw`** | `CHRO` | CAD and ELSD, plus miscellaneous analog data | |
51
54
  | | `FUNC` | UV and MS | |
52
55
 
@@ -87,7 +90,7 @@ datafile = datadir.get_file("DAD1A.uv")
87
90
 
88
91
  Here, the `datadir` DataDirectory object contains a DataFile object for `DAD1A.uv`.
89
92
 
90
- *rainbow* normally infers the vendor from the path suffix (`.D`/`.dx` for Agilent, `.raw` for Waters). A directory whose name lacks that suffix is identified from its contents instead, so renamed datasets still parse. To force a parser explicitly, pass `format`:
93
+ *rainbow* normally infers the vendor from the path suffix (`.D`/`.dx`/`.sirslt` for Agilent, `.raw` for Waters). A directory whose name lacks that suffix is identified from its contents instead, so renamed datasets still parse. To force a parser explicitly, pass `format`:
91
94
 
92
95
  ```python
93
96
  datadir = rb.read("Caffeine 3", format="waters")
@@ -15,6 +15,9 @@
15
15
  | **Agilent `.dx`** (OpenLab CDS) | `.UV` | DAD spectrum | |
16
16
  | | `.CH` | single-wavelength UV/DAD signals | |
17
17
  | | `.IT` | instrument telemetry, as analog data | `telemetry=True` |
18
+ | **Agilent `.sirslt`** (OpenLab CDS result folder) | `.dx` | everything a `.dx` holds (UV/DAD, FID, telemetry) | |
19
+ | | `MSPeak.bin` | single-quad LC/MS or GC/MS centroid spectrum | `centroid=True` |
20
+ | | `.acaml` | instrument, and whether the run is LC or GC (`metadata['technique']`) | |
18
21
  | **Waters `.raw`** | `CHRO` | CAD and ELSD, plus miscellaneous analog data | |
19
22
  | | `FUNC` | UV and MS | |
20
23
 
@@ -55,7 +58,7 @@ datafile = datadir.get_file("DAD1A.uv")
55
58
 
56
59
  Here, the `datadir` DataDirectory object contains a DataFile object for `DAD1A.uv`.
57
60
 
58
- *rainbow* normally infers the vendor from the path suffix (`.D`/`.dx` for Agilent, `.raw` for Waters). A directory whose name lacks that suffix is identified from its contents instead, so renamed datasets still parse. To force a parser explicitly, pass `format`:
61
+ *rainbow* normally infers the vendor from the path suffix (`.D`/`.dx`/`.sirslt` for Agilent, `.raw` for Waters). A directory whose name lacks that suffix is identified from its contents instead, so renamed datasets still parse. To force a parser explicitly, pass `format`:
59
62
 
60
63
  ```python
61
64
  datadir = rb.read("Caffeine 3", format="waters")
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rainbow-api"
7
- version = "1.5.4"
7
+ version = "1.6.0"
8
8
  description = "Read chromatography and mass spectrometry binary files"
9
9
  readme = "README.md"
10
10
  license = {text = "LGPL-3.0-or-later"}
@@ -19,7 +19,7 @@ classifiers = [
19
19
  # older rainbow instead of installing this and failing at import. No upper
20
20
  # bound: a newer interpreter than [tool.cibuildwheel] builds wheels for still
21
21
  # installs, just from the sdist.
22
- requires-python = ">=3.8"
22
+ requires-python = ">=3.11"
23
23
  # What every install needs to read a file, and nothing more. lxml is here for
24
24
  # speed, not correctness: the parsers fall back to the standard library and
25
25
  # reach the same answer, but rb.read_metadata is about 2.5x slower that way, so
@@ -73,7 +73,7 @@ include = ["rainbow*"]
73
73
  # Build CPython wheels for the optional compiled accelerator. The extension
74
74
  # is optional, so any platform that can't compile still yields a working
75
75
  # (pure-Python-fallback) wheel, and the sdist covers everything else.
76
- build = "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*"
76
+ build = "cp311-* cp312-* cp313-*"
77
77
  skip = "*-musllinux* *_i686 *-win32"
78
78
 
79
79
  [tool.pytest.ini_options]