BaseData¶
-
class
glue.core.data.BaseData[source]¶ Bases:
objectBase class for any glue data object which indicates which methods should be provided at a minimum.
For now, subclasses of BaseData are not guaranteed to work in glue, and you should instead subclass BaseCartesianData.
Attributes Summary
A list of
ComponentIDgiving all available components in the dataA list of
ComponentIDgiving all coordinate components in the dataThe name of the dataset
A list of
ComponentIDgiving all pixel coordinate components in the dataTuple of subsets attached to this dataset
A list of
ComponentIDgiving all world coordinate components in the dataMethods Summary
add_subset(self, subset)Assign a pre-existing subset to this data object.
broadcast(self, attribute)Send a
DataUpdateMessageto the hubfind_component_id(self, label)Find a component ID by name.
get_kind(self, cid)Get the kind of data for a given component.
new_subset(self[, subset, color, label])Create a new subset, and attach to self.
register_to_hub(self, hub)Connect to a hub.
Attributes Documentation
-
components[source]¶ A list of
ComponentIDgiving all available components in the data
-
coordinate_components[source]¶ A list of
ComponentIDgiving all coordinate components in the data
-
pixel_component_ids[source]¶ A list of
ComponentIDgiving all pixel coordinate components in the data
-
world_component_ids[source]¶ A list of
ComponentIDgiving all world coordinate components in the data
Methods Documentation
-
add_subset(self, subset)[source]¶ Assign a pre-existing subset to this data object.
- Parameters
subset – A
SubsetorSubsetStateobject
If input is a
SubsetState, it will be wrapped in a new Subset automaticallyNote
The preferred way for creating subsets is via
new_subset_group(). Manually-instantiated subsets will not be represented properly by the UI
-
broadcast(self, attribute)[source]¶ Send a
DataUpdateMessageto the hub- Parameters
attribute (str) – Name of an attribute that has changed (or None)
-
find_component_id(self, label)[source]¶ Find a component ID by name.
This returns the associated ComponentID if label is found and unique, and None otherwise.
-
abstract
get_kind(self, cid)[source]¶ Get the kind of data for a given component.
- Parameters
- cidComponentID
The component ID to get the data kind for
- Returns
- kind{‘numerical’, ‘categorical’, ‘datetime’}
The kind of data for the given component ID.
-
new_subset(self, subset=None, color=None, label=None, **kwargs)[source]¶ Create a new subset, and attach to self.
Note
The preferred way for creating subsets is via
new_subset_group(). Manually-instantiated subsets will not be represented properly by the UI- Parameters
subset – optional, reference subset or subset state. If provided, the new subset will copy the logic of this subset.
- Returns
The new subset object
-