Skip to content

Commit

Permalink
added deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbuntemeyer committed Jun 22, 2024
1 parent 81427e0 commit a2547d5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cordex/cmor/cmor.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def _get_time_axis_name(time_cell_method):


def _define_axes(ds, table_id):
if "CORDEX_domain" in ds.attrs:
grid = cordex_domain(ds.attrs["CORDEX_domain"], bounds=True)
if "domain_id" in ds.attrs:
grid = cordex_domain(ds.attrs["domain_id"], bounds=True)
lon_vertices = grid.lon_vertices.to_numpy()
lat_vertices = grid.lat_vertices.to_numpy()
else:
Expand Down Expand Up @@ -623,6 +623,15 @@ def cmorize_variable(
"""
ds = ds.copy()

if "CORDEX_domain" in kwargs:
warn(
"'CORDEX_domain' keyword is deprecated, please use the 'domain_id' keyword instead",
DeprecationWarning,
stacklevel=2,
)
domain_id = kwargs["CORDEX_domain"]
del kwargs["CORDEX_domain"]

if domain_id is None:
try:
domain_id = ds.cx.domain_id
Expand Down

0 comments on commit a2547d5

Please sign in to comment.