Skip to content

Commit

Permalink
Minor updates of docstrings and other small things (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-zwicker authored Oct 3, 2023
1 parent 0c3d9bb commit 9b59a53
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions pde/fields/scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
arrs.append(arg)
elif isinstance(arg, np.ndarray):
if arg.shape != self.data.shape:
print(arg.shape, self.data.shape)
raise RuntimeError("Data shapes incompatible")
raise RuntimeError(
f"Data shapes incompatible ({arg.shape} != {self.data.shape}"
)
arrs.append(arg)
elif isinstance(arg, self.__class__):
self.assert_field_compatible(arg)
Expand Down
12 changes: 7 additions & 5 deletions pde/grids/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,14 +571,16 @@ def normalize_point(
) -> np.ndarray:
"""normalize grid coordinates by applying periodic boundary conditions
Here, the point is assumed to be specified by the physical values along the
non-symmetric axes of the grid. Normalizing points is useful to make sure they
lie within the domain of the grid. This function respects periodic boundary
conditions and can also reflect points off the boundary.
Here, points are assumed to be specified by the physical values along the
non-symmetric axes of the grid, e.g., by grid coordinates. Normalizing points is
useful to make sure they lie within the domain of the grid. This function
respects periodic boundary conditions and can also reflect points off the
boundary if `reflect = True`.
Args:
point (:class:`~numpy.ndarray`):
Coordinates of a single point
Coordinates of a single point or an array of points, where the last axis
denotes the point coordinates (e.g., a list of points).
reflect (bool):
Flag determining whether coordinates along non-periodic axes are
reflected to lie in the valid range. If `False`, such coordinates are
Expand Down
2 changes: 1 addition & 1 deletion pde/visualization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
movies
plotting
.. codeauthor:: David Zwicker <[email protected]>
"""

Expand Down
3 changes: 1 addition & 2 deletions pde/visualization/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
movie_scalar
movie_multiple
movie
.. codeauthor:: David Zwicker <[email protected]>
"""

Expand Down

0 comments on commit 9b59a53

Please sign in to comment.