tokio.cli.summarize_h5lmt module

Generate summary metrics from an h5lmt file. Will be eventually replaced by the summarize_tts command-line tool.

tokio.cli.summarize_h5lmt.bin_dataset(hdf5_file, dataset_name, num_bins)[source]

Group timeseries dataset into bins

Parameters:dataset (h5py.Dataset) – dataset to be binned up
Returns:list of dictionaries corresponding to bins. Each dictionary contains data summarized over that bin’s time interval.
tokio.cli.summarize_h5lmt.bin_datasets(hdf5_file, dataset_names, orient='columns', num_bins=24)[source]

Group many timeseries datasets into bins

Takes a TOKIO HDF file and converts it into bins of reduced data (e.g., bin by hourly totals)

  • hdf5_file (connectors.Hdf5) – HDF5 file from where data should be retrieved
  • dataset_names (list of str) – dataset names to be aggregated
  • columns (str) – either ‘columns’ or ‘index’; same semantic meaning as pandas.DataFrame.from_dict
  • num_binds (int) – number of bins to generate per day

Dictionary of lists. Keys are metrics, and values (lists) are the aggregated value of that metric in a single timestep bin. For example:

    "sum_some_metric":      [  0,   2,   3,   1],
    "sum_someother_metric": [9.9, 2.3, 5.1, 0.2],


Entry point for the CLI interface

tokio.cli.summarize_h5lmt.print_data_summary(data, units='TiB')[source]

Print the output of the summarize_reduced_data function in a human-readable format

tokio.cli.summarize_h5lmt.print_datum(datum=None, units='GiB')[source]

Print out the relevant fields from a bin containing aggregated values

  • datum (dict) – the results of bin_datum
  • units (str) – units to print (KiB, MiB, GiB, TiB)

Take a list of LMT data sets and return summaries of each relevant key