@@ -15,11 +15,17 @@ def setup_fs(s3, key="", secret="", endpoint="", cert="", passwords={}):
15
15
fs = s3fs .S3FileSystem (key = key , secret = secret , default_block_size = block_size )
16
16
elif cert != "" :
17
17
fs = s3fs .S3FileSystem (
18
- key = key , secret = secret , client_kwargs = {"endpoint_url" : endpoint , "verify" : cert }, default_block_size = block_size
18
+ key = key ,
19
+ secret = secret ,
20
+ client_kwargs = {"endpoint_url" : endpoint , "verify" : cert },
21
+ default_block_size = block_size ,
19
22
)
20
23
else :
21
24
fs = s3fs .S3FileSystem (
22
- key = key , secret = secret , client_kwargs = {"endpoint_url" : endpoint }, default_block_size = block_size
25
+ key = key ,
26
+ secret = secret ,
27
+ client_kwargs = {"endpoint_url" : endpoint },
28
+ default_block_size = block_size ,
23
29
)
24
30
25
31
else :
@@ -34,8 +40,7 @@ def setup_fs(s3, key="", secret="", endpoint="", cert="", passwords={}):
34
40
35
41
# -----------------------------------------------
36
42
def load_dbc_files (dbc_paths ):
37
- """Given a list of DBC file paths, create a list of conversion rule databases
38
- """
43
+ """Given a list of DBC file paths, create a list of conversion rule databases"""
39
44
import can_decoder
40
45
from pathlib import Path
41
46
@@ -108,7 +113,12 @@ def add_custom_sig(df_phys, signal1, signal2, function, new_signal):
108
113
s1 = df_phys [df_phys ["Signal" ] == signal1 ]["Physical Value" ].rename (signal1 )
109
114
s2 = df_phys [df_phys ["Signal" ] == signal2 ]["Physical Value" ].rename (signal2 )
110
115
111
- df_new_sig = pd .merge_ordered (s1 , s2 , on = "TimeStamp" , fill_method = "ffill" ,).set_index ("TimeStamp" )
116
+ df_new_sig = pd .merge_ordered (
117
+ s1 ,
118
+ s2 ,
119
+ on = "TimeStamp" ,
120
+ fill_method = "ffill" ,
121
+ ).set_index ("TimeStamp" )
112
122
df_new_sig = df_new_sig .apply (lambda x : function (x [0 ], x [1 ]), axis = 1 ).dropna ().rename ("Physical Value" ).to_frame ()
113
123
df_new_sig ["Signal" ] = new_signal
114
124
df_phys = df_phys .append (df_new_sig )
@@ -173,8 +183,7 @@ def rebaseline_data(self, df_phys):
173
183
return df_phys
174
184
175
185
def filter_signals (self , df_phys ):
176
- """Given a df of physical values, return only signals matched by filter
177
- """
186
+ """Given a df of physical values, return only signals matched by filter"""
178
187
if not df_phys .empty and len (self .signals ):
179
188
df_phys = df_phys [df_phys ["Signal" ].isin (self .signals )]
180
189
@@ -204,8 +213,7 @@ def get_device_id(self, mdf_file):
204
213
return mdf_file .get_metadata ()["HDComment.Device Information.serial number" ]["value_raw" ]
205
214
206
215
def print_log_summary (self , device_id , log_file , df_phys ):
207
- """Print summary information for each log file
208
- """
216
+ """Print summary information for each log file"""
209
217
if self .verbose :
210
218
print (
211
219
"\n ---------------" ,
@@ -246,7 +254,18 @@ def __init__(self, tp_type=""):
246
254
"CONSEQ_FRAME" : 0x20 ,
247
255
"ff_payload_start" : 2 ,
248
256
"bam_pgn" : - 1 ,
249
- "res_id_list_hex" : ["0x7E0" , "0x7E9" , "0x7EA" , "0x7EB" , "0x7EC" , "0x7ED" , "0x7EE" , "0x7EF" , "0x7EA" , "0x7BB" ],
257
+ "res_id_list_hex" : [
258
+ "0x7E0" ,
259
+ "0x7E9" ,
260
+ "0x7EA" ,
261
+ "0x7EB" ,
262
+ "0x7EC" ,
263
+ "0x7ED" ,
264
+ "0x7EE" ,
265
+ "0x7EF" ,
266
+ "0x7EA" ,
267
+ "0x7BB" ,
268
+ ],
250
269
}
251
270
252
271
frame_struct_j1939 = {
@@ -263,7 +282,7 @@ def __init__(self, tp_type=""):
263
282
264
283
frame_struct_nmea = {
265
284
"SINGLE_FRAME_MASK" : 0xFF ,
266
- "FIRST_FRAME_MASK" : 0x0F ,
285
+ "FIRST_FRAME_MASK" : 0x1F ,
267
286
"CONSEQ_FRAME_MASK" : 0x00 ,
268
287
"SINGLE_FRAME" : 0xFF ,
269
288
"FIRST_FRAME" : 0x00 ,
0 commit comments