Skip to content

Commit 35703b2

Browse files
committed
match original tsv orientation
1 parent 12ebdee commit 35703b2

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/rbc/core/metrics/timeseries.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,13 @@ def compute_timeseries(
167167
ts_path = out_dir / f"{stem}_timeseries.parquet"
168168
corr_path = out_dir / f"{stem}_connectome.parquet"
169169

170-
col_names = [str(label) for label in labels]
170+
# ROIs
171+
roi_names = [str(label) for label in labels]
172+
# Timepoints
173+
tp_names = [str(i) for i in range(ts.shape[1])]
171174

172-
pl.DataFrame(ts, schema=col_names).write_parquet(ts_path)
173-
pl.DataFrame(corr, schema=col_names).write_parquet(corr_path)
175+
pl.DataFrame(ts, schema=tp_names).write_parquet(ts_path)
176+
pl.DataFrame(corr, schema=roi_names).write_parquet(corr_path)
174177

175178
return TimeseriesOutputs(
176179
timeseries=ts_path,

tests/unit/core/test_timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def test_round_trip(self, tmp_path: Path) -> None:
267267
assert len(result.labels) == 2
268268

269269
ts_loaded = pl.read_parquet(result.timeseries)
270-
assert ts_loaded.shape == (10, 2)
270+
assert ts_loaded.shape == (2, 10)
271271

272272
corr_loaded = pl.read_parquet(result.connectome)
273273
assert corr_loaded.shape == (2, 2)

0 commit comments

Comments
 (0)