Skip to content

Commit 39178a6

Browse files
committed
add 'The' to docstrings
1 parent 9e205d7 commit 39178a6

File tree

2 files changed

+85
-84
lines changed

2 files changed

+85
-84
lines changed

src/diffpy/srfit/fitbase/fitrecipe.py

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -134,41 +134,41 @@ class FitRecipe(_fitrecipe_interface, RecipeOrganizer):
134134
name : str
135135
A name for this FitRecipe.
136136
fithooks : list
137-
List of FitHook instances that can pass information out
137+
The list of FitHook instances that can pass information out
138138
of the system during a refinement. By default, this is
139139
populated by a PrintFitHook instance.
140140
_constraints : dict
141-
A dictionary of Constraints, indexed by the constrained
141+
The dictionary of Constraints, indexed by the constrained
142142
Parameter. Constraints can be added using the
143143
'constrain' method.
144144
_oconstraints : list
145-
An ordered list of the constraints from this and all
145+
The ordered list of the constraints from this and all
146146
sub-components.
147147
_calculators : dict
148-
A managed dictionary of Calculators.
148+
The managed dictionary of Calculators.
149149
_contributions : OrderedDict
150-
A managed OrderedDict of FitContributions.
150+
The managed OrderedDict of FitContributions.
151151
_parameters : OrderedDict
152-
A managed OrderedDict of parameters (in this case the
152+
The managed OrderedDict of parameters (in this case the
153153
parameters are varied).
154154
_parsets : dict
155-
A managed dictionary of ParameterSets.
155+
The managed dictionary of ParameterSets.
156156
_eqfactory : diffpy.srfit.equation.builder.EquationFactory
157-
A diffpy.srfit.equation.builder.EquationFactory
157+
The diffpy.srfit.equation.builder.EquationFactory
158158
instance that is used to create constraints and
159159
restraints from strings.
160160
_restraintlist : list
161-
A list of restraints from this and all sub-components.
161+
The list of restraints from this and all sub-components.
162162
_restraints : set
163-
A set of Restraints. Restraints can be added using the
163+
The set of Restraints. Restraints can be added using the
164164
'restrain' or 'confine' methods.
165165
_ready : bool
166-
A flag indicating if all attributes are ready for the
166+
The flag indicating if all attributes are ready for the
167167
calculation.
168168
_tagmanager : TagManager
169-
A TagManager instance for managing tags on Parameters.
169+
The TagManager instance for managing tags on Parameters.
170170
_weights : list
171-
List of weighing factors for each FitContribution. The
171+
The list of weighing factors for each FitContribution. The
172172
weights are multiplied by the residual of the
173173
FitContribution when determining the overall residual.
174174
_fixedtag : str
@@ -178,17 +178,17 @@ class FitRecipe(_fitrecipe_interface, RecipeOrganizer):
178178
Properties
179179
----------
180180
names : list
181-
Variable names (read only). See get_names.
181+
The variable names (read only). See get_names.
182182
values : numpy.ndarray
183-
Variable values (read only). See get_values.
183+
The variable values (read only). See get_values.
184184
fixednames : list
185-
Names of the fixed refinable variables (read only).
185+
The names of the fixed refinable variables (read only).
186186
fixedvalues : numpy.ndarray
187-
Values of the fixed refinable variables (read only).
187+
The values of the fixed refinable variables (read only).
188188
bounds : list of tuple
189-
Bounds on parameters (read only). See get_bounds_pairs.
189+
The bounds on parameters (read only). See get_bounds_pairs.
190190
bounds2 : tuple of numpy.ndarray
191-
Bounds on parameters (read only). See get_bounds_array.
191+
The bounds on parameters (read only). See get_bounds_array.
192192
"""
193193

194194
fixednames = property(
@@ -272,9 +272,9 @@ def push_fit_hook(self, fithook, index=None):
272272
Parameters
273273
----------
274274
fithook : diffpy.srfit.fitbase.fithook.FitHook
275-
FitHook instance to add to the sequence.
275+
The FitHook instance to add to the sequence.
276276
index : int or None, optional
277-
Index for inserting fithook into the list of fit hooks. If
277+
The index for inserting fithook into the list of fit hooks. If
278278
this is None (default), the fithook is added to the end.
279279
"""
280280
if index is None:
@@ -300,10 +300,10 @@ def pop_fit_hook(self, fithook=None, index=-1):
300300
Parameters
301301
----------
302302
fithook : diffpy.srfit.fitbase.fithook.FitHook or None, optional
303-
FitHook instance to remove from the sequence. If this is
303+
The FitHook instance to remove from the sequence. If this is
304304
None (default), default to index.
305305
index : int, optional
306-
Index of FitHook instance to remove (default -1).
306+
The index of FitHook instance to remove (default -1).
307307
308308
Raises
309309
------
@@ -720,21 +720,21 @@ def add_variable(
720720
Parameters
721721
----------
722722
par : diffpy.srfit.fitbase.Parameter
723-
A Parameter that will be varied during a fit.
723+
The Parameter that will be varied during a fit.
724724
value : float or None, optional
725-
An initial value for the variable. If this is None
725+
The initial value for the variable. If this is None
726726
(default), then the current value of par will be used.
727727
name : str or None, optional
728-
A name for this variable. If name is None (default), then
728+
The name for this variable. If name is None (default), then
729729
the name of the parameter will be used.
730730
fixed : bool, optional
731731
Fix the variable so that it does not vary (default False).
732732
tag : str or None, optional
733-
A tag for the variable. This can be used to retrieve, fix
733+
The tag for the variable. This can be used to retrieve, fix
734734
or free variables by tag (default None). Note that a
735735
variable is automatically tagged with its name and "all".
736736
tags : list of str, optional
737-
A list of tags (default []). Both tag and tags can be
737+
The list of tags (default []). Both tag and tags can be
738738
applied.
739739
740740
Returns
@@ -836,19 +836,19 @@ def create_new_variable(
836836
The name of the variable. The variable will be able to be
837837
used by this name in restraint and constraint equations.
838838
value : float or None, optional
839-
An initial value for the variable. If this is None
839+
The initial value for the variable. If this is None
840840
(default), then the variable will be given the value of the
841841
first non-None-valued Parameter constrained to it. If this
842842
fails, an error will be thrown when 'residual' is called.
843843
fixed : bool, optional
844844
Fix the variable so that it does not vary (default False).
845845
The variable will still be managed by the FitRecipe.
846846
tag : str or None, optional
847-
A tag for the variable. This can be used to fix and free
847+
The tag for the variable. This can be used to fix and free
848848
variables by tag (default None). Note that a variable is
849849
automatically tagged with its name and "all".
850850
tags : list of str, optional
851-
A list of tags (default []). Both tag and tags can be
851+
The list of tags (default []). Both tag and tags can be
852852
applied.
853853
854854
Returns
@@ -960,14 +960,14 @@ def fix(self, *args, **kw):
960960
961961
Parameters
962962
----------
963-
*args:
964-
Positional arguments specifying the parameters to fix. These
965-
can be parameter objects, their names as strings, or tags.
966-
The special string "all" can be used to select all
963+
*args : str or Parameter
964+
The positional arguments specifying the parameters to fix.
965+
These can be parameter objects, their names as strings, or
966+
tags. The special string "all" can be used to select all
967967
parameters.
968-
**kw:
969-
Keyword arguments where the keys are parameter names and the
970-
values are the values to assign to the corresponding
968+
**kw : dict
969+
The keyword arguments where the keys are parameter names and
970+
the values are the values to assign to the corresponding
971971
fixed parameters.
972972
973973
Raises
@@ -1020,14 +1020,14 @@ def free(self, *args, **kw):
10201020
Parameters
10211021
----------
10221022
*args : str or Parameter
1023-
Positional arguments specifying the parameters to free.
1023+
The positional arguments specifying the parameters to free.
10241024
These can be:
10251025
- Parameter objects
10261026
- Names of parameters (as strings)
10271027
- Tags associated with parameters (as strings)
10281028
- The string "all" to select all parameters.
10291029
**kw : dict
1030-
Keyword arguments specifying parameter names as keys and
1030+
The keyword arguments specifying parameter names as keys and
10311031
their values to assign after freeing. This is useful
10321032
for setting the value of a parameter while marking it as free.
10331033
@@ -1146,13 +1146,13 @@ def constrain(self, par, con, ns={}):
11461146
par : Parameter
11471147
The Parameter to constrain.
11481148
con : str or Parameter
1149-
A string representation of the constraint equation or a
1149+
The string representation of the constraint equation or a
11501150
Parameter to constrain to. A constraint equation must
11511151
consist of numpy operators and "known" Parameters.
11521152
Parameters are known if they are in the ns argument, or if
11531153
they are managed by this object.
11541154
ns : dict, optional
1155-
A dictionary of Parameters, indexed by name, that are used
1155+
The dictionary of Parameters, indexed by name, that are used
11561156
in the eqstr, but not part of this object (default {}).
11571157
11581158
Raises
@@ -1205,7 +1205,7 @@ def get_values(self):
12051205
-------
12061206
12071207
values_array : numpy.ndarray
1208-
An array containing the current values of all free
1208+
The array containing the current values of all free
12091209
variables in the fit recipe.
12101210
"""
12111211
values_array = array(
@@ -1230,7 +1230,7 @@ def get_names(self):
12301230
Returns
12311231
-------
12321232
parameter_names :list of str
1233-
A list containing the names of free variables.
1233+
The list containing the names of free variables.
12341234
"""
12351235
parameter_names = [
12361236
v.name for v in self._parameters.values() if self.is_free(v)
@@ -1251,7 +1251,7 @@ def get_bounds_pairs(self):
12511251
Returns
12521252
-------
12531253
bounds_pair_list : list of tuple of float
1254-
A list of ``(lower, upper)`` bounds on the variables, in the same
1254+
The list of ``(lower, upper)`` bounds on the variables, in the same
12551255
order as ``get_names`` and ``get_values``.
12561256
"""
12571257
return [v.bounds for v in self._parameters.values() if self.is_free(v)]
@@ -1272,10 +1272,10 @@ def get_bounds_array(self):
12721272
Returns
12731273
-------
12741274
lower_bounds : numpy.ndarray
1275-
A numpy array of lower bounds on the variables, in the same order
1275+
The numpy array of lower bounds on the variables, in the same order
12761276
as ``get_names`` and ``get_values``.
12771277
upper_bounds : numpy.ndarray
1278-
A numpy array of upper bounds on the variables, in the same order
1278+
The numpy array of upper bounds on the variables, in the same order
12791279
as ``get_names`` and ``get_values``.
12801280
"""
12811281
bounds = self.get_bounds_pairs()

0 commit comments

Comments
 (0)