Bases: object
Base class to handle subsets of data.
These objects both describe subsets of a dataset, and relay any state changes to the hub that their parent data are assigned to.
This base class only directly implements the logic that relays state changes back to the hub. Subclasses implement the actual description and manipulation of data subsets
Data
The dataset that this subset describes
Create a new subset object.
Note: the preferred way for creating subsets is via new_subset_group()
. Manually-instantiated subsets will probably not be represented properly by the UI
Attributes Summary
Methods Summary
Attributes Documentation
Returns a tuple of the ComponentIDs that this subset depends upon.
Convenience access to subset’s label.
Methods Documentation
Explicitly broadcast a SubsetUpdateMessage to the hub.
The name of the attribute (if any) that should be broadcast as updated.
Broadcast a SubsetDeleteMessage to the hub, and stop broadcasting.
Also removes subset reference from parent data’s subsets list.
Set whether state changes to the subset are relayed to a hub.
It can be useful to turn off broadcasting, when modifying the subset in ways that don’t impact any of the clients.
Whether the subset should broadcast state changes (True/False)
Paste subset state from other_subset onto self.
Register a subset to its data, and start broadcasting state changes
Convert the current SubsetState
to a MaskSubsetState
.
Convert the current subset to a list of indices. These index the elements in the (flattened) data object that belong to the subset.
If x is the numpy array corresponding to some component.data, the two following statements are equivalent:
x.flat[subset.to_index_list()] x[subset.to_mask()]
ndarray
A numpy array, giving the indices of elements in the data that belong to this subset.
If an index list cannot be created for the requested data set.
Convert the current subset to a mask.
An optional view into the dataset (e.g. a slice) If present, the mask will pertain to the view and not the entire dataset.
ndarray
A boolean numpy array, the same shape as the data, that defines whether each element belongs to the subset.
Write a subset mask out to file
Name of file to write to
Name of format to write to. Currently, only “fits” is supported.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4