22
33# Config files
44
5- The primary documentation for the config parser is in
6- [ MPAS-Tools config parser ] ( http ://mpas-dev .github.io/MPAS-Tools/stable/config.html ) .
5+ The primary documentation for the config parser is in the
6+ [ tranche documentation ] ( https ://xylar .github.io/tranche/ ) .
77Here, we include some specific details relevant to using the
8- {py: class }` mpas_tools.config.MpasConfigParser ` in polaris.
8+ {py: class }` tranche.Tranche ` in polaris.
99
1010Here, we provide the {py: class }` polaris.config.PolarisConfigParser ` that has
1111almost the same functionality but also ensures that certain relative paths are
@@ -18,7 +18,7 @@ options) as part of setting up polaris tasks and steps. These features are
1818included to accommodate sharing config options across shared steps and/or
1919multiple tasks.
2020
21- The {py: meth }` mpas_tools.config.MpasConfigParser .add_from_package()` method can
21+ The {py: meth }` tranche.Tranche .add_from_package()` method can
2222be used to add the contents of a config file within a package to the config
2323options. Examples of this can be found in many tasks as well as in the
2424` polaris.setup ` module. Here is a typical example from
@@ -71,11 +71,12 @@ for use by the framework rather than individual tasks.
7171Other methods for the ` MpasConfigParser ` are similar to those for
7272{py: class }` configparser.ConfigParser ` . In addition to ` get() ` ,
7373` getinteger() ` , ` getfloat() ` and ` getboolean() ` methods, this class
74- implements {py: meth }` mpas_tools.config.MpasConfigParser .getlist()` , which
74+ implements {py: meth }` tranche.Tranche .getlist()` , which
7575can be used to parse a config value separated by spaces and/or commas into
76- a list of strings, floats, integers, booleans, etc. Another useful method
77- is {py: meth }` mpas_tools.config.MpasConfigParser.getexpression() ` , which can
78- be used to get python dictionaries, lists and tuples as well as a small set
76+ a list of strings, floats, integers, booleans, etc. Other useful methods
77+ are {py: meth }` tranche.Tranche.getexpression() ` , which can
78+ be used to get python dictionaries, lists, and tuples, and
79+ {py: meth }` tranche.Tranche.getnumpy() ` , which also suppports a small set
7980of functions (` range() ` , {py: meth }` numpy.linspace() ` ,
8081{py: meth }` numpy.arange() ` , and {py: meth }` numpy.array() ` )
8182
@@ -182,9 +183,10 @@ class Rpe(Task):
182183
183184## Comments in config files
184185
185- One of the main advantages of {py: class }` mpas_tools.config.MpasConfigParser `
186+ One of the main advantages of {py: class }` tranche.Tranche `
186187over {py: class }` configparser.ConfigParser ` is that it keeps track of comments
187188that are associated with config sections and options.
188189
189- See [ comments in config files] ( http://mpas-dev.github.io/MPAS-Tools/stable/config.html#config_comments )
190- in MPAS-Tools for more details.
190+ Comments must begin with the ` # ` character. They must be placed * before* the
191+ config section or option in question (preferably without blank lines between).
192+ The comments can be any number of lines long.
0 commit comments