Application

class glue.core.application_base.Application(data_collection=None, session=None)[source]

Bases: glue.core.hub.HubListener

Attributes Summary

data_collection

session

settings

Iterate over settings

viewers

Return a tuple of tuples of viewers currently open The i’th tuple stores the viewers in the i’th close_tab

Methods Summary

add_data(self, \*args, \*\*kwargs)

Add data to the session.

add_datasets(data_collection, datasets[, …])

Utility method to interactively add datasets to a data_collection

add_widget(self, widget[, label, tab])

close_tab(self)

do(self, command)

get_setting(self, key)

Fetch the value of an application setting

load_data(self, paths[, skip_merge, auto_merge])

Given a path to a file, load the file as a Data object and add it to the current session.

new_data_viewer(self, viewer_class[, data, …])

Create a new data viewer, add it to the UI, and populate with data

new_tab(self)

redo(self)

report_error(self, message, detail)

Report an error message to the user.

restore_session(path)

Reload a previously-saved session

save_session(self, path[, include_data, …])

Save the data collection and hub to file.

set_data_color(self, color, alpha)

Reset all the data colors to that specified.

set_setting(self, key, value)

Set the value of an application setting

undo(self)

Attributes Documentation

data_collection
session
settings

Iterate over settings

viewers

Return a tuple of tuples of viewers currently open The i’th tuple stores the viewers in the i’th close_tab

Methods Documentation

add_data(self, *args, **kwargs)[source]

Add data to the session.

Positional arguments are interpreted using the data factories, while keyword arguments are interpreted using the same infrastructure as the qglue command.

This returns a list of added Data objects.

classmethod add_datasets(data_collection, datasets, skip_merge=False, auto_merge=False)[source]

Utility method to interactively add datasets to a data_collection

Parameters
data_collectionDataCollection
datasetsData or list of Data

One or more Data instances

Adds datasets to the collection
add_widget(self, widget, label=None, tab=None)[source]
close_tab(self)[source]
do(self, command)[source]
get_setting(self, key)[source]

Fetch the value of an application setting

load_data(self, paths, skip_merge=False, auto_merge=False)[source]

Given a path to a file, load the file as a Data object and add it to the current session.

This returns the added Data object.

new_data_viewer(self, viewer_class, data=None, state=None)[source]

Create a new data viewer, add it to the UI, and populate with data

new_tab(self)[source]
redo(self)[source]
report_error(self, message, detail)[source]

Report an error message to the user. Must be implemented in a subclass

Parameters
messagestr

The message to display

detailstr

Longer context about the error

static restore_session(path)[source]

Reload a previously-saved session

Parameters
pathstr

Path to the file to load

Returns
appApplication

The loaded application

save_session(self, path, include_data=False, absolute_paths=True)[source]

Save the data collection and hub to file.

Can be restored via restore_session

Note: Saving of client is not currently supported. Thus, restoring this session will lose all current viz windows

set_data_color(self, color, alpha)[source]

Reset all the data colors to that specified.

set_setting(self, key, value)[source]

Set the value of an application setting

Raises a KeyError if the setting does not exist Raises a ValueError if the value is invalid

undo(self)[source]