StateAttributeLimitsHelper

class glue.core.state_objects.StateAttributeLimitsHelper(state, attribute, random_subset=10000, margin=0, **kwargs)[source]

Bases: glue.core.state_objects.StateAttributeCacheHelper

This class is a helper for attribute-dependent min/max level values. It is equivalent to AttributeLimitsHelper but operates on State objects and is GUI-independent.

Parameters
attributestr

The attribute name - this will be populated once a dataset is assigned to the helper.

random_subsetint

How many points to use at most for the percentile calculation (using all values is highly inefficient and not needed)

marginfloat

Whether to add a margin to the range of values determined. This should be given as a floating point value that will be multiplied by the range of values to give the margin to add to the limits.

lower, upperstr

The fields for the lower/upper levels

percentileQComboBox instance, optional

The scale mode combo - this will be populated by presets such as Min/Max, various percentile levels, and Custom.

logbool

Whether the limits are in log mode (in which case only positive values are used when finding the limits)

Notes

Once the helper is instantiated, the data associated with the helper can be set/changed with:

>>> helper = AttributeLimitsHelper(...)
>>> helper.data = data

The data can also be passed to the initializer as described in the list of parameters above.

Attributes Summary

modifiers_names

values_names

Methods Summary

flip_limits(self)

update_values(self[, force, …])

Attributes Documentation

modifiers_names = ('log', 'percentile')
values_names = ('lower', 'upper')

Methods Documentation

flip_limits(self)[source]
update_values(self, force=False, use_default_modifiers=False, **properties)[source]