Skip to content

Commit aa30bf8

Browse files
committed
tidy type hints in function.py
1 parent fc16a86 commit aa30bf8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

firedrake/function.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from numbers import Number
1515
from pathlib import Path
1616
from functools import partial
17-
from typing import Tuple
17+
from typing import Tuple, Optional
1818

1919
from pyop2 import op2, mpi
2020
from pyop2.exceptions import DataTypeError, DataValueError
@@ -362,7 +362,7 @@ def function_space(self):
362362
@PETSc.Log.EventDecorator()
363363
def interpolate(self,
364364
expression: ufl.classes.Expr,
365-
ad_block_tag: str | None = None,
365+
ad_block_tag: Optional[str] = None,
366366
**kwargs):
367367
"""Interpolate an expression onto this :class:`Function`.
368368
@@ -697,13 +697,13 @@ def __init__(self, domain, point):
697697
self.point = point
698698

699699
def __str__(self):
700-
return "domain %s does not contain point %s" % (self.domain, self.point)
700+
return f"Domain {self.domain} does not contain point {self.point}"
701701

702702

703703
class PointEvaluator:
704704
r"""Convenience class for evaluating a :class:`Function` at a set of points."""
705705

706-
def __init__(self, mesh: MeshGeometry, points: np.ndarray | list, tolerance: float | None = None,
706+
def __init__(self, mesh: MeshGeometry, points: np.ndarray | list, tolerance: Optional[float] = None,
707707
missing_points_behaviour: str = "error", redundant: bool = True) -> None:
708708
r"""
709709
Parameters
@@ -712,7 +712,7 @@ def __init__(self, mesh: MeshGeometry, points: np.ndarray | list, tolerance: flo
712712
The mesh on which to embed the points.
713713
points : numpy.ndarray | list
714714
Array or list of points to evaluate at.
715-
tolerance : float | None
715+
tolerance : Optional[float]
716716
Tolerance to use when checking if a point is in a cell.
717717
If ``None`` (the default), the ``tolerance`` of the ``mesh`` is used.
718718
missing_points_behaviour : str

0 commit comments

Comments
 (0)