Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate the sample datasets #277

Merged
merged 3 commits into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions data/examples/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Sample Data
Verde provides some sample data and ways of generating synthetic data through
the :mod:`verde.datasets` module.

.. warning::

All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

Where are my data files?
------------------------

Expand Down
11 changes: 9 additions & 2 deletions data/examples/baja_bathymetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Bathymetry data from Baja California
====================================
[DEPRECATED] Bathymetry data from Baja California
=================================================

.. warning::

All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

We provide sample bathymetry data from Baja California to test the gridding
methods. This is the ``@tut_ship.xyz`` sample data provided by `GMT
Expand Down
11 changes: 9 additions & 2 deletions data/examples/california_gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
GPS velocities from California
==============================
[DEPRECATED] GPS velocities from California
===========================================

.. warning::

All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

We provide sample 3-component GPS velocity data from the West coast of the U.S.
The data were cut from EarthScope Plate Boundary Observatory data provided by
Expand Down
8 changes: 4 additions & 4 deletions data/examples/rio_magnetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

.. warning::

**The Rio magnetic anomaly dataset is deprecated and will be removed in
Verde v2.0.0** (functions :func:`verde.datasets.fetch_rio_magnetic` and
:func:`verde.datasets.setup_rio_magnetic_map`). Please use another dataset
instead.
All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

We provide sample total-field magnetic anomaly data from an airborne survey of
Rio de Janeiro, Brazil, from the 1970s. The data are made available by the
Expand Down
11 changes: 9 additions & 2 deletions data/examples/texas-wind.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Wind speed data from Texas
==========================
[DEPRECATED] Wind speed data from Texas
=======================================

.. warning::

All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

This is average wind speed and air temperature for data for the state of Texas,
USA, on February 26 2018. The original data was downloaded from `Iowa State
Expand Down
70 changes: 62 additions & 8 deletions verde/datasets/sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
REGISTRY.load_registry(registry_file)


def _datasets_deprecation_warning():
warnings.warn(
"All sample datasets in Verde are deprecated and will be "
"removed in Verde v2.0.0. The tutorials/examples will transition "
"to using Ensaio (https://www.fatiando.org/ensaio/) instead.",
DeprecationWarning,
)


def locate():
r"""
The absolute path to the sample data storage location on disk.
Expand Down Expand Up @@ -79,6 +88,13 @@ def fetch_baja_bathymetry():
"""
Fetch sample bathymetry data from Baja California.

.. warning::

All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

This is the ``@tut_ship.xyz`` sample data from the `GMT
<http://gmt.soest.hawaii.edu/>`__ tutorial.

Expand All @@ -96,6 +112,7 @@ def fetch_baja_bathymetry():
setup_baja_bathymetry_map: Utility function to help setup a Cartopy map.

"""
_datasets_deprecation_warning()
data_file = REGISTRY.fetch("baja-bathymetry.csv.xz")
data = pd.read_csv(data_file, compression="xz")
return data
Expand All @@ -107,6 +124,13 @@ def setup_baja_bathymetry_map(
"""
Setup a Cartopy map for the Baja California bathymetry dataset.

.. warning::

All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

Parameters
----------
ax : matplotlib Axes
Expand Down Expand Up @@ -145,10 +169,10 @@ def fetch_rio_magnetic():

.. warning::

**The Rio magnetic anomaly dataset is deprecated and will be removed in
Verde v2.0.0** (functions :func:`verde.datasets.fetch_rio_magnetic` and
:func:`verde.datasets.setup_rio_magnetic_map`). Please use another
dataset instead.
All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

These data were cropped from the northwestern part of an airborne survey of
Rio de Janeiro, Brazil, conducted in 1978. The data are made available by
Expand Down Expand Up @@ -198,10 +222,10 @@ def setup_rio_magnetic_map(ax, region=(-42.6, -42, -22.5, -22)):

.. warning::

**The Rio magnetic anomaly dataset is deprecated and will be removed in
Verde v2.0.0** (functions :func:`verde.datasets.fetch_rio_magnetic` and
:func:`verde.datasets.setup_rio_magnetic_map`). Please use another
dataset instead.
All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

Parameters
----------
Expand Down Expand Up @@ -233,6 +257,13 @@ def fetch_california_gps():
"""
Fetch sample GPS velocity data from California (the U.S. West coast).

.. warning::

All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

Velocities and their standard deviations are in meters/year. Height is
geometric height above WGS84 in meters. Velocities are referenced to the
North American tectonic plate (NAM08). The average velocities were released
Expand Down Expand Up @@ -260,6 +291,7 @@ def fetch_california_gps():
setup_california_gps_map: Utility function to help setup a Cartopy map.

"""
_datasets_deprecation_warning()
data_file = REGISTRY.fetch("california-gps.csv.xz")
data = pd.read_csv(data_file, compression="xz")
return data
Expand All @@ -271,6 +303,13 @@ def setup_california_gps_map(
"""
Setup a Cartopy map for the California GPS velocity dataset.

.. warning::

All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

Parameters
----------
ax : matplotlib Axes
Expand Down Expand Up @@ -307,6 +346,13 @@ def fetch_texas_wind():
"""
Fetch sample wind speed and air temperature data for Texas, USA.

.. warning::

All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

Data are average wind speed and air temperature for data for February 26
2018. The original data was downloaded from `Iowa State University
<https://mesonet.agron.iastate.edu/request/download.phtml>`__.
Expand All @@ -326,6 +372,7 @@ def fetch_texas_wind():
setup_texas_wind_map: Utility function to help setup a Cartopy map.

"""
_datasets_deprecation_warning()
data_file = REGISTRY.fetch("texas-wind.csv")
data = pd.read_csv(data_file)
return data
Expand All @@ -335,6 +382,13 @@ def setup_texas_wind_map(ax, region=(-107, -93, 25.5, 37), coastlines=True, **kw
"""
Setup a Cartopy map for the Texas wind speed and air temperature dataset.

.. warning::

All sample datasets in Verde are deprecated and will be
**removed in Verde v2.0.0**.
The tutorials/examples will transition to using
`Ensaio <https://www.fatiando.org/ensaio/>`__ instead.

Parameters
----------
ax : matplotlib Axes
Expand Down