cape.pyover.options.util: Utilities for pyOver options module

This module provides tools to read, access, modify, and write settings for cape.pyover. It is based off of the cape.cfdx.options.util module and provides a special class cape.cfdx.options.odict that is subclassed from the Python built-in dict. Behavior, such as opts['OverNamelist'] or opts.get('OverNamelist') are also present. In addition, many convenience methods such as opts.get_OverNamelist() are provided.

In addition, this module controls default values of each pyOver parameter in a three-step process. The precedence used to determine what the value of a given parameter should be is below.

  1. Values directly specified in the input file, pyOver.json

  2. Values specified in the default control file, $PYOVER/settings/pyOver.default.json

  3. Hard-coded defaults from this module

See Also:
cape.pyover.options.util.getPyOverDefaults()

Read pyOver.default.json default settings file

Call:
>>> defs = getPyOverDefaults()
Outputs:
defs: dict

Dictionary of settings read from JSON file

Versions:
  • 2015-12-29 @ddalle: Version 1.0 (OVERFLOW version)

  • 2021-03-01 @ddalle: Version 2.0; local settings

cape.pyover.options.util.rc0(p)

Get default from cape.pyover.options.rc; ensure a scalar

Call:
>>> v = rc0(s)
Inputs:
s: str

Name of parameter to extract

Outputs:
v: any

Either rc[s] or rc[s][0], whichever is appropriate

Versions:
  • 2014-08-01 @ddalle: First version