Skip to content

Commit

Permalink
Group similar parameters in docstrings (#105)
Browse files Browse the repository at this point in the history
Group similar parameters together in the docstrings of forward and
kernel functions for points, dipoles and prisms. This makes the
docstrings of the functions shorter and avoid too many repetitions.
Configure flake8 for maximum line length in docstrings to 88.
  • Loading branch information
santisoler authored Nov 14, 2024
1 parent 1392845 commit f405e25
Show file tree
Hide file tree
Showing 9 changed files with 355 additions and 1,085 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[flake8]
max-line-length = 88
max-doc-length = 79
max-doc-length = 88
ignore =
# Too many leading '#' for block comment
E266,
Expand Down
128 changes: 35 additions & 93 deletions choclo/dipole/_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,20 @@ def magnetic_field(
Parameters
----------
easting_p : float
Easting coordinate of the observation point in meters.
northing_p : float
Northing coordinate of the observation point in meters.
upward_p : float
Upward coordinate of the observation point in meters.
easting_q : float
Easting coordinate of the dipole in meters.
northing_q : float
Northing coordinate of the dipole in meters.
upward_q : float
Upward coordinate of the dipole in meters.
magnetic_moment_east : float
The East component of the magnetic moment vector of the dipole. Must be
in :math:`A m^2`.
magnetic_moment_north : float
The North component of the magnetic moment vector of the dipole. Must
be in :math:`A m^2`.
magnetic_moment_up : float
The upward component of the magnetic moment vector of the dipole. Must
be in :math:`A m^2`.
easting_p, northing_p, upward_p : float
Easting, northing and upward coordinates of the observation point in
meters.
easting_q, northing_q, upward_q : float
Easting, northing and upward coordinates of the dipole in meters.
magnetic_moment_east, magnetic_moment_north, magnetic_moment_up : float
The east, north and upward component of the magnetic moment vector of
the dipole. Must be in :math:`A m^2`.
Returns
-------
b_e : float
Easting component of the magnetic field generated by the dipole
on the observation point in :math:`\text{T}`.
b_n : float
Northing component of the magnetic field generated by the dipole
on the observation point in :math:`\text{T}`.
b_u : float
Upward component of the magnetic field generated by the dipole
on the observation point in :math:`\text{T}`.
b_e, b_n, b_u : float
Easting, northing and upward components of the magnetic field generated
by the dipole on the observation point in :math:`\text{T}`.
Notes
-----
Expand Down Expand Up @@ -141,27 +122,14 @@ def magnetic_e(
Parameters
----------
easting_p : float
Easting coordinate of the observation point in meters.
northing_p : float
Northing coordinate of the observation point in meters.
upward_p : float
Upward coordinate of the observation point in meters.
easting_q : float
Easting coordinate of the dipole in meters.
northing_q : float
Northing coordinate of the dipole in meters.
upward_q : float
Upward coordinate of the dipole in meters.
magnetic_moment_east : float
The East component of the magnetic moment vector of the dipole. Must be
in :math:`A m^2`.
magnetic_moment_north : float
The North component of the magnetic moment vector of the dipole. Must
be in :math:`A m^2`.
magnetic_moment_up : float
The upward component of the magnetic moment vector of the dipole. Must
be in :math:`A m^2`.
easting_p, northing_p, upward_p : float
Easting, northing and upward coordinates of the observation point in
meters.
easting_q, northing_q, upward_q : float
Easting, northing and upward coordinates of the dipole in meters.
magnetic_moment_east, magnetic_moment_north, magnetic_moment_up : float
The east, north and upward component of the magnetic moment vector of
the dipole. Must be in :math:`A m^2`.
Returns
-------
Expand Down Expand Up @@ -232,27 +200,14 @@ def magnetic_n(
Parameters
----------
easting_p : float
Easting coordinate of the observation point in meters.
northing_p : float
Northing coordinate of the observation point in meters.
upward_p : float
Upward coordinate of the observation point in meters.
easting_q : float
Easting coordinate of the dipole in meters.
northing_q : float
Northing coordinate of the dipole in meters.
upward_q : float
Upward coordinate of the dipole in meters.
magnetic_moment_east : float
The East component of the magnetic moment vector of the dipole. Must be
in :math:`A m^2`.
magnetic_moment_north : float
The North component of the magnetic moment vector of the dipole. Must
be in :math:`A m^2`.
magnetic_moment_up : float
The upward component of the magnetic moment vector of the dipole. Must
be in :math:`A m^2`.
easting_p, northing_p, upward_p : float
Easting, northing and upward coordinates of the observation point in
meters.
easting_q, northing_q, upward_q : float
Easting, northing and upward coordinates of the dipole in meters.
magnetic_moment_east, magnetic_moment_north, magnetic_moment_up : float
The east, north and upward component of the magnetic moment vector of
the dipole. Must be in :math:`A m^2`.
Returns
-------
Expand Down Expand Up @@ -323,27 +278,14 @@ def magnetic_u(
Parameters
----------
easting_p : float
Easting coordinate of the observation point in meters.
northing_p : float
Northing coordinate of the observation point in meters.
upward_p : float
Upward coordinate of the observation point in meters.
easting_q : float
Easting coordinate of the dipole in meters.
northing_q : float
Northing coordinate of the dipole in meters.
upward_q : float
Upward coordinate of the dipole in meters.
magnetic_moment_east : float
The East component of the magnetic moment vector of the dipole. Must be
in :math:`A m^2`.
magnetic_moment_north : float
The North component of the magnetic moment vector of the dipole. Must
be in :math:`A m^2`.
magnetic_moment_up : float
The upward component of the magnetic moment vector of the dipole. Must
be in :math:`A m^2`.
easting_p, northing_p, upward_p : float
Easting, northing and upward coordinates of the observation point in
meters.
easting_q, northing_q, upward_q : float
Easting, northing and upward coordinates of the dipole in meters.
magnetic_moment_east, magnetic_moment_north, magnetic_moment_up : float
The east, north and upward component of the magnetic moment vector of
the dipole. Must be in :math:`A m^2`.
Returns
-------
Expand Down
Loading

0 comments on commit f405e25

Please sign in to comment.