pygsti.extras.drift.driftreport.DriftSummaryTable#
- class DriftSummaryTable(ws, results, dskey=None, detectorkey=None, estimatekey=None)#
Bases:
WorkspaceTabletodo
todo
Methods
__init__(ws, results[, dskey, detectorkey, ...])todo
display()Display this object within an iPython notebook.
render(typ)Renders this table into the specified format, specifically for embedding it within a larger document.
saveas(filename[, index, verbosity])Saves this workspace table object to a file.
set_render_options(**kwargs)Sets rendering options, which affect how render() behaves.
Attributes
default_render_options- display()#
Display this object within an iPython notebook.
- Return type:
None
- render(typ)#
Renders this table into the specified format, specifically for embedding it within a larger document.
- Parameters:
typ (str) – The format to render as. Currently “html”, “latex” and “python” are supported.
- Returns:
A dictionary of strings giving the different portions of the embeddable output. For “html”, keys are “html” and “js”. For “latex”, there is a single key “latex”.
- Return type:
dict
- saveas(filename, index=None, verbosity=0)#
Saves this workspace table object to a file.
The type of file that is saved is determined automatically by the extension of filename. Recognized extensions are pdf (PDF), tex (LaTeX), pkl (Python pickle) and html (HTML). Since this object may contain different instances of its data based on switch positions, when their are multiple instances the user must specify the index argument to disambiguate.
- Parameters:
filename (str) – The destination filename. Its extension determines what type of file is saved.
index (int, optional) – An absolute index into the list of different switched “versions” of this object’s data. In most cases, the object being saved doesn’t depend on any switch boards and has only a single “version”, in which case this can be left as the default.
verbosity (int, optional) – Controls the level of detail printed to stdout.
- Return type:
None
- set_render_options(**kwargs)#
Sets rendering options, which affect how render() behaves.
The reason render options are set via this function rather than passed directly as arguments to the render(…) call is twofold. First, it allows for global ‘default’ options to be set before creating WorkspaceOutput-derived objects; Secondly, it allows the user to set render options right after an object is constructed, separately from the rendering process (which is sometimes desirable).
- Parameters:
output_dir (str or False) – The name of the output directory under which all output files should be created. The names of these files just the IDs of the items being rendered.
precision (int or dict, optional) – The amount of precision to display. A dictionary with keys “polar”, “sci”, and “normal” can separately specify the precision for complex angles, numbers in scientific notation, and everything else, respectively. If an integer is given, it this same value is taken for all precision types. If None, then {‘normal’: 6, ‘polar’: 3, ‘sci’: 0} is used.
switched_item_mode ({'inline','separate files'}, optional) – Whether switched items should be rendered inline within the ‘html’ and ‘js’ blocks of the return value of
render(), or whether each switched item (corresponding to a single “switch position”) should be rendered in a separate file and loaded on-demand only when it is needed.switched_item_id_overrides (dict, optional) – A dictionary of index:id pairs, where index is a 0-based index into the list of switched items (plots or tables), and id is a string ID. Since the ID is used as the filename when saving files, overriding the ID is useful when writing a single plot or table to a specific filename.
global_requirejs (bool, optional) – Whether the table is going to be embedded in an environment with a globally defined RequireJS library. If True, then rendered output will make use of RequireJS.
click_to_display (bool, optional) – If True, table plots are not initially created but must be clicked to prompt creation. This is False by default, and can be useful to set to True for tables with especially complex plots whose creation would slow down page loading significantly.
resizable (bool, optional) – Whether or not to place table inside a JQueryUI resizable widget (only applies when typ == “html”).
autosize ({'none', 'initial', 'continual'}, optional) – Whether tables and plots should be resized either initially, i.e. just upon first rendering (“initial”) or whenever the browser window is resized (“continual”). This option only applies for html rendering.
link_to (tuple of {"tex", "pdf", "pkl"} or None, optional) – If not None, a list of one or more items from the given set indicating whether or not to include links to Latex, PDF, and Python pickle files, respectively. Note that setting this render option does not automatically create/render additional formats of this output object (you need to make multiple render calls for that) - it just creates the links to these files when rendering as “html”.
valign ({"top","bottom"}) – Whether the switched items should be vertically aligned by their tops or bottoms (when they’re different heights).
latex_cmd (str, optional) – The system command or executable used to compile LaTeX documents. Usually “pdflatex”.
latex_flags (list, optional) – A list of (string-valued) flags to pass to latex_cmd when compiling LaTeX documents. Defaults to [“-interaction=nonstopmode”, “-halt-on-error”, “-shell-escape”]
page_size (tuple) – The usable page size for LaTeX documents, as (width,*height*) where width and height are in inches. Note that this does not include margins. Defaults to (6.5,8.0).
render_includes (bool, optional) – When rendering as “latex”, whether included files should also be rendered (either by compiling latex to PDF or saving plots as PDFs).
leave_includes_src (bool, optional) – When LaTeX compilation is done, should the source “.tex” files be removed? If `False`, then they *are removed.
- Return type:
None