cytoflow.utility.custom_traits

Custom traits for cytoflow

class cytoflow.utility.custom_traits.PositiveInt(default_value=<traits.trait_handlers.NoDefaultSpecified object>, **metadata)[source]

Bases: traits.trait_types.BaseInt

Defines a trait whose value must be a positive integer

info_text = 'a positive integer'
validate(obj, name, value)[source]

Validates that a specified value is valid for this trait.

class cytoflow.utility.custom_traits.PositiveCInt(default_value=<traits.trait_handlers.NoDefaultSpecified object>, **metadata)[source]

Bases: traits.trait_types.BaseCInt

Defines a trait whose value must be a positive integer

info_text = 'a positive integer'
validate(obj, name, value)[source]

Validates that a specified value is valid for this trait.

Note: The ‘fast validator’ version performs this check in C.

class cytoflow.utility.custom_traits.PositiveFloat(default_value=<traits.trait_handlers.NoDefaultSpecified object>, **metadata)[source]

Bases: traits.trait_types.BaseFloat

Defines a trait whose value must be a positive float

info_text = 'a positive float'
validate(obj, name, value)[source]

Validates that a specified value is valid for this trait.

Note: The ‘fast validator’ version performs this check in C.

class cytoflow.utility.custom_traits.PositiveCFloat(default_value=<traits.trait_handlers.NoDefaultSpecified object>, **metadata)[source]

Bases: traits.trait_types.BaseCFloat

Defines a trait whose value must be a positive float

info_text = 'a positive float'
validate(obj, name, value)[source]

Validates that a specified value is valid for this trait.

Note: The ‘fast validator’ version performs this check in C.

class cytoflow.utility.custom_traits.FloatOrNone(default_value=<traits.trait_handlers.NoDefaultSpecified object>, **metadata)[source]

Bases: traits.trait_types.BaseFloat

info_text = 'a float or None'
validate(obj, name, value)[source]

Validates that a specified value is valid for this trait.

Note: The ‘fast validator’ version performs this check in C.

class cytoflow.utility.custom_traits.CFloatOrNone(default_value=<traits.trait_handlers.NoDefaultSpecified object>, **metadata)[source]

Bases: traits.trait_types.BaseCFloat

info_text = 'a float or None'
validate(obj, name, value)[source]

Validates that a specified value is valid for this trait.

Note: The ‘fast validator’ version performs this check in C.

class cytoflow.utility.custom_traits.IntOrNone(default_value=<traits.trait_handlers.NoDefaultSpecified object>, **metadata)[source]

Bases: traits.trait_types.BaseInt

info_text = 'an int or None'
validate(obj, name, value)[source]

Validates that a specified value is valid for this trait.

class cytoflow.utility.custom_traits.CIntOrNone(default_value=<traits.trait_handlers.NoDefaultSpecified object>, **metadata)[source]

Bases: traits.trait_types.BaseCInt

info_text = 'an int or None'
validate(obj, name, value)[source]

Validates that a specified value is valid for this trait.

Note: The ‘fast validator’ version performs this check in C.

class cytoflow.utility.custom_traits.ScaleEnum(*args, **metadata)[source]

Bases: traits.trait_types.BaseEnum

Defines an enumeration that contains one of the registered data scales

info_text = 'an enum containing one of the registered scales'
get_default_value()[source]

Returns a tuple of the form: (default_value_type, default_value) which describes the default value for this trait. The default implementation analyzes the value of the trait’s default_value attribute and determines an appropriate default_value_type for default_value. If you need to override this method to provide a different result tuple, the following values are valid values for default_value_type:

  • 0, 1: The default_value item of the tuple is the default value.
  • 2: The object containing the trait is the default value.
  • 3: A new copy of the list specified by default_value is the default value.
  • 4: A new copy of the dictionary specified by default_value is the default value.
  • 5: A new instance of TraitListObject constructed using the default_value list is the default value.
  • 6: A new instance of TraitDictObject constructed using the default_value dictionary is the default value.
  • 7: default_value is a tuple of the form: (callable, args, kw), where callable is a callable, args is a tuple, and kw is either a dictionary or None. The default value is the result obtained by invoking callable(*args, **kw).
  • 8: default_value is a callable. The default value is the result obtained by invoking default_value*(*object), where object is the object containing the trait. If the trait has a validate() method, the validate() method is also called to validate the result.
  • 9: A new instance of TraitSetObject constructed using the default_value set is the default value.
class cytoflow.utility.custom_traits.Removed(**metadata)[source]

Bases: traits.trait_handlers.TraitType

Names a trait that was present in a previous version but was removed.

Trait metadata:

  • err_string : the error string in the error

  • gui : if True, don’t return a backtrace (because it’s very slow)

  • warning : if True, raise a warning when the trait is referenced.

    Otherwise, raise an exception.

get(obj, name)[source]
set(obj, name, value)[source]
class cytoflow.utility.custom_traits.Deprecated(**metadata)[source]

Bases: traits.trait_handlers.TraitType

Names a trait that was present in a previous version but was renamed in this version. When the trait is accessed, a warning is raised, and the access is passed through to the new trait.

Trait metadata:
  • new : the name of the new trait
  • err_string : the error string in the error
  • gui : if True, don’t return a backtrace (because it’s very slow)
get(obj, name)[source]
set(obj, name, value)[source]