Skip to content

Commit

Permalink
added deprecation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbuntemeyer committed Dec 19, 2024
1 parent 142aa50 commit 62732ee
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions cordex/preprocessing/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ def replace_rlon_rlat(ds, domain=None):
Dataset with updated rlon, rlat.
"""
warn(
"replace_rlon_rlat is deprecated, please use rewrite_coords instead",
DeprecationWarning,
stacklevel=2,
)
ds = ds.copy()
if domain is None:
domain = ds.cx.domain_id
Expand Down Expand Up @@ -297,6 +302,11 @@ def replace_vertices(ds, domain=None):
Dataset with updated vertices.
"""
warn(
"replace_vertices is deprecated, please use rewrite_coords instead",
DeprecationWarning,
stacklevel=2,
)
ds = ds.copy()
if domain is None:
domain = ds.attrs.get("CORDEX_domain", None)
Expand Down Expand Up @@ -325,6 +335,11 @@ def replace_lon_lat(ds, domain=None):
Dataset with updated lon, lat.
"""
warn(
"replace_lon_lat is deprecated, please use rewrite_coords instead",
DeprecationWarning,
stacklevel=2,
)
ds = ds.copy()
if domain is None:
domain = ds.cx.domain_id
Expand Down Expand Up @@ -355,6 +370,11 @@ def replace_coords(ds, domain=None):
"""
warn(
"replace_coords is deprecated, please use rewrite_coords instead",
DeprecationWarning,
stacklevel=2,
)
ds = ds.copy()
ds = replace_rlon_rlat(ds, domain)
ds = replace_lon_lat(ds, domain)
Expand All @@ -380,6 +400,11 @@ def replace_grid(ds, domain=None):
"""
warn(
"replace_grid is deprecated, please use rewrite_coords instead",
DeprecationWarning,
stacklevel=2,
)
ds = ds.copy()
ds = replace_rlon_rlat(ds, domain)
ds = replace_lon_lat(ds, domain)
Expand Down
2 changes: 1 addition & 1 deletion docs/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rounding errors. This version drops python3.8 support.
New Features
~~~~~~~~~~~~

- New function :py:meth:`cordex.rewrite_coords` (:pull:`306`).
- New function :py:meth:`cordex.rewrite_coords` (:pull:`306`, :pull:`307`).

Breaking Changes
~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 62732ee

Please sign in to comment.