Skip to content
Snippets Groups Projects
Commit dbcec037 authored by Matt Smith's avatar Matt Smith
Browse files

add back return type hints

parent 2e6b66c8
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ THE SOFTWARE.
from numbers import Number
from functools import reduce
from typing import Any
from arraycontext import make_loopy_program
......@@ -75,7 +76,7 @@ import grudge.dof_desc as dof_desc
# {{{ Nodal reductions
def _norm(dcoll: DiscretizationCollection, vec, p, dd):
def _norm(dcoll: DiscretizationCollection, vec, p, dd) -> Any:
if isinstance(vec, Number):
return np.fabs(vec)
if p == 2:
......@@ -94,7 +95,7 @@ def _norm(dcoll: DiscretizationCollection, vec, p, dd):
raise NotImplementedError("Unsupported value of p")
def norm(dcoll: DiscretizationCollection, vec, p, dd=None):
def norm(dcoll: DiscretizationCollection, vec, p, dd=None) -> Any:
r"""Return the vector p-norm of a function represented
by its vector of degrees of freedom *vec*.
......@@ -130,7 +131,7 @@ def norm(dcoll: DiscretizationCollection, vec, p, dd=None):
return _norm(dcoll, vec, p, dd)
def nodal_sum(dcoll: DiscretizationCollection, dd, vec):
def nodal_sum(dcoll: DiscretizationCollection, dd, vec) -> Any:
r"""Return the nodal sum of a vector of degrees of freedom *vec*.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc`, or a value
......@@ -150,7 +151,7 @@ def nodal_sum(dcoll: DiscretizationCollection, dd, vec):
comm.allreduce(actx.to_numpy(nodal_sum_loc(dcoll, dd, vec)), op=MPI.SUM))
def nodal_sum_loc(dcoll: DiscretizationCollection, dd, vec):
def nodal_sum_loc(dcoll: DiscretizationCollection, dd, vec) -> Any:
r"""Return the rank-local nodal sum of a vector of degrees of freedom *vec*.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc`, or a value
......@@ -178,7 +179,7 @@ def nodal_sum_loc(dcoll: DiscretizationCollection, dd, vec):
return sum([device_sum(grp_ary) for grp_ary in vec])
def nodal_min(dcoll: DiscretizationCollection, dd, vec):
def nodal_min(dcoll: DiscretizationCollection, dd, vec) -> Any:
r"""Return the nodal minimum of a vector of degrees of freedom *vec*.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc`, or a value
......@@ -198,7 +199,7 @@ def nodal_min(dcoll: DiscretizationCollection, dd, vec):
comm.allreduce(actx.to_numpy(nodal_min_loc(dcoll, dd, vec)), op=MPI.MIN))
def nodal_min_loc(dcoll: DiscretizationCollection, dd, vec):
def nodal_min_loc(dcoll: DiscretizationCollection, dd, vec) -> Any:
r"""Return the rank-local nodal minimum of a vector of degrees
of freedom *vec*.
......@@ -232,7 +233,7 @@ def nodal_min_loc(dcoll: DiscretizationCollection, dd, vec):
vec, as_device_scalar(np.inf))
def nodal_max(dcoll: DiscretizationCollection, dd, vec):
def nodal_max(dcoll: DiscretizationCollection, dd, vec) -> Any:
r"""Return the nodal maximum of a vector of degrees of freedom *vec*.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc`, or a value
......@@ -252,7 +253,7 @@ def nodal_max(dcoll: DiscretizationCollection, dd, vec):
comm.allreduce(actx.to_numpy(nodal_max_loc(dcoll, dd, vec)), op=MPI.MAX))
def nodal_max_loc(dcoll: DiscretizationCollection, dd, vec):
def nodal_max_loc(dcoll: DiscretizationCollection, dd, vec) -> Any:
r"""Return the rank-local nodal maximum of a vector of degrees
of freedom *vec*.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment