AFL.automation.shared.liveplot#
Live campaign dashboards backed by AFL Tiled run documents.
Functions
|
Create a Tiled client using the configured AFL Tiled credentials. |
|
Render a template by name with the given context. |
|
Encode a dict or sequence of two-element tuples into a URL query string. |
Classes
|
Special type indicating an unconstrained type. |
|
|
|
Query equality of a given key's value to the specified value. |
|
Live campaign dashboard enriched with Bayesian-optimization state. |
|
Read campaign datasets from Tiled and compose a live plotting dashboard. |
- class AFL.automation.shared.liveplot.LivePlottingDriver(overrides=None, tiled_client=None)[source]#
Read campaign datasets from Tiled and compose a live plotting dashboard.
- defaults = {'campaign_id': '', 'catalog': 'run_documents', 'composition_plot': {'component_labels': {}, 'component_names': [], 'strip_prefixes': ['stock_']}, 'composition_source': {'driver_name': 'OT2Prepare', 'metadata_path': 'prepare.balanced_target.stock_volume_fractions', 'task_name': 'prepare'}, 'dashboard_layout': [{'columns': 3, 'panels': [{'kind': 'image', 'source': 'image_sources', 'state': 'latest', 'title': 'Latest image', 'variable': 'img_rgb'}, {'kind': 'spectrum', 'source': 'spectrum_sources', 'state': 'latest', 'title': 'Latest spectrum', 'x_variable': 'wavelength', 'y_variable': 'extinction'}, {'kind': 'spectrum', 'source': 'target_spectrum', 'state': 'target', 'title': 'Target spectrum', 'x_variable': 'wavelength', 'y_variable': 'extinction'}], 'title': 'Current measurement'}, {'columns': 4, 'panels': [{'kind': 'composition', 'source': 'composition_source', 'state': 'latest', 'title': 'Latest composition', 'variable': 'prepare.balanced_target.stock_volume_fractions'}, {'kind': 'composition', 'source': 'bo_source', 'state': 'suggested', 'title': 'Next composition', 'variable': 'suggested_sample'}, {'kind': 'composition', 'source': 'bo_source', 'state': 'best', 'title': 'Best composition', 'variable': 'bayesopt_best_x'}, {'kind': 'progress', 'source': 'bo_source', 'title': 'Progress', 'variable': 'score'}], 'title': 'Optimization status'}, {'columns': 2, 'panels': [{'kind': 'design_space', 'source': 'bo_source', 'title': 'Composition design space', 'variable': 'composition'}, {'color_by': 'score', 'kind': 'spectra', 'source': 'spectrum_sources', 'title': 'All spectra', 'x_variable': 'wavelength', 'y_variable': 'extinction'}], 'title': 'Campaign overview'}, {'columns': 1, 'panels': [{'kind': 'gallery', 'source': 'image_sources', 'title': '', 'variable': 'img_rgb'}], 'title': 'Image gallery'}], 'field_paths': {'campaign': ['attrs.AL_campaign_name', 'AL_campaign_name'], 'driver': ['attrs.driver_name', 'driver_name'], 'sample_name': ['attrs.sample_name', 'sample_name'], 'sample_uuid': ['attrs.sample_uuid', 'sample_uuid'], 'task': ['attrs.task_name', 'task_name'], 'timestamp': ['attrs.timestamp', 'timestamp', 'attrs.meta.ended', 'meta.ended', 'attrs.meta.started', 'meta.started']}, 'image_sources': [{'driver_name': 'RGBCamera', 'name': 'RGB Camera', 'task_name': 'capture_rgb', 'variable': 'img_rgb'}], 'objective_direction': 'minimize', 'spectrum_sources': [{'driver_name': 'SeabreezeUVVis', 'name': 'UV-Vis', 'task_name': 'measure', 'x_label': 'Wavelength (nm)', 'x_variable': 'wavelength', 'y_label': 'Extinction', 'y_variable': 'extinction'}]}#
- class AFL.automation.shared.liveplot.LivePlotBO(overrides=None, tiled_client=None)[source]#
Live campaign dashboard enriched with Bayesian-optimization state.
- defaults = {'bo_source': {'best_f_variable': 'bayesopt_best_f', 'best_x_variable': 'bayesopt_best_x', 'component_dim': 'component', 'composition_variable': 'composition', 'driver_name': 'DoubleAgentDriver', 'sample_dim': 'sample', 'score_variable': 'score', 'suggested_variable': 'suggested_sample', 'task_name': 'predict'}, 'target_image': {'entry_id': '', 'variable': 'img_rgb'}, 'target_spectrum': {'entry_id': '', 'x_variable': 'wavelength', 'y_variable': 'extinction'}}#