@@ -66,6 +66,11 @@ def is_float(string):
6666class RuntimeParameters :
6767
6868 def __init__ (self ):
69+ """
70+ Initialize a collection of runtime parameters. This class
71+ holds a dictionary of the parameters, their comments, and keeps
72+ track of which parameters were actually used.
73+ """
6974
7075 # keep track of the parameters and their comments
7176 self .params = {}
@@ -77,8 +82,18 @@ def __init__ (self):
7782
7883 def load_params (self , file , no_new = 0 ):
7984 """
80- reads lines from file and makes dictionary pairs from the data
81- to store in self.params
85+ Reads line from file and makes dictionary pairs from the data
86+ to store.
87+
88+ Parameters
89+ ----------
90+ file : str
91+ The name of the file to parse
92+ no_new : int, optional
93+ If no_new = 1, then we don't add any new paramters to the
94+ dictionary of runtime parameters, but instead just override
95+ the values of existing ones.
96+
8297 """
8398
8499 # check to see whether the file exists
@@ -142,6 +157,12 @@ def command_line_params(self, cmd_strings):
142157 we expect things in the string in the form:
143158 ["sec.opt=value", "sec.opt=value"]
144159 with each opt an element in the list
160+
161+ Parameters
162+ ----------
163+ cmd_strings : list
164+ The list of strings containing runtime parameter pairs
165+
145166 """
146167
147168 for item in cmd_strings :
@@ -185,14 +206,17 @@ def get_param(self, key):
185206
186207 def print_unused_params (self ):
187208 """
188- print out the list of parameters that were defined by never used
209+ Print out the list of parameters that were defined by never used
189210 """
190211 for key in self .params .keys ():
191212 if not key in self .used_params :
192213 msg .warning ("parameter %s never used" % (key ))
193214
194215
195216 def print_all_params (self ):
217+ """
218+ Print out all runtime parameters and their values
219+ """
196220 keys = self .params .keys ()
197221 keys .sort ()
198222
@@ -203,6 +227,11 @@ def print_all_params(self):
203227
204228
205229 def print_paramfile (self ):
230+ """
231+ Create a file, inputs.auto, that has the structure of a pyro
232+ inputs file, with all known parameters and values
233+ """
234+
206235 keys = self .params .keys ()
207236 keys .sort ()
208237
0 commit comments