def get_diaginfo(diaginfo_file):
widths = [rec.width for rec in diag_recs]<EOL>col_names = [rec.name for rec in diag_recs]<EOL>dtypes = [rec.type for rec in diag_recs]<EOL>usecols = [name for name in col_names if not name.startswith('<STR_LIT:->')]<EOL>diag_df = pd.read_fwf(diaginfo_file, widths=widths, names=col_names,<EOL>dtypes=dtypes, comment="<STR_LIT:#>", header=None,<EOL>usecols=usecols)<EOL>diag_desc = {diag.name: diag.desc for diag in diag_recs<EOL>if not diag.name.startswith('<STR_LIT:->')}<EOL>return diag_df, diag_desc<EOL>
Read an output's diaginfo.dat file and parse into a DataFrame for
use in selecting and parsing categories.

Parameters
----------
diaginfo_file : str
    Path to diaginfo.dat

Returns
-------
DataFrame containing the category information.