sumolib.output
index
/build/buildd/sumo-0.17.1~dfsg/tools/sumolib/output/__init__.py

@file    __init__.py
@author  Michael Behrisch
@author  Jakob Erdmann
@date    2011-06-23
@version $Id: __init__.py 13811 2013-05-01 20:31:43Z behrisch $
 
Python interface to SUMO especially for parsing output files.
 
SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
Copyright (C) 2011-2013 DLR (http://www.dlr.de/) and contributors
All rights reserved

 
Package Contents
       
convert (package)
dump
inductionloop

 
Functions
       
average(elements, attrname)
compound_object(element_name, attrnames)
return a class which delegates attribute acces to a namedtuple instance and
bracket access to an internal dict. Missing attributes are deletegated to
the child dict for convenience
@note: Care must be taken when child nodes and attributes have the same names
iskeyword = __contains__(...)
x.__contains__(y) <==> y in x.
parse(xmlfile, element_names, element_attrs={}, attr_conversions={})
parses the given element_names from xmlfile and yield compound objects for
their xml subtrees (no extra objects are returned if element_names appear in
the subtree) The compound objects follow provide all element attributes of
the first read element as attributes unless attr_names are supplied. In this
case attr_names maps element names to a list of attributes which are
supplied. If attr_conversions is not empty it must map attribute names to
callables which will be called upon the attribute value before storing under
the attribute name (attribute names may be modified to avoid name clashes
with python keywords). 
The compound objects gives dictionary style access to list of compound
objects o for any children with the given element name 
o['child_element_name'] = [osub0, osub1, ...]
@Note: all elements with the same name must have the same type regardless of
the subtree in which they occur
parse_fast(xmlfile, element_name, attrnames, warn=False)
sum(elements, attrname)