Skip to content

Commit

Permalink
Deprecate tide modelling tools in favour of eo-tides (#1276)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbibt authored Nov 14, 2024
1 parent fe36b0e commit 0204f80
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions Tools/dea_tools/coastal.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,10 @@ def model_tides(
**ensemble_kwargs,
):
"""
DEPRECATED: This function has been moved to the `eo-tides` Python package,
and will be retired in a future release. Please migrate your code to use
`eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
Compute tides at multiple points and times using tidal harmonics.
This function supports all tidal models supported by `pyTMD`,
Expand Down Expand Up @@ -887,6 +891,14 @@ def model_tides(
combination of time and point coordinates.
"""
warnings.warn(
"This function has been moved to the `eo-tides` Python package, "
"and will be retired in a future release. Please migrate your code "
"to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
DeprecationWarning,
stacklevel=2,
)

# Set tide modelling files directory. If no custom path is provided,
# first try global environmental var, then "/var/share/tide_models"
if directory is None:
Expand Down Expand Up @@ -1169,6 +1181,10 @@ def pixel_tides(
**model_tides_kwargs,
):
"""
DEPRECATED: This function has been moved to the `eo-tides` Python package,
and will be retired in a future release. Please migrate your code to use
`eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
Obtain tide heights for each pixel in a dataset by modelling
tides into a low-resolution grid surrounding the dataset,
then (optionally) spatially resample this low-res data back
Expand Down Expand Up @@ -1271,6 +1287,14 @@ def pixel_tides(
import odc.geo.xr
from odc.geo.geobox import GeoBox

warnings.warn(
"This function has been moved to the `eo-tides` Python package, "
"and will be retired in a future release. Please migrate your code "
"to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
DeprecationWarning,
stacklevel=2,
)

# First test if no time dimension and nothing passed to `times`
if ("time" not in ds.dims) & (times is None):
raise ValueError(
Expand Down Expand Up @@ -1449,6 +1473,10 @@ def tidal_tag(
**model_tides_kwargs,
):
"""
DEPRECATED: This function has been moved to the `eo-tides` Python package,
and will be retired in a future release. Please migrate your code to use
`eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
Takes an xarray.Dataset and returns the same dataset with a new
`tide_m` variable giving the height of the tide at the exact
moment of each satellite acquisition.
Expand Down Expand Up @@ -1501,6 +1529,14 @@ def tidal_tag(

import odc.geo.xr

warnings.warn(
"This function has been moved to the `eo-tides` Python package, "
"and will be retired in a future release. Please migrate your code "
"to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
DeprecationWarning,
stacklevel=2,
)

# If custom tide modelling locations are not provided, use the
# dataset centroid
if not tidepost_lat or not tidepost_lon:
Expand Down Expand Up @@ -1593,6 +1629,10 @@ def tidal_stats(
**model_tides_kwargs,
):
"""
DEPRECATED: This function has been moved to the `eo-tides` Python package,
and will be retired in a future release. Please migrate your code to use
`eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
Takes an xarray.Dataset and statistically compares the tides
modelled for each satellite observation against the full modelled
tidal range. This comparison can be used to evaluate whether the
Expand Down Expand Up @@ -1679,6 +1719,13 @@ def tidal_stats(
all available tide heights and time
"""
warnings.warn(
"This function has been moved to the `eo-tides` Python package, "
"and will be retired in a future release. Please migrate your code "
"to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
DeprecationWarning,
stacklevel=2,
)

# Model tides for each observation in the supplied xarray object
ds_tides, tidepost_lon, tidepost_lat = tidal_tag(
Expand Down Expand Up @@ -1861,6 +1908,10 @@ def tidal_tag_otps(
return_tideposts=False,
):
"""
DEPRECATED: This function has been moved to the `eo-tides` Python package,
and will be retired in a future release. Please migrate your code to use
`eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
Takes an xarray.Dataset and returns the same dataset with a new
`tide_m` variable giving the height of the tide at the exact
moment of each satellite acquisition.
Expand Down Expand Up @@ -1904,6 +1955,13 @@ def tidal_tag_otps(
location used in the analysis).
"""
warnings.warn(
"This function has been moved to the `eo-tides` Python package, "
"and will be retired in a future release. Please migrate your code "
"to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
DeprecationWarning,
stacklevel=2,
)

# Load tide modelling functions from either OTPS for pyfes
try:
Expand Down Expand Up @@ -2002,6 +2060,10 @@ def tidal_stats_otps(
round_stats=3,
):
"""
DEPRECATED: This function has been moved to the `eo-tides` Python package,
and will be retired in a future release. Please migrate your code to use
`eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
Takes an xarray.Dataset and statistically compares the tides
modelled for each satellite observation against the full modelled
tidal range. This comparison can be used to evaluate whether the
Expand Down Expand Up @@ -2082,6 +2144,13 @@ def tidal_stats_otps(
all available tide heights and time
"""
warnings.warn(
"This function has been moved to the `eo-tides` Python package, "
"and will be retired in a future release. Please migrate your code "
"to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
DeprecationWarning,
stacklevel=2,
)

# Load tide modelling functions from either OTPS for pyfes
try:
Expand Down

0 comments on commit 0204f80

Please sign in to comment.