mpas_analysis.configuration.MpasAnalysisConfigParser.getExpression

MpasAnalysisConfigParser.getExpression(section, option, elementType=None, usenumpyfunc=False)[source]

Get an option as an expression (typically a list, though tuples and dicts are also availabe). The expression is required to have valid python syntax, so that string entries are required to be in single or double quotes.

Parameters
  • section (str) – The section in the config file

  • option (str) – The option in the config file

  • elementType ((bool, int, float, etc.), optional) – If supplied, each element in a list or tuple, or each value in a dictionary are cast to this type. This is likely most useful for ensuring that all elements in a list of numbers are of type float, rather than int, when the distinction is important.

  • usenumpyfunc (bool, optional) – If True, the expression is evaluated including functionality from the numpy package (which can be referenced either as numpy or np).