# Path: blimpy/h5diag.py
# def cmd_tool(args=None):
#     """ Command line tool h5diag """
#     parser = ArgumentParser(description="Command line utility for diagnosing HDF5 files.")
#     parser.add_argument("filename", type=str, help="Path of file to read")
#     if args is None:
#         args = sys.argv[1:]
#     parse_args = parser.parse_args(args)
# 
#     if not os.path.isfile(parse_args.filename):
#         oops("Not a file: {}".format(parse_args.filename))
#     if not h5py.is_hdf5(parse_args.filename):
#         oops("Not an HDF5 file: {}".format(parse_args.filename))
# 
#     examine(parse_args.filename)
#     print("\nNo errors detected")
# 
# Path: tests/data.py



from os.path import dirname
from blimpy.h5diag import cmd_tool
from tests.data import voyager_h5, voyager_fil
import numpy as np
import hdf5plugin
import h5py
import pytest
        dset_mask = h5.create_dataset("mask",
                                      shape=data_out.shape,
                                      compression=bs_compression,
                                      compression_opts=bs_compression_opts,
                                      dtype="uint8")
    
        dset.dims[2].label = b"frequency"
        dset.dims[1].label = b"feed_id"
        dset.dims[0].label = b"time"
    
        dset_mask.dims[2].label = b"frequency"
        dset_mask.dims[1].label = b"feed_id"
        dset_mask.dims[0].label = b"time"
    
        # Copy over header information as attributes
        for key, value in header:
            dset.attrs[key] = value


def execute_command(args):
    print("\ntest_h5diag: args:", args)
    cmd_tool(args)


def test_h5diag():

    args = [voyager_h5]
    execute_command(args)

    with pytest.raises(SystemExit):

# Path: blimpy/h5diag.py
# def cmd_tool(args=None):
#     """ Command line tool h5diag """
#     parser = ArgumentParser(description="Command line utility for diagnosing HDF5 files.")
#     parser.add_argument("filename", type=str, help="Path of file to read")
#     if args is None:
#         args = sys.argv[1:]
#     parse_args = parser.parse_args(args)
# 
#     if not os.path.isfile(parse_args.filename):
#         oops("Not a file: {}".format(parse_args.filename))
#     if not h5py.is_hdf5(parse_args.filename):
#         oops("Not an HDF5 file: {}".format(parse_args.filename))
# 
#     examine(parse_args.filename)
#     print("\nNo errors detected")
# 
# Path: tests/data.py



# Path: tests/test_h5diag.py
from os.path import dirname
from blimpy.h5diag import cmd_tool
from tests.data import voyager_h5, voyager_fil
import numpy as np
import hdf5plugin
import h5py
import pytest

        dset_mask = h5.create_dataset("mask",
                                      shape=data_out.shape,
                                      compression=bs_compression,
                                      compression_opts=bs_compression_opts,
                                      dtype="uint8")
    
        dset.dims[2].label = b"frequency"
        dset.dims[1].label = b"feed_id"
        dset.dims[0].label = b"time"
    
        dset_mask.dims[2].label = b"frequency"
        dset_mask.dims[1].label = b"feed_id"
        dset_mask.dims[0].label = b"time"
    
        # Copy over header information as attributes
        for key, value in header:
            dset.attrs[key] = value


def execute_command(args):
    print("\ntest_h5diag: args:", args)
    cmd_tool(args)


def test_h5diag():

    args = [voyager_h5]
    execute_command(args)

    with pytest.raises(SystemExit):

        args = [voyager_fil]