Skip to content

Commit

Permalink
Improve docstrings of magnetic_field functions
Browse files Browse the repository at this point in the history
Improve the description of the outputs of the `magnetic_field` functions
for dipoles and prisms. List each element of the tuple that is returned
as separate returns.
  • Loading branch information
santisoler committed May 29, 2024
1 parent 8d50e5a commit 0ef7118
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
14 changes: 9 additions & 5 deletions choclo/dipole/_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ def magnetic_field(
Returns
-------
b : array
Array containing the three components of the magnetic field generated
by the dipole on the observation point in :math:`\text{T}`.
The components are returned in the following order: ``b_e``, ``b_n``,
``b_u``.
b_e : float
Easting component of the magnetic field on the observation point in
:math:`\text{T}`.
b_n : float
Northing component of the magnetic field on the observation point in
:math:`\text{T}`.
b_u : float
Upward component of the magnetic field on the observation point in
:math:`\text{T}`.
Notes
-----
Expand Down
22 changes: 15 additions & 7 deletions choclo/prism/_magnetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,21 @@ def magnetic_field(
Returns
-------
b_e, b_n, b_u : floats
The three components of the magnetic field generated by the prism on
the observation point in :math:`\text{T}`.
The components are returned in the following order: ``b_e``, ``b_n``,
``b_u``.
Return a tuple full of ``numpy.nan`` if the observation point falls in
a singular point: prism vertices, prism edges or interior points.
b_e : float
Easting component of the magnetic field on the observation point in
:math:`\text{T}`.
It will be ``numpy.nan`` if the observation point falls in a singular
point: prism vertices, prism edges or interior points.
b_n : float
Northing component of the magnetic field on the observation point in
:math:`\text{T}`.
It will be ``numpy.nan`` if the observation point falls in a singular
point: prism vertices, prism edges or interior points.
b_u : float
Upward component of the magnetic field on the observation point in
:math:`\text{T}`.
It will be ``numpy.nan`` if the observation point falls in a singular
point: prism vertices, prism edges or interior points.
Notes
-----
Expand Down

0 comments on commit 0ef7118

Please sign in to comment.