GraphData
GraphData encapsulates input data for the DIRAC Graphs plots
The DIRAC Graphs package is derived from the GraphTool plotting package of the CMS/Phedex Project by … <to be added>
- class DIRAC.Core.Utilities.Graphs.GraphData.GraphData(data={})
Bases:
object
- __init__(data={})
- expandKeys()
- getLabels()
Get the graph labels together with the numeric values used for the label sorting
- getNumberOfKeys()
- getNumberOfLabels()
- getPlotNumData(label=None, zipFlag=True)
Get the plot data in a numeric form
- getStatString(unit=None)
Get a string summarizing the graph data statistics
- getStats()
Get statistics of the graph data
- getStringMap()
Get string to number mapping for numeric type keys
- initialize(key_type=None)
- isEmpty()
Check if there is no data inserted
- isSimplePlot()
- makeCumulativeGraph()
Prepare data for the cumulative graph
- makeNumKeys()
Make numerical representation of the graph keys suitable for plotting
- setData(data)
Add data to the GraphData object
- sortKeys()
Sort the graph keys in a natural order
- sortLabels(sort_type='max_value', reverse_order=False)
Sort labels with a specified method: alpha - alphabetic order max_value - by max value of the subplot sum - by the sum of values of the subplot last_value - by the last value in the subplot avg_nozeros - by an average that excludes all zero values
- truncateLabels(limit=10)
Truncate the number of labels to the limit, leave the most important ones, accumulate the rest in the ‘Others’ label
- class DIRAC.Core.Utilities.Graphs.GraphData.PlotData(data, single=True, key_type=None)
Bases:
object
PlotData class is a container for a one dimensional plot data
- __init__(data, single=True, key_type=None)
- expandKeys(all_keys)
Fill zero values into the missing keys
- getKeys()
- getMaxValue()
- getMinValue()
- getNumKeys()
- getPlotData()
- getPlotDataForNumKeys(num_keys, zeroes=False)
- getPlotErrors()
- getPlotNumData()
- getValues()
- initialize()
- makeCumulativePlot()
- parseData(key_type=None)
Parse all the data values passed to the graph. For this super class, basically does nothing except loop through all the data. A sub-class should override the parseDatum and parse_pivot functions rather than this one.
- parseDatum(data)
Parse the specific data value; this is the identity.
- parseKey(key)
Parse the name of the pivot; this is the identity function.
- sortKeys(sort_type='alpha')
Sort keys according to the specified method : alpha - sort in alphabetic order weight - sort in the order of values
- DIRAC.Core.Utilities.Graphs.GraphData.get_key_type(keys)
A utility function to guess the type of the plot keys