(name, simulator, start_time, end_time, output_prefix="", tz="US/Pacific")
Create a report for a clusterman simulation run

    The layout for this report is a set of rows (one for each month in the time range)
    with [heatmap, trend_line] charts in each row.  The overall cost for each month is printed
    for each row, and the overall cost is given in the title

    :param name: the name of the report to generate
    :param simulator: a Simulator object
    :param start_time: the earliest time for the report
    :param end_time: the latest time for the report
    :param tz: a timezone string or object to interpret the chart data in
Create a report for a clusterman simulation run
Create a report for a clusterman simulation run
def make_report(name, simulator, start_time, end_time, output_prefix="", tz="US/Pacific"):
    """ Create a report for a clusterman simulation run

    The layout for this report is a set of rows (one for each month in the time range)
    with [heatmap, trend_line] charts in each row.  The overall cost for each month is printed
    for each row, and the overall cost is given in the title

    :param name: the name of the report to generate
    :param simulator: a Simulator object
    :param start_time: the earliest time for the report
    :param end_time: the latest time for the report
    :param tz: a timezone string or object to interpret the chart data in
    """
    begin = arrow.now()
    print(f"Generating {name} report...")
    report = REPORT_TYPES[name]
    report_data = simulator.get_data(name, start_time, end_time, timedelta(seconds=60))

    if not isinstance(tz, tzinfo):
        tz = arrow.parser.TzinfoParser.parse(tz)
    local_start = start_time.to(tz)
    local_end = end_time.to(tz)

    months = arrow.Arrow.span_range("month", local_start, local_end)
    fig = Figure(figsize=(AXIS_DIMENSION_INCHES[0], AXIS_DIMENSION_INCHES[1] * len(months)))
    _make_report_title(fig, report, simulator.metadata, months)

    error_threshold_fn = _get_error_threshold_function(report.error_threshold, simulator)

    heatmap_data, error_data, *heatmap_range = transform_heatmap_data(report_data, error_threshold_fn, months, tz)
    trend_data, *trend_range = transform_trend_data(report_data, months, report.trend_rollup)

    heatmap = PlotStruct(heatmap_data, error_data, heatmap_range, _make_axis_titles(report, report_data, months),)
    trend = PlotStruct(trend_data, None, trend_range, report.trend_label, report.trend_axis_formatter)

    generate_heatmap_trend_grid(fig, heatmap, trend, months, tz)
    # This ugly bit of code is just checking every month of error data (things that exceeded their threshold);
    # if any month has a datapoint that exceeded its threshold, display the red dot in the legend.  Otherwise don't.
    has_errors = any([len(data_points[0]) > 0 for data_points in error_data.values()])
    _make_legend(fig, heatmap_range, has_errors, report.legend_formatter)

    if output_prefix:
        output_prefix += "_"
    output_file = f"{output_prefix}{name}.png"
    processing_time = (arrow.now() - begin).total_seconds()
    fig.savefig(output_file, dpi=FIGURE_DPI)
    print(f"Done!  Report saved as {output_file} ({processing_time}s)")
def make_report ( name , simulator , start_time , end_time , output_prefix = "" , tz = "US/Pacific" ) : begin = arrow . now ( ) print ( f"Generating {name} report..." ) report = REPORT_TYPES [ name ] report_data = simulator . get_data ( name , start_time , end_time , timedelta ( seconds = 60 ) ) if not isinstance ( tz , tzinfo ) : tz = arrow . parser . TzinfoParser . parse ( tz ) local_start = start_time . to ( tz ) local_end = end_time . to ( tz ) months = arrow . Arrow . span_range ( "month" , local_start , local_end ) fig = Figure ( figsize = ( AXIS_DIMENSION_INCHES [ 0 ] , AXIS_DIMENSION_INCHES [ 1 ] * len ( months ) ) ) _make_report_title ( fig , report , simulator . metadata , months ) error_threshold_fn = _get_error_threshold_function ( report . error_threshold , simulator ) heatmap_data , error_data , * heatmap_range = transform_heatmap_data ( report_data , error_threshold_fn , months , tz ) trend_data , * trend_range = transform_trend_data ( report_data , months , report . trend_rollup ) heatmap = PlotStruct ( heatmap_data , error_data , heatmap_range , _make_axis_titles ( report , report_data , months ) , ) trend = PlotStruct ( trend_data , None , trend_range , report . trend_label , report . trend_axis_formatter ) generate_heatmap_trend_grid ( fig , heatmap , trend , months , tz ) # This ugly bit of code is just checking every month of error data (things that exceeded their threshold); # if any month has a datapoint that exceeded its threshold, display the red dot in the legend.  Otherwise don't. has_errors = any ( [ len ( data_points [ 0 ] ) > 0 for data_points in error_data . values ( ) ] ) _make_legend ( fig , heatmap_range , has_errors , report . legend_formatter ) if output_prefix : output_prefix += "_" output_file = f"{output_prefix}{name}.png" processing_time = ( arrow . now ( ) - begin ) . total_seconds ( ) fig . savefig ( output_file , dpi = FIGURE_DPI ) print ( f"Done!  Report saved as {output_file} ({processing_time}s)" )