CategoricalROI

class glue.core.roi.CategoricalROI(categories=None)[source]

Bases: glue.core.roi.Roi

A ROI abstraction to represent selections of categorical data.

Methods Summary

contains(x, y) Test whether a set categorical elements fall within
defined() Returns True if the ROI is defined
from_range(cat_comp, lo, hi) Utility function to help construct the Roi from a range.
reset()
to_polygon() Just not possible.
update_categories(categories)

Methods Documentation

contains(x, y)[source]

Test whether a set categorical elements fall within the region of interest

Parameters:
  • x – Any array-like object of categories (includes CategoricalComponenets)
  • y – Unused but required for compatibility

Returns

A list of True/False values, for whether each x value falls within the ROI
defined()[source]

Returns True if the ROI is defined

static from_range(cat_comp, lo, hi)[source]

Utility function to help construct the Roi from a range.

Parameters:
  • cat_comp – Anything understood by ._categorical_helper … array, list or component
  • lo – lower bound of the range
  • hi – upper bound of the range
Returns:

CategoricalROI object

reset()[source]
to_polygon()[source]

Just not possible.

update_categories(categories)[source]