Skip to content

Commit d7d31ca

Browse files
committed
Minor fix to multiframe handling
1 parent e08b4cb commit d7d31ca

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

canedge_datasource/signal.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ def time_series_phy_data(fs, signal_queries: [SignalQuery], start_date: datetime
251251
# Keep only selected channel
252252
df_raw = df_raw.loc[df_raw['BusChannel'] == int(chn)]
253253

254+
if df_raw.empty:
255+
continue
256+
254257
# If IDE missing (LIN) add dummy allow decoding
255258
if 'IDE' not in df_raw:
256259
df_raw['IDE'] = 0
@@ -273,9 +276,16 @@ def time_series_phy_data(fs, signal_queries: [SignalQuery], start_date: datetime
273276
df_phys_temp = [] #pd.DataFrame()
274277
for length, group in df_raw.groupby("DataLength"):
275278
df_phys_group = can_decoder.DataFrameDecoder(db).decode_frame(group)
279+
280+
if 'Signal' not in df_phys_group.columns:
281+
continue
282+
276283
df_phys_temp.append(df_phys_group)
277284

278-
df_phys = pd.concat(df_phys_temp,ignore_index=False).sort_index()
285+
if len(df_phys_temp) > 0:
286+
df_phys = pd.concat(df_phys_temp,ignore_index=False).sort_index()
287+
else:
288+
df_phys = pd.DataFrame()
279289

280290
else:
281291
# Decode

0 commit comments

Comments
 (0)