Skip to content

Commit 198cf6a

Browse files
committed
improve time series message
1 parent d8382c9 commit 198cf6a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/nwbinspector/checks/_time_series.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ def check_data_orientation(time_series: TimeSeries) -> Optional[InspectorMessage
5656
return None
5757

5858
if any(np.array(data_shape[1:]) > data_shape[0]):
59+
longest_axis = int(np.argmax(data_shape))
5960
return InspectorMessage(
6061
message=(
61-
"Data may be in the wrong orientation. Time should be in the first dimension, and is usually the "
62-
"longest dimension. Here, another dimension is longer."
62+
f"'{time_series.name}' data may be in the wrong orientation. "
63+
f"Time should be the longest dimension, which is usually the first.\n"
64+
f"Current shape: {data_shape}.\n"
65+
f"Suggestion: Transpose so the first dimension is {data_shape[longest_axis]}."
6366
),
6467
)
6568

0 commit comments

Comments
 (0)