|
305 | 305 |
|
306 | 306 | from __future__ import annotations
|
307 | 307 |
|
308 |
| -from typing import TYPE_CHECKING |
| 308 | +from typing import TYPE_CHECKING, Optional, Union |
309 | 309 |
|
310 | 310 | from sage.manifolds.chart import Chart
|
311 | 311 | from sage.manifolds.differentiable.tensorfield import TensorField
|
|
315 | 315 | from sage.tensor.modules.free_module_tensor import FreeModuleTensor
|
316 | 316 |
|
317 | 317 | if TYPE_CHECKING:
|
| 318 | + from sage.manifolds.differentiable.diff_map import DiffMap |
| 319 | + from sage.manifolds.differentiable.manifold import DifferentiableManifold |
| 320 | + from sage.symbolic.expression import Expression |
318 | 321 | from sage.tensor.modules.comp import Components
|
319 | 322 |
|
| 323 | + |
320 | 324 | class TensorFieldParal(FreeModuleTensor, TensorField):
|
321 | 325 | r"""
|
322 | 326 | Tensor field along a differentiable manifold, with values on a
|
@@ -713,7 +717,7 @@ def _init_derived(self):
|
713 | 717 | self._extensions_graph = {self._domain: self}
|
714 | 718 | self._restrictions_graph = {self._domain: self}
|
715 | 719 |
|
716 |
| - def _del_derived(self, del_restrictions=True): |
| 720 | + def _del_derived(self, del_restrictions: bool = True): |
717 | 721 | r"""
|
718 | 722 | Delete the derived quantities.
|
719 | 723 |
|
@@ -1517,7 +1521,7 @@ def paral_lie_deriv(a, b , coord_frame, chart_cp, local_list_ind):
|
1517 | 1521 |
|
1518 | 1522 | lie_der = lie_derivative
|
1519 | 1523 |
|
1520 |
| - def restrict(self, subdomain, dest_map=None): |
| 1524 | + def restrict(self, subdomain: DifferentiableManifold, dest_map: Optional[DiffMap] = None): |
1521 | 1525 | r"""
|
1522 | 1526 | Return the restriction of ``self`` to some subdomain.
|
1523 | 1527 |
|
@@ -1746,7 +1750,7 @@ def __call__(self, *args):
|
1746 | 1750 | # Call of the FreeModuleTensor version
|
1747 | 1751 | return FreeModuleTensor.__call__(self_r, *args_r)
|
1748 | 1752 |
|
1749 |
| - def contract(self, *args): |
| 1753 | + def contract(self, *args: Union[int, TensorField]) -> TensorFieldParal: |
1750 | 1754 | r"""
|
1751 | 1755 | Contraction with another tensor field, on one or more indices.
|
1752 | 1756 |
|
@@ -2265,7 +2269,7 @@ def along(self, mapping):
|
2265 | 2269 | comp_resu._comp[ind] = val_resu
|
2266 | 2270 | return resu
|
2267 | 2271 |
|
2268 |
| - def series_expansion(self, symbol, order): |
| 2272 | + def series_expansion(self, symbol: Expression, order: int) -> list[TensorFieldParal]: |
2269 | 2273 | r"""
|
2270 | 2274 | Expand the tensor field in power series with respect to a small
|
2271 | 2275 | parameter.
|
@@ -2410,7 +2414,7 @@ def truncate(self, symbol, order):
|
2410 | 2414 | series = self.series_expansion(symbol, order)
|
2411 | 2415 | return sum(symbol**i * s for i, s in enumerate(series))
|
2412 | 2416 |
|
2413 |
| - def set_calc_order(self, symbol, order, truncate=False): |
| 2417 | + def set_calc_order(self, symbol: Expression, order: int, truncate: bool = False): |
2414 | 2418 | r"""
|
2415 | 2419 | Trigger a power series expansion with respect to a small parameter in
|
2416 | 2420 | computations involving the tensor field.
|
|
0 commit comments