Skip to content

Commit

Permalink
Generalise file access
Browse files Browse the repository at this point in the history
  • Loading branch information
qgp committed Nov 27, 2023
1 parent f29b4a8 commit 7034555
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions machine_learning_hep/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def openfile(filename, attr):
return gzip.open(filename, attr)
if filename.lower().endswith('.lz4'):
return lz4.frame.open(filename, attr)
if filename.lower().endswith('.pkl'):
return open(filename, attr, encoding='utf-8')
return open(filename, attr)

def mask_df(df_to_mask, mask_config):
Expand Down

0 comments on commit 7034555

Please sign in to comment.