quantify_scheduler.gettables_profiled

Module containing ProfiledScheduleGettable, a subclass of ScheduleGettable used for profiling.

Warning

The ProfiledScheduleGettable is currently only tested to support Qblox hardware.

Module Contents

Classes

ProfiledInstrumentCoordinator

This subclass implements a profiling tool to log timing results.

ProfiledScheduleGettable

Subclass to overwite the initialize method, in order to include

Functions

profiler(func)

Decorator that reports the execution time.

Attributes

logger

logger[source]
profiler(func)[source]

Decorator that reports the execution time.

class ProfiledInstrumentCoordinator(name: str, parent_ic: quantify_scheduler.instrument_coordinator.InstrumentCoordinator)[source]

Bases: quantify_scheduler.instrument_coordinator.InstrumentCoordinator

This subclass implements a profiling tool to log timing results.

add_component(component) None[source]

Adds a component to the components collection.

Parameters

component – The component to add.

Raises
  • ValueError – If a component with a duplicated name is added to the collection.

  • TypeError – If component is not an instance of the base component.

prepare(compiled_schedule) None[source]

Prepares each component for execution of a schedule.

It attempts to configure all instrument coordinator components for which compiled instructions, typically consisting of a combination of sequence programs, waveforms and other instrument settings, are available in the compiled schedule.

Parameters

compiled_schedule – A schedule containing the information required to execute the program.

Raises
  • KeyError – If the compiled schedule contains instructions for a component absent in the instrument coordinator.

  • TypeError – If the schedule provided is not a valid CompiledSchedule.

start()[source]

Start all of the components.

The components are started in the order in which they were added.

stop(allow_failure=False)[source]

Stops all components.

The components are stopped in the order in which they were added.

Parameters

allow_failure – By default it is set to False. When set to True, the AttributeErrors raised by a component are demoted to warnings to allow other components to stop.

retrieve_acquisition()[source]

Retrieves the latest acquisition results of the components with acquisition capabilities.

Returns

The acquisition data per component.

wait_done(timeout_sec: int = 10)[source]

Awaits each component until it has stopped running or until it has exceeded the amount of time to run.

The timeout in seconds specifies the allowed amount of time to run before it times out.

Parameters

timeout_sec – The maximum amount of time in seconds before a timeout.

class ProfiledScheduleGettable(*args, **kwargs)[source]

Bases: quantify_scheduler.gettables.ScheduleGettable

Subclass to overwite the initialize method, in order to include compilation in the profiling.

_compile(sched)[source]

Overwrite compile step for profiling.

close()[source]

Cleanup new profiling instruments to avoid future conflicts.

log_profile(obj=None, path='profiling_logs', filename=None, indent: int = 4, separators=None)[source]

Store profiling logs to json file.

plot_profile(path=None, filename='average_runtimes.pdf')[source]

Create barplot of accumulated profiling data.