Skip to content

Commit 628f441

Browse files
authored
Merge pull request #143 from csiro-coasts/task/140-consolidate-depth-coordinates
Consolidate depth coordinate methods
2 parents 13f63d3 + 80e0128 commit 628f441

File tree

12 files changed

+240
-169
lines changed

12 files changed

+240
-169
lines changed

docs/releases/development.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ Next release (in development)
3333
* Add :func:`emsarray.utils.name_to_data_array()` and :func:`~emsarray.utils.data_array_to_name()` functions.
3434
Allow more functions to interchangeably take either a data array or the name of a data array
3535
(:pr:`142`).
36+
* Add :attr:`.Convention.depth_coordinates` and :meth:`.Convention.get_depth_coordinate_for_data_array()`. Deprecate functions :meth:`.Convention.get_depth_name()`, :meth:`.Convention.get_all_depth_names()`, and :meth:`Convention.get_time_name()`. Remove deprecated functions ``Convention.get_depths()`` and ``Convention.get_times()`` (:pr:`143`).

src/emsarray/cli/commands/extract_points.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import emsarray
88
from emsarray.cli import BaseCommand, CommandException
9+
from emsarray.exceptions import NoSuchCoordinateError
910
from emsarray.operations import point_extraction
1011
from emsarray.utils import to_netcdf_with_fixes
1112

@@ -79,8 +80,8 @@ def handle(self, options: argparse.Namespace) -> None:
7980
f"{rows.head()}\n"
8081
f"(total rows: {len(rows)})")
8182
try:
82-
time_name = dataset.ems.get_time_name()
83-
except KeyError:
83+
time_name = dataset.ems.time_coordinate.name
84+
except NoSuchCoordinateError:
8485
time_name = None
8586

8687
to_netcdf_with_fixes(

0 commit comments

Comments
 (0)