Commit 289330bf authored by Tim Keil's avatar Tim Keil
Browse files

[models] fix doc strings

parent 30503b0c
Pipeline #69808 passed with stages
in 35 minutes and 13 seconds
......@@ -104,6 +104,9 @@ class StationaryModel(Model):
Internal model state for the given |Parameter value|
mu
|Parameter value| for which to compute the gradient
return_array
if `True`, return the output gradient as a |NumPy array|.
Otherwise, return a dict of gradients for each |Parameter|.
use_adjoint
if `None` use standard approach, if `True`, use
the adjoint solution for a more efficient way of computing the gradient.
......@@ -112,7 +115,7 @@ class StationaryModel(Model):
Returns
-------
The gradient as a numpy array.
The gradient as a |NumPy array| or a dict of |NumPy arrays|.
"""
if not use_adjoint:
return super()._compute_output_d_mu(solution, mu, return_array)
......
......@@ -161,10 +161,13 @@ class Model(CacheableObject, ParametricObject):
Internal model state for the given |Parameter value|.
mu
|Parameter value| for which to compute the gradient
return_array
if `True`, return the output gradient as a |NumPy array|.
Otherwise, return a dict of gradients for each |Parameter|.
Returns
-------
The gradient as a numpy array
The gradient as a |NumPy array| or a dict of |NumPy arrays|.
"""
U_d_mus = self._compute_solution_d_mu(solution, mu)
gradients = [] if return_array else {}
......@@ -292,8 +295,8 @@ class Model(CacheableObject, ParametricObject):
output_error_estimate
If `True`, return an error estimate for the computed output.
output_d_mu_return_array
if `True`, return the output of :meth:`_compute_output_d_mu` as a |Numpy array|,
otherwise, return it as a dict w.r.t. to the parameters.
if `True`, return the output gradient as a |NumPy array|.
Otherwise, return a dict of gradients for each |Parameter|.
mu
|Parameter values| for which to compute the values.
kwargs
......@@ -490,12 +493,12 @@ class Model(CacheableObject, ParametricObject):
mu
|Parameter value| for which to compute the gradient
return_array
if `True`, returning a |NumPy array| and if `False`, returning
a dict w.r.t. to the parameters
if `True`, return the output gradient as a |NumPy array|.
Otherwise, return a dict of gradients for each |Parameter|.
Returns
-------
The gradient as a |NumPy array| or a dict.
The gradient as a |NumPy array| or a dict of |NumPy arrays|.
"""
data = self.compute(
output_d_mu=True,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment