AFL.automation.APIServer.Driver#
Functions
Classes
|
|
|
|
|
A dictionary-like class that serializes changes to disk |
- class AFL.automation.APIServer.Driver.Driver(name, defaults=None, overrides=None, useful_links=None, afl_home=None)[source]#
- unqueued()#
- queued()#
- quickbar()#
- static_dirs = {}#
- classmethod gather_defaults()[source]#
Gather all inherited static class-level dictionaries called default.
- classmethod gather_static_dirs()[source]#
Gather all inherited class-level dictionaries named static_dirs.
This method walks through the Method Resolution Order (MRO) to collect static_dirs definitions from all parent classes. Child class definitions override parent definitions for the same subpath key.
- Returns:
Dictionary mapping subpaths to pathlib.Path objects for directories containing static files to be served by the API server.
- Return type:
- clean_config()[source]#
Remove any config keys that are not present in defaults.
This method gathers all defaults from the class hierarchy, makes a copy of the current config, and removes any keys that don’t exist in the defaults. The cleaned config is then saved back to the persistent config.
- Returns:
Dictionary containing the keys that were removed from config
- Return type:
- pre_execute(**kwargs)[source]#
Executed before each call to execute
All of the kwargs passed to execute are also pass to this method. It is expected that this method be overridden by subclasses.
- post_execute(**kwargs)[source]#
Executed after each call to execute
All of the kwargs passed to execute are also pass to this method. It is expected that this method be overridden by subclasses.
- set_data(data: dict)[source]#
Set data in the DataPacket object
- Parameters:
data (dict) – Dictionary of data to store in the driver object
variables (Note! if the keys in data are not system or sample)
:param : :param they will be erased at the end of this function call.:
- retrieve_obj(uid, delete=True)[source]#
Retrieve an object from the dropbox
- Parameters:
uid (str) – The uuid of the file to retrieve
- tiled_search(queries='', filters='', sort='', fields='', offset=0, limit=50, **kwargs)[source]#
Proxy endpoint for Tiled metadata search to avoid CORS issues.
- tiled_get_data(entry_id, **kwargs)[source]#
Proxy endpoint to get xarray HTML representation from Tiled.
- tiled_get_xarray_html(entry_ids, **kwargs)[source]#
Return xarray _repr_html_() for one or more Tiled entries.
- tiled_get_plot_manifest(entry_ids, **kwargs)[source]#
Return plot-manifest metadata for one or more Tiled entries.
- tiled_get_plot_variable(entry_ids, var_name, **kwargs)[source]#
Return one variable from the cached combined plot dataset.
- tiled_get_full_json(entry_id, **kwargs)[source]#
Proxy endpoint to get JSON-serializable full data for one entry.