fermi-ad / datalogger-to-ml

Scripts for requesting AD Controls data logger data and transforming those to the desired ML output format and destination.
3 stars 0 forks source link

Verify data files #16

Closed beauremus closed 3 years ago

beauremus commented 3 years ago

Create a script to iterate over generated data files and verify that they can be opened.

I'm thinking it will be like the h5_dump.py.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pandas as pd
import sys
import helper_methods

def main(output_path):
    h5_outputs = path.join(output_path, '*.h5')
    # Glob allows the use of the * wildcard
    files = glob(h5_outputs)

    for file in files:
        try:
            with pd.HDFStore(file) as hdf:
                print(f'{file} was successfully read')
        except OSError as error:
            print(f'Could not open {file} with error: {error}')

if __name__ == '__main__':
    main(sys.argv[1])
sakshi-fermi commented 3 years ago

a3364d6 addresses this.