class DataContext(ListenableMixin, PersistableMixin, DictMixin): (source)
Known subclasses: codetools.contexts.adapted_data_context.AdaptedDataContext
, codetools.contexts.function_filter_context.FunctionFilterContext
, codetools.contexts.geo_context.GeoContext
, codetools.contexts.name_filter_context.NameFilterContext
, codetools.contexts.tests.data_context_test_case.RestrictedKeys
, codetools.contexts.tests.data_context_test_case.RestrictedValues
A simple context which fires events.
Method | __contains__ |
Undocumented |
Method | __delitem__ |
Undocumented |
Method | __eq__ |
Don't allow objects of different classes to be equal. |
Method | __getitem__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | __ne__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __setitem__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | allows |
Determines whether this value is allowed in this context. Only strings are allowed for 'name'. |
Method | checkpoint |
Make a shallow copy of the context. |
Method | keys |
Returns the list of keys available in the context. |
Class Variable | name |
Undocumented |
Class Variable | subcontext |
Undocumented |
Inherited from ListenableMixin
:
Method | deferred |
Context manager that sets defer_events to False |
Instance Variable | defer |
Undocumented |
Method | _add |
Defer this event. |
Method | _defer |
Undocumented |
Method | _defer |
Undocumented |
Method | _fire |
Fire an ItemsModifiedEvent. |
Class Variable | _deferred |
Undocumented |
Inherited from PersistableMixin
:
Static Method | load |
Unpickle the context from a file |
Method | save |
Pickle the data context out to a file |
Don't allow objects of different classes to be equal. This will allow different instances with different names but the same keys and values to be equal. Subclasses may wish to override this to compare different attributes.
codetools.contexts.adapted_data_context.AdaptedDataContext
, codetools.contexts.function_filter_context.FunctionFilterContext
, codetools.contexts.geo_context.GeoContext
, codetools.contexts.name_filter_context.NameFilterContext
, codetools.contexts.tests.data_context_test_case.RestrictedKeys
, codetools.contexts.tests.data_context_test_case.RestrictedValues
Determines whether this value is allowed in this context. Only strings are allowed for 'name'. Typically, this is used to limit the types of objects allowed into the context. It could also be used to restrict specific values (ie. the shape of an array) and even on the name... Parameters ---------- value : object name : str, optional Returns ------- allowed : bool
Make a shallow copy of the context. Technically, this is actually a fairly deep copy. All of the object structure should be replicated, but the actual dictionary storage will be shallowly copied:: copy = context.shallow_copy() copy[key] is context[key] for key in context.keys() These semantics are useful for saving out checkpointed versions of the context for implementing an undo/redo stack. They may not be useful for other purposes. Returns ------- copy : IContext