AttrWalker#
- class sunpy.net.attr.AttrWalker[source]#
Bases:
objectTraverse the Attr tree and convert it to a different representation.
The
AttrWalkercan walk a complex tree of attrs and represent that tree in a way that is useful to the client using the attrs. For the VSO client it generates aVSOQueryResponseTable.The walker has three core operations that can be applied to the tree, all of these are functions which are applied to one or more
Attrtypes, using conditional dispatch based on type.creators: Creators when given an
Attrreturn a new object.appliers: Appliers process an
Attrtype and modify any arguments passed.converters: Converters convert types unknown to any other creator or appliers to types known by them. They take in an
Attrtype and return a different one.
Methods Summary
add_applier(*types)Register all specified types with this function for the
.applymethod.add_converter(*types)Register a function to convert the specified type into a known type for create and apply.
add_creator(*types)Register all specified types with this function for the
.createmethod.apply(*args, **kwargs)Call the apply function(s) matching the arguments to this method.
create(*args, **kwargs)Call the create function(s) matching the arguments to this method.
Methods Documentation
- add_converter(*types)[source]#
Register a function to convert the specified type into a known type for create and apply.
After a converter is run, create or apply will be called again with the new types.