v0.1.1
Non-breaking metadata enrichment that also restores correct
Data.magnitude() semantics for downstream callers depending on
pysampled ≥ 1.2.0
(per-signal_name L2). Existing pickles still unpickle fine —
pysampled.Data.__setstate__ rebuilds defaults when the new fields are
missing.
Added
-
delsys._util._trim_location/_canonical_label/
_parse_fsr_quattro_positions— small helpers used by
Sensor.__init__to derive bundle labels from the channelmap. -
Sensor._make_bundle_labels— single source of truth for the
per-modality(signal_names, signal_coords)convention:Modality signal_namessignal_coordsACC / GYRO [trimmed_location]["x","y","z"]EMGS [loc]["emg"]EMGD [loc_A, loc_B]["emg"]EMGQ parsed positions, else [loc_A..D]["emg"]FSR parsed positions, else [loc_A..D]["fsr"]EKG [loc]["ekg"]Analog [loc](1ch) or[loc_A..D](multi-ch sync)["analog"]VO2 8 fixed names ["value"]HR ["heart_rate"]["bpm"] -
FSR / Quattro position-aware naming via the channelmap parenthetical
(e.g.LFoot (1-Heel, 2-OuterEdge, 3-Ball, 4-Toe)→
["LFoot_Heel", "LFoot_OuterEdge", "LFoot_Ball", "LFoot_Toe"]). -
chNfallback for sensors without a channelmap entry — keeps every
bundle uniquely labelled. -
New
tests/test_util.pyplus extensions totests/test_signals.py
andtests/test_log.pycovering the new label conventions, the
inheritance change, and end-to-end propagation throughLog().
Changed
IMU.x/y/z,FSR.a..d,VO2Master.*no longer hardcode their
signal_names; they inherit the parent's labels and only override the
field that actually differs (single coord forIMU.x/y/z,
parent-indexed name forFSR/VO2Master). Effect:
imu.x.signal_names == imu.signal_names, and a single-axisIMU
carries its sensor identity through downstream chains.- All bundles in
Sensor.__init__are now constructed withaxis=0
explicit so very short fixtures (e.g. a 1-row(1, 8)VO2 array)
don't trip pysampled'sargmax-based axis inference. Sensor.__setstate__now auto-relabels every attached bundle on
unpickle, using the Sensor's own attributes (number,location,
modalities) as the source of truth. PickledLogs saved with
delsys < 0.1.1 (or the legacyimmersionToolbox/immersionlab/delsys.py
shim) come out with the new convention with no caller changes — no
lf.relabel()to remember. The relabel is idempotent on fresh 0.1.1+
pickles. Per-Signalmeta(modality/subchannel/sensor)
is not recoverable from those very-old pickles; bundle-level
access (lf.acc[i],lf.emg[i],bundle["LFoot_Heel"], etc.) is
what's repaired.- Bug fix:
AnalogandHRStrapbundles now carry
meta=sensor_meta. Previously thepysampled.Data(...)
constructions for these two modalities dropped the parent
SensorInfo, contradicting thelf.analog[i].sensor.location
contract documented elsewhere in the API. - Dependency floor:
pysampledis now pinned to>=1.2.0(was
>=1.1.1). The whole point of 0.1.1 is to make per-signal_name
magnitude()(a 1.2.0 change) produce the right answer for
Delsys data; tests assertmag.signal_coords == ['mag']which
is also a 1.2.0 standardization. Older pysampled versions are no
longer supported.
Provenance
This release is the metadata complement to pysampled 1.2.0's
per-signal_name magnitude() change: with default labelling, every
downstream acc.magnitude() call in pn-projects/wobble would have
returned three independent per-axis abs values instead of the global
L2. Bundle-level labels make the original semantics work again — no
code change required at the call sites.