Skip to content

Commit

Permalink
correct docs
Browse files Browse the repository at this point in the history
  • Loading branch information
samjrholt committed Jun 5, 2024
1 parent 3e034ab commit b926cf7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions discretisedfield/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -1647,12 +1647,12 @@ def __truediv__(self, other):
2. Divide vector field by a scalar.
>>> f1 = df.Field(mesh, nvdim=3, value=(0, 10, 5))
>>> f1 = df.Field(mesh, nvdim=3, value=(20, 10, 5))
>>> res = f1 / 5 # discretisedfield.Field.__mul__ is called
>>> res.mean()
array([0., 2., 1.])
>>> (10 / f1).mean() # division by a vector is not allowed
array([inf, 1., 2.])
array([4., 2., 1.])
>>> (10 / f1).mean()
array([0.5, 1., 2.])
.. seealso:: :py:func:`~discretisedfield.Field.__mul__`
Expand Down

0 comments on commit b926cf7

Please sign in to comment.