Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pydocstyle warnings
Browse files Browse the repository at this point in the history
santisoler committed Dec 13, 2024
1 parent 056f3b2 commit 5a48860
Showing 13 changed files with 80 additions and 72 deletions.
8 changes: 8 additions & 0 deletions choclo/__init__.py
Original file line number Diff line number Diff line change
@@ -5,6 +5,14 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
# Import functions/classes to make the public API
"""
Choclo: Kernel functions for your geophysical models.
Choclo is a Python library that hosts optimized forward modelling and kernel
functions for running geophysical forward and inverse models, intended to be
used by other libraries as the underlying layer of their computation.
"""

from . import dipole, point, prism
from ._version import __version__

2 changes: 1 addition & 1 deletion choclo/constants.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Define universal constants
Define universal constants.
"""

#: Gravitational constant :math:`G` in SI units (:math:`m^3 kg^{-1} s^{-2}`)
2 changes: 1 addition & 1 deletion choclo/dipole/__init__.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Kernels and forward modelling functions for magnetic dipoles
Kernels and forward modelling functions for magnetic dipoles.
"""

from ._forward import magnetic_e, magnetic_field, magnetic_n, magnetic_u
8 changes: 4 additions & 4 deletions choclo/dipole/_forward.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ def magnetic_field(
magnetic_moment_up,
):
r"""
Magnetic field due to a dipole
Magnetic field due to a dipole.
Returns the three components of the magnetic field due to a single dipole
a single computation point.
@@ -115,7 +115,7 @@ def magnetic_e(
magnetic_moment_up,
):
r"""
Easting component of the magnetic field due to a dipole
Easting component of the magnetic field due to a dipole.
Returns the easting component of the magnetic field by a single dipole on
a single computation point
@@ -193,7 +193,7 @@ def magnetic_n(
magnetic_moment_up,
):
r"""
Northing component of the magnetic field due to a dipole
Northing component of the magnetic field due to a dipole.
Returns the northing component of the magnetic field by a single dipole on
a single computation point
@@ -271,7 +271,7 @@ def magnetic_u(
magnetic_moment_up,
):
r"""
Upward component of the magnetic field due to a dipole
Upward component of the magnetic field due to a dipole.
Returns the upward component of the magnetic field by a single dipole on
a single computation point
2 changes: 1 addition & 1 deletion choclo/point/__init__.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Kernels and forward modelling functions for point sources
Kernels and forward modelling functions for point sources.
"""

from ._forward import (
22 changes: 11 additions & 11 deletions choclo/point/_forward.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Forward modelling function for point sources
Forward modelling function for point sources.
"""

from numba import jit
@@ -29,7 +29,7 @@
@jit(nopython=True)
def gravity_pot(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, mass):
r"""
Gravitational potential field due to a point source
Gravitational potential field due to a point source.
Returns the gravitational potential field produced by a single point source
on a single computation point
@@ -77,7 +77,7 @@ def gravity_pot(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q
@jit(nopython=True)
def gravity_e(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, mass):
r"""
Easting component of the gravitational acceleration due to a point source
Easting component of the gravitational acceleration due to a point source.
Returns the easting component of the gravitational acceleration produced by
a single point source on a single computation point
@@ -130,7 +130,7 @@ def gravity_e(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q,
@jit(nopython=True)
def gravity_n(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, mass):
r"""
Northing component of the gravitational acceleration due to a point source
Northing component of the gravitational acceleration due to a point source.
Returns the northing component of the gravitational acceleration produced
by a single point source on a single computation point
@@ -183,7 +183,7 @@ def gravity_n(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q,
@jit(nopython=True)
def gravity_u(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, mass):
r"""
Upward component of the gravitational acceleration due to a point source
Upward component of the gravitational acceleration due to a point source.
Returns the upward component of the gravitational acceleration produced by
a single point source on a single computation point
@@ -236,7 +236,7 @@ def gravity_u(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q,
@jit(nopython=True)
def gravity_ee(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, mass):
r"""
Easting-easting component of the gravitational tensor due to a point source
Easting-easting component of the gravitational tensor due to a point source.
Returns the easting-easting component of the gravitational tensor produced
by a single point source on a single computation point
@@ -296,7 +296,7 @@ def gravity_ee(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q,
@jit(nopython=True)
def gravity_nn(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, mass):
r"""
Northing-northing component of the gravitational tensor due to point source
Northing-northing component of the gravitational tensor due to point source.
Returns the northing-northing component of the gravitational tensor
produced by a single point source on a single computation point
@@ -356,7 +356,7 @@ def gravity_nn(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q,
@jit(nopython=True)
def gravity_uu(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, mass):
r"""
Upward-upward component of the gravitational tensor due to a point source
Upward-upward component of the gravitational tensor due to a point source.
Returns the upward-upward component of the gravitational tensor
produced by a single point source on a single computation point
@@ -416,7 +416,7 @@ def gravity_uu(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q,
@jit(nopython=True)
def gravity_en(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, mass):
r"""
Easting-northing component of the gravitational tensor due to point source
Easting-northing component of the gravitational tensor due to point source.
Returns the easting-northing component of the gravitational tensor
produced by a single point source on a single computation point
@@ -471,7 +471,7 @@ def gravity_en(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q,
@jit(nopython=True)
def gravity_eu(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, mass):
r"""
Easting-upward component of the gravitational tensor due to point source
Easting-upward component of the gravitational tensor due to point source.
Returns the easting-upward component of the gravitational tensor
produced by a single point source on a single computation point
@@ -526,7 +526,7 @@ def gravity_eu(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q,
@jit(nopython=True)
def gravity_nu(easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, mass):
r"""
Northing-upward component of the gravitational tensor due to point source
Northing-upward component of the gravitational tensor due to point source.
Returns the northing-upward component of the gravitational tensor
produced by a single point source on a single computation point
22 changes: 11 additions & 11 deletions choclo/point/_kernels.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Kernel functions for point sources
Kernel functions for point sources.
"""

from numba import jit
@@ -16,7 +16,7 @@ def kernel_pot(
easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, distance
):
r"""
The inverse of the distance between the two points
Compute the inverse of the distance between the two points.
.. important ::
@@ -64,7 +64,7 @@ def kernel_e(
easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, distance
):
r"""
Easting component of the gradient of the inverse of the distance
Easting component of the gradient of the inverse of the distance.
.. important ::
@@ -117,7 +117,7 @@ def kernel_n(
easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, distance
):
r"""
Northing component of the gradient of the inverse of the distance
Northing component of the gradient of the inverse of the distance.
.. important ::
@@ -170,7 +170,7 @@ def kernel_u(
easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, distance
):
r"""
Upward component of the gradient of the inverse of the distance
Upward component of the gradient of the inverse of the distance.
.. important ::
@@ -223,7 +223,7 @@ def kernel_ee(
easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, distance
):
r"""
Second derivative of the inverse of the distance along easting-easting
Second derivative of the inverse of the distance along easting-easting.
.. important ::
@@ -281,7 +281,7 @@ def kernel_nn(
easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, distance
):
r"""
Second derivative of the inverse of the distance along northing-northing
Second derivative of the inverse of the distance along northing-northing.
.. important ::
@@ -339,7 +339,7 @@ def kernel_uu(
easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, distance
):
r"""
Second derivative of the inverse of the distance along upward-upward
Second derivative of the inverse of the distance along upward-upward.
.. important ::
@@ -397,7 +397,7 @@ def kernel_en(
easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, distance
):
r"""
Second derivative of the inverse of the distance along easting-northing
Second derivative of the inverse of the distance along easting-northing.
.. important ::
@@ -450,7 +450,7 @@ def kernel_eu(
easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, distance
):
r"""
Second derivative of the inverse of the distance along easting-upward
Second derivative of the inverse of the distance along easting-upward.
.. important ::
@@ -503,7 +503,7 @@ def kernel_nu(
easting_p, northing_p, upward_p, easting_q, northing_q, upward_q, distance
):
r"""
Second derivative of the inverse of the distance along northing-upward
Second derivative of the inverse of the distance along northing-upward.
.. important ::
2 changes: 1 addition & 1 deletion choclo/prism/__init__.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Kernels and forward modelling functions for rectangular prisms
Kernels and forward modelling functions for rectangular prisms.
"""

from ._gravity import (
24 changes: 12 additions & 12 deletions choclo/prism/_gravity.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Gravity forward modelling functions for rectangular prisms
Gravity forward modelling functions for rectangular prisms.
"""

import numpy as np
@@ -48,7 +48,7 @@ def gravity_pot(
density,
):
r"""
Gravitational potential field due to a rectangular prism
Gravitational potential field due to a rectangular prism.
Returns the gravitational potential field produced by a single rectangular
prism on a single computation point.
@@ -181,7 +181,7 @@ def gravity_e(
density,
):
r"""
Easting component of the gravitational acceleration due to a prism
Easting component of the gravitational acceleration due to a prism.
Returns the easting component of the gravitational acceleration produced by
a single rectangular prism on a single computation point.
@@ -315,7 +315,7 @@ def gravity_n(
density,
):
r"""
Northing component of the gravitational acceleration due to a prism
Northing component of the gravitational acceleration due to a prism.
Returns the northing component of the gravitational acceleration produced
by a single rectangular prism on a single computation point.
@@ -449,7 +449,7 @@ def gravity_u(
density,
):
r"""
Upward component of the gravitational acceleration due to a prism
Upward component of the gravitational acceleration due to a prism.
Returns the upward component of the gravitational acceleration produced by
a single rectangular prism on a single computation point.
@@ -589,7 +589,7 @@ def gravity_ee(
density,
):
r"""
Easting-easting component of the gravitational tensor due to a prism
Easting-easting component of the gravitational tensor due to a prism.
Returns the easting-easting component of the gravitational tensor produced
by a single rectangular prism on a single computation point.
@@ -747,7 +747,7 @@ def gravity_nn(
density,
):
r"""
Northing-northing component of the gravitational tensor due to a prism
Northing-northing component of the gravitational tensor due to a prism.
Returns the northing-northing component of the gravitational tensor
produced by a single rectangular prism on a single computation point.
@@ -905,7 +905,7 @@ def gravity_uu(
density,
):
r"""
Upward-upward component of the gravitational tensor due to a prism
Upward-upward component of the gravitational tensor due to a prism.
Returns the northing-northing component of the gravitational tensor
produced by a single rectangular prism on a single computation point.
@@ -1063,7 +1063,7 @@ def gravity_en(
density,
):
r"""
Easting-northing component of the gravitational tensor due to a prism
Easting-northing component of the gravitational tensor due to a prism.
Returns the northing-northing component of the gravitational tensor
produced by a single rectangular prism on a single computation point.
@@ -1197,7 +1197,7 @@ def gravity_eu(
density,
):
r"""
Easting-upward component of the gravitational tensor due to a prism
Easting-upward component of the gravitational tensor due to a prism.
Returns the easting-upward component of the gravitational tensor
produced by a single rectangular prism on a single computation point.
@@ -1332,7 +1332,7 @@ def gravity_nu(
density,
):
r"""
Northing-upward component of the gravitational tensor due to a prism
Northing-upward component of the gravitational tensor due to a prism.
Returns the northing-upward component of the gravitational tensor
produced by a single rectangular prism on a single computation point.
@@ -1467,7 +1467,7 @@ def _evaluate_kernel(
kernel,
):
r"""
Evaluate a kernel function on every shifted vertex of a prism
Evaluate a kernel function on every shifted vertex of a prism.
Parameters
----------
Loading

0 comments on commit 5a48860

Please sign in to comment.