Skip to content

Commit

Permalink
Update docstring links
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Dec 12, 2023
1 parent f413ce3 commit 7b3cf7e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion phiml/math/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Instead, they delegate the actual computation to either NumPy, TensorFlow or PyTorch, depending on the configuration.
This allows the user to write simulation code once and have it run with various computation backends.
See the documentation at https://tum-pbs.github.io/PhiML/Math.html
See the documentation at https://tum-pbs.github.io/PhiML/
"""

from ..backend._dtype import DType
Expand Down
4 changes: 2 additions & 2 deletions phiml/math/_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ def to_float(x: TensorOrTree) -> TensorOrTree:
The precision can be set globally using `math.set_global_precision()` and locally using `with math.precision()`.
See the `phiml.math` module documentation at https://tum-pbs.github.io/PhiML/Math.html
See the documentation at https://tum-pbs.github.io/PhiML/Data_Types.html
See Also:
`cast()`.
Expand Down Expand Up @@ -1982,7 +1982,7 @@ def to_complex(x: TensorOrTree) -> TensorOrTree:
The precision can be set globally using `math.set_global_precision()` and locally using `with math.precision()`.
See the `phiml.math` module documentation at https://tum-pbs.github.io/PhiML/Math.html
See the documentation at https://tum-pbs.github.io/PhiML/Data_Types.html
See Also:
`cast()`.
Expand Down
6 changes: 3 additions & 3 deletions phiml/math/_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, sizes: tuple, names: tuple, types: tuple, item_names: tuple):
self.sizes: tuple = sizes
"""
Ordered dimension sizes as `tuple`.
The size of a dimension can be an `int` or a `Tensor` for [non-uniform shapes](https://tum-pbs.github.io/PhiML/Math.html#non-uniform-tensors).
The size of a dimension can be an `int` or a `Tensor` for [non-uniform shapes](https://tum-pbs.github.io/PhiML/Non_Uniform.html).
See Also:
`Shape.get_size()`, `Shape.size`, `Shape.shape`.
Expand Down Expand Up @@ -539,7 +539,7 @@ def unstack(self, dim='dims') -> Tuple['Shape']:
The dimension listing the sizes of the shape is referred to as `'dims'`.
Non-uniform tensor shapes may be unstacked along other dimensions as well, see
https://tum-pbs.github.io/PhiML/Math.html#non-uniform-tensors
https://tum-pbs.github.io/PhiML/Non_Uniform.html
Args:
dim: dimension to unstack
Expand Down Expand Up @@ -833,7 +833,7 @@ def shape(self) -> 'Shape':
Higher-order `Shape`.
The returned shape will always contain the channel dimension `dims` with a size equal to the `Shape.rank` of this shape.
For uniform shapes, `Shape.shape` will only contain the dimension `dims` but the shapes of [non-uniform shapes](https://tum-pbs.github.io/PhiML/Math.html#non-uniform-tensors)
For uniform shapes, `Shape.shape` will only contain the dimension `dims` but the shapes of [non-uniform shapes](https://tum-pbs.github.io/PhiML/Non_Uniform.html)
may contain additional dimensions.
See Also:
Expand Down
4 changes: 2 additions & 2 deletions phiml/math/_tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Tensor:
To check whether a value is a tensor, use `isinstance(value, Tensor)`.
To construct a Tensor, use `phiml.math.tensor()`, `phiml.math.wrap()` or one of the basic tensor creation functions,
see https://tum-pbs.github.io/PhiML/Math.html#tensor-creation .
see https://tum-pbs.github.io/PhiML/Tensors.html .
Tensors are not editable.
When backed by an editable native tensor, e.g. a `numpy.ndarray`, do not edit the underlying data structure.
Expand Down Expand Up @@ -825,7 +825,7 @@ class TensorDim(BoundDim):
Indexing a `TensorDim` as `tdim[start:stop:step]` returns a sliced `Tensor`.
See the documentation at https://tum-pbs.github.io/PhiML/Math.html#indexing-slicing-unstacking .
See the documentation at https://tum-pbs.github.io/PhiML/Introduction.html#Slicing .
"""

def __init__(self, tensor: Tensor, name: str):
Expand Down
4 changes: 2 additions & 2 deletions phiml/math/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,12 +766,12 @@ def valid_key(key):
return {name: selection for name, selection in zip(channel(obj).names, item[1:])}
elif len(item) == shape(obj).channel_rank:
if len(item) > 1:
warnings.warn("NumPy-style slicing for more than one channel dimension is highly discouraged. Use a dict or the special slicing syntax value.dim[slice] instead. See https://tum-pbs.github.io/PhiML/Math.html", SyntaxWarning, stacklevel=3)
warnings.warn("NumPy-style slicing for more than one channel dimension is highly discouraged. Use a dict or the special slicing syntax value.dim[slice] instead. See https://tum-pbs.github.io/PhiML/Introduction.html#Slicing", SyntaxWarning, stacklevel=3)
return {name: selection for name, selection in zip(channel(obj).names, item)}
elif shape(obj).channel_rank == 1 and all(isinstance(e, str) for e in item):
return {channel(obj).name: item}
else:
raise AssertionError(f"Cannot slice {obj}[{item}]. Use a dict or the special slicing syntax value.dim[slice] instead. See https://tum-pbs.github.io/PhiML/Math.html")
raise AssertionError(f"Cannot slice {obj}[{item}]. Use a dict or the special slicing syntax value.dim[slice] instead. See https://tum-pbs.github.io/PhiML/Introduction.html#Slicing")
else:
if shape(obj).channel_rank == 1:
return {channel(obj).name: item}
Expand Down

0 comments on commit 7b3cf7e

Please sign in to comment.