Skip to content

Commit 46782ea

Browse files
committed
Improve stimulator readevents diagnostic output
Print timestamps/data shapes, first values, and handle dict returns to understand what readevents_epochsamples_ingested actually returns. https://claude.ai/code/session_01A7rAxYf5pSvs19iVJe3ncL
1 parent 84b52b8 commit 46782ea

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

tests/test_cloud_read_ingested.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,25 @@ def test_stimulator_probe_timeseries(self, session):
297297
evt_result = dev.readevents_epochsamples(ct, ch, devepoch, 10, 20)
298298
print(f" readevents result type: {type(evt_result)}")
299299
if isinstance(evt_result, tuple):
300-
print(f" timestamps type: {type(evt_result[0])}")
301-
if isinstance(evt_result[0], list):
302-
print(f" timestamps count: {len(evt_result[0])}")
303-
elif hasattr(evt_result[0], "shape"):
304-
print(f" timestamps shape: {evt_result[0].shape}")
300+
ts_r, data_r = evt_result
301+
print(f" timestamps type: {type(ts_r)}, data type: {type(data_r)}")
302+
if isinstance(ts_r, list):
303+
for i, (t_i, d_i) in enumerate(zip(ts_r, data_r)):
304+
print(
305+
f" ch[{i}]: ts shape={getattr(t_i, 'shape', len(t_i))}, data shape={getattr(d_i, 'shape', len(d_i))}"
306+
)
307+
elif hasattr(ts_r, "shape"):
308+
print(
309+
f" timestamps shape: {ts_r.shape}, data shape: {getattr(data_r, 'shape', type(data_r))}"
310+
)
311+
if ts_r.size > 0:
312+
print(
313+
f" ts[0:3]={ts_r[:3]}, data[0:3]={data_r[:3] if hasattr(data_r, '__getitem__') else data_r}"
314+
)
315+
elif isinstance(ts_r, dict):
316+
print(f" timestamps is dict with keys: {list(ts_r.keys())}")
317+
else:
318+
print(f" timestamps: {ts_r}")
305319
except Exception as exc:
306320
pytest.fail(
307321
f"readevents_epochsamples raised {type(exc).__name__}: {exc}\n"

0 commit comments

Comments
 (0)