sciline.reporter.TimingReporter#

class sciline.reporter.TimingReporter[source]#

A reporter that tracks the time spent in each provider.

Examples

from sciline.reporter import TimingReporter
timer = TimingReporter()
pipeline.compute(Target, reporter=timer)
print(timer.summary())
__init__()[source]#

Methods

__init__()

as_pandas()

Return the recorded times as a Pandas DataFrame.

call_provider_with_reporting(provider, values)

Call a provider and report its progress with this reporter.

on_provider_end(provider_id)

Stop the clock for a provider call.

on_provider_start(provider)

Start the clock for a provider call.

reporting_provider_func(provider)

Wrap a provider's function to report progress with this reporter.

run_computation(providers)

Run a single computation with progress reporting.

summary()

Return a summary of the recorded times.

as_pandas()[source]#

Return the recorded times as a Pandas DataFrame. :rtype: DataFrame

See also

TimingReporter.summary

Return a summary of the recorded times as a string. Does not require Pandas.

call_provider_with_reporting(provider, values)#

Call a provider and report its progress with this reporter.

Return type:

Any

on_provider_end(provider_id)[source]#

Stop the clock for a provider call.

Return type:

None

on_provider_start(provider)[source]#

Start the clock for a provider call.

Return type:

int

reporting_provider_func(provider)#

Wrap a provider’s function to report progress with this reporter.

Return type:

Callable[..., Any]

run_computation(providers)#

Run a single computation with progress reporting.

This method is primarily meant for internal use. As a user, you should pass reporters to Pipeline.compute().

Use this method in a with statement:

with reporter.run_computation(providers):
    # Perform computation

This method exists mainly to provide arguments when entering a reporting context, implementers should mainly override __enter__.

Return type:

Reporter

summary()[source]#

Return a summary of the recorded times.

Returns:

str – The summary as a string.

See also

TimingReporter.as_pandas

Return the times as a Pandas DataFrame.