14
14
from numbers import Number
15
15
from pathlib import Path
16
16
from functools import partial
17
- from typing import Tuple
17
+ from typing import Tuple , Optional
18
18
19
19
from pyop2 import op2 , mpi
20
20
from pyop2 .exceptions import DataTypeError , DataValueError
@@ -362,7 +362,7 @@ def function_space(self):
362
362
@PETSc .Log .EventDecorator ()
363
363
def interpolate (self ,
364
364
expression : ufl .classes .Expr ,
365
- ad_block_tag : str | None = None ,
365
+ ad_block_tag : Optional [ str ] = None ,
366
366
** kwargs ):
367
367
"""Interpolate an expression onto this :class:`Function`.
368
368
@@ -697,13 +697,13 @@ def __init__(self, domain, point):
697
697
self .point = point
698
698
699
699
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 } "
701
701
702
702
703
703
class PointEvaluator :
704
704
r"""Convenience class for evaluating a :class:`Function` at a set of points."""
705
705
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 ,
707
707
missing_points_behaviour : str = "error" , redundant : bool = True ) -> None :
708
708
r"""
709
709
Parameters
@@ -712,7 +712,7 @@ def __init__(self, mesh: MeshGeometry, points: np.ndarray | list, tolerance: flo
712
712
The mesh on which to embed the points.
713
713
points : numpy.ndarray | list
714
714
Array or list of points to evaluate at.
715
- tolerance : float | None
715
+ tolerance : Optional[ float]
716
716
Tolerance to use when checking if a point is in a cell.
717
717
If ``None`` (the default), the ``tolerance`` of the ``mesh`` is used.
718
718
missing_points_behaviour : str
0 commit comments