Skip to content

Commit d67bdae

Browse files
authored
Merge pull request #2703 from devitocodes/arith-doc
docs: fix mmin/mmax docstring
2 parents 2a54890 + e524545 commit d67bdae

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

devito/builtins/arithmetic.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,21 +180,25 @@ def inner(f, g):
180180
return f.dtype(n.data[0])
181181

182182

183+
red_doc = lambda func: f"""
184+
Retrieve the {func}imum.
185+
186+
Parameters
187+
----------
188+
f : array_like or Function
189+
Input operand.
190+
"""
191+
192+
183193
mmin = lambda f: _reduce_func(f, np.min, dv.mpi.MPI.MIN)
194+
mmin.__doc__ = red_doc('min')
184195
mmax = lambda f: _reduce_func(f, np.max, dv.mpi.MPI.MAX)
196+
mmax.__doc__ = red_doc('max')
185197

186198

187199
@dv.switchconfig(log_level='ERROR')
188200
@check_builtins_args
189201
def _reduce_func(f, func, mfunc):
190-
"""
191-
Retrieve the maximum.
192-
193-
Parameters
194-
----------
195-
f : array_like or Function
196-
Input operand.
197-
"""
198202
if isinstance(f, dv.Constant):
199203
return f.data
200204
elif isinstance(f, dv.types.dense.DiscreteFunction):

0 commit comments

Comments
 (0)