Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
plot_include_source = True
plot_formats = ["png"]
# Sphinx project configuration
templates_path = ["_templates"]
exclude_patterns = ["_build", "**.ipynb_checkpoints"]
source_suffix = ".rst"
# The encoding of source files.
source_encoding = "utf-8-sig"
master_doc = "index"
# General information about the project
year = datetime.date.today().year
project = "Harmonica"
copyright = "2018-{}, The Harmonica Developers".format(year)
if len(full_version.split("+")) > 1 or full_version == "unknown":
version = "dev"
else:
version = full_version
# These enable substitutions using |variable| in the rst files
rst_epilog = """
.. |year| replace:: {year}
""".format(
year=year
)
html_last_updated_fmt = "%b %d, %Y"
html_title = project
html_short_title = project
html_logo = "_static/harmonica-logo.png"
html_favicon = "_static/favicon.png"
# pylint: disable=missing-docstring,import-outside-toplevel
# Import functions/classes to make the public API
from . import version
from . import datasets
from . import synthetic
from .io import load_icgem_gdf
from .isostasy import isostasy_airy
from .gravity_corrections import bouguer_correction
from .forward.point_mass import point_mass_gravity
from .forward.tesseroid import tesseroid_gravity
from .forward.prism import prism_gravity
from .equivalent_layer.harmonic import EQLHarmonic, EQLHarmonicSpherical
# Get the version number through versioneer
__version__ = version.full_version
def test(doctest=True, verbose=True, coverage=False, figures=False):
"""
Run the test suite.
Uses `py.test `__ to discover and run the tests.
Parameters
----------
doctest : bool
If ``True``, will run the doctests as well (code examples that start
with a ``>>>`` in the docs).
verbose : bool
If ``True``, will print extra information during the test run.
"""
Functions to load sample datasets used in the Harmonica docs.
"""
import pkg_resources
import xarray as xr
import pandas as pd
import pooch
from ..version import full_version
REGISTRY = pooch.create(
path=pooch.os_cache("harmonica"),
base_url="https://github.com/fatiando/harmonica/raw/{version}/data/",
version=full_version,
version_dev="master",
env="HARMONICA_DATA_DIR",
)
with pkg_resources.resource_stream(
"harmonica.datasets", "registry.txt"
) as registry_file:
REGISTRY.load_registry(registry_file)
def locate():
r"""
The absolute path to the sample data storage location on disk.
This is where the data are saved on your computer. The location is
dependent on the operating system. The folder locations are defined by the
``appdirs`` package (see the `appdirs documentation