SG++
python.uq.jsonLib Namespace Reference

Functions

def parseAttribute (attrValue, attrName)
 
def parseKeyAsTuple (d)
 
def reprBool (attrValue)
 
def reprDict (attrValue)
 
def reprFloat (attrValue)
 
def reprInt (attrValue)
 
def reprKey (attrValue)
 
def reprList (attrValue)
 
def reprString (attrValue)
 
def reprTuple (attrValue)
 
def reprVal (attrValue)
 
def stringToList (s, f=float)
 
def stringToListOfLists (s, f=float)
 
def stringToTupleOfFloats (s)
 

Function Documentation

def python.uq.jsonLib.parseAttribute (   attrValue,
  attrName 
)
Parses a single class attribute to the correspondent string
representation in json.
@param attrValue: value of the attribute
@param attrName: name of the attribute
@return: json string equivalence

References python.uq.jsonLib.reprString(), and python.uq.jsonLib.reprVal().

def python.uq.jsonLib.parseKeyAsTuple (   d)
Converts the string representation of a dict to an actual dict
@param d: dictionary

References python.uq.jsonLib.stringToTupleOfFloats().

def python.uq.jsonLib.reprBool (   attrValue)
def python.uq.jsonLib.reprDict (   attrValue)
def python.uq.jsonLib.reprFloat (   attrValue)
def python.uq.jsonLib.reprInt (   attrValue)
def python.uq.jsonLib.reprKey (   attrValue)
def python.uq.jsonLib.reprList (   attrValue)
def python.uq.jsonLib.reprString (   attrValue)
def python.uq.jsonLib.reprTuple (   attrValue)
def python.uq.jsonLib.reprVal (   attrValue)
Computes a string representation of attrValue that is
valid json. Supported are:
1) boolean
2) integer
3) dictionary
4) float
5) list, np.ndarray
6) tuple
7) string
8) DataVector
9) objects with ".toJson" method
10) objects with ".serialize" method
@param attrValue: arbitrary object

References python.uq.jsonLib.reprBool(), python.uq.jsonLib.reprDict(), python.uq.jsonLib.reprFloat(), python.uq.jsonLib.reprInt(), python.uq.jsonLib.reprList(), python.uq.jsonLib.reprString(), and python.uq.jsonLib.reprTuple().

Referenced by python.uq.jsonLib.parseAttribute(), python.uq.jsonLib.reprDict(), python.uq.jsonLib.reprList(), and python.uq.jsonLib.reprTuple().

def python.uq.jsonLib.stringToList (   s,
  f = float 
)
def python.uq.jsonLib.stringToListOfLists (   s,
  f = float 
)
def python.uq.jsonLib.stringToTupleOfFloats (   s)
Converts s to a tuple
@param s: string
@return: tuple represented by s

References sgpp::combigrid.split().

Referenced by python.uq.jsonLib.parseKeyAsTuple().