API Documentation

In the following sections, we demonstrate how to use the sphinx.ext.autodoc extension to import the docstrings from a Python module into this documentation page.

Utilities

First, we can pull in the module level docstring for agu_oss.utilities with the following command:

.. automodule:: agu_oss.utilities

A few helper utilities.

Then we can auto include the dosctrings for specific functions in that module such as:

.. autofunction:: agu_oss.divide

.. autofunction:: agu_oss.moving_average
agu_oss.divide(a, b)

Divide two numbers.

Parameters
  • a (int, float) – The dividend

  • b (int, float) – The divisor

Returns

int, float

Return type

the quotient

agu_oss.moving_average(data, window_size)

Calculate a moving average over 1D data using the given window size.

Parameters
  • data (numpy.ndarray) – Data that we will compute the moving average over

  • window_size (int) – width of the window we use to compute the moving average

Cleaning

A second sample module to clean data.

agu_oss.open_and_clean(url)

A function that is designed to clean up data downloaded from the Berkely earth website. This function assumes that your data are always in the same format.

Parameters

url (string) – Path to the data from the Berkeley earth website

Returns

Return type

Pandas.DataFrame