Inherits from
- ANumericContext: enthought.numerical_modeling.numeric_context.a_numeric_context.ANumericContext
Attributes
- context
Context being derived from:
context = Instance(ANumericContext)
- context_all_names
List of available data item names in the entire context:
context_all_names = Property
- context_base
Base context reference:
context_base = Property
- context_delegate
The ContextDelegate the context uses to handle various policy decisions:
context_delegate = Property
- context_group
The 'name' of the current context group (may be a tuple representing the shape of the group's contents:
context_group = Property
- context_indices
The array indices:
context_indices = Property
- context_items
List of array descriptor items:
context_items = Property
- context_name
The name of the context:
context_name = Property
- context_names
List of available data item names in the current group:
context_names = Property
- defer_events
Whether to buffer 'dict_modified' and 'context_modified' events. When true, no events are fired, and when reverted to false, one pair of event fires that represents the net change since 'defer_events' was set.
defer_events = Property(depends_on = 'context_base.defer_events')
- sub_context_names
The list of all sub_context names:
sub_context_names = Property
Inherited from base classes
Method summary
- __contains__(self, *a, **kw)
- __delitem__(self, name)
- __getitem__(self, name)
- __init__(self, context = None, **traits)
- __iter__(self, *a, **kw)
- __setitem__(self, name, value)
- __setstate__(self, state)
- bind_dynamic(self, value, trait_name)
- contains_context(self, context)
- context_group_for(self, name, names = None)
- create_context(self, mode)
- dump_context(self, indent = 0)
- get_context_base(self)
- get_context_data(self, name)
- get_context_undefined(self, name, value)
- hook_context(self, context)
- insert_context(self, context)
- iteritems(self, *a, **kw)
- keys(self)
- remove_context(self, context)
- set_context_data(self, name, value)
- set_context_undefined(self, name, value)
Inherited from base classes
- __deepcopy__(self, memo)
- __getstate__(self)
- __prefix_trait__(self, name)
- __reduce_ex__(self, protocol)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same')
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- reset_traits(self, traits = None, **metadata)
- set(self, trait_change_notify = True, **traits)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- __contains__(self, *a, **kw)
- __delitem__(self, name)
- __getitem__(self, name)
- __init__(self, context = None, **traits)
Initializes the object.
- __iter__(self, *a, **kw)
- __setitem__(self, name, value)
- __setstate__(self, state)
- bind_dynamic(self, value, trait_name)
Create a dynamic binding to the trait named 'trait_name' on 'value'.
Dynamic bindings maintain the invariant
self[ getattr( value, trait_name ) ] == value
when either 'getattr( value, trait_name )' is changed or when 'value' is renamed within 'self.context_data'. An odd consequence of this is that a dynamically bound value can't be stored under multiple names simultaneously.
Assumes the 'value' and 'getattr( value, trait_name )' domains are disjoint and hashable. (A convenient and probably acceptable restriction.)
See the unit tests for more details.
NOTE: A context with dynamic bindings is (arguably) no longer a dictionary because it might violate substitutability. Consider:
d['a'] = x d['b'] = x assert 'a' in d and 'b' in d
Although we have no set of "mapping object axioms" specifying minimal behavior, I think most users would expect the above assert to always hold for mapping objects, but it can fail if 'd' is a numeric context with a dynamic binding for 'x'.
- contains_context(self, context)
Returns whether a context contains a specified context in its pipeline.
- context_group_for(self, name, names = None)
Gets/Sets the contents of a specified context group.
- create_context(self, mode)
Creates a new context of the specified type (if necessary).
- dump_context(self, indent = 0)
- get_context_base(self)
Returns the context base any upstream contexts should use.
- get_context_data(self, name)
Returns the value of a specified item.
- get_context_undefined(self, name, value)
Gets the value of a currently undefined item.
- hook_context(self, context)
Hooks a context into the pipeline (if necessary).
- insert_context(self, context)
Inserts a new context before this context.
- iteritems(self, *a, **kw)
- keys(self)
- remove_context(self, context)
Removes a specified context from a context chain.
- set_context_data(self, name, value)
Sets the value of a specified item.
- set_context_undefined(self, name, value)
Sets the value of a currently undefined item.