Skip to content

Commit

Permalink
Merge pull request #143 from csiro-coasts/task/140-consolidate-depth-…
Browse files Browse the repository at this point in the history
…coordinates

Consolidate depth coordinate methods
  • Loading branch information
mx-moth authored Jul 8, 2024
2 parents 13f63d3 + 80e0128 commit 628f441
Show file tree
Hide file tree
Showing 12 changed files with 240 additions and 169 deletions.
1 change: 1 addition & 0 deletions docs/releases/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ Next release (in development)
* Add :func:`emsarray.utils.name_to_data_array()` and :func:`~emsarray.utils.data_array_to_name()` functions.
Allow more functions to interchangeably take either a data array or the name of a data array
(:pr:`142`).
* 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`).
5 changes: 3 additions & 2 deletions src/emsarray/cli/commands/extract_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import emsarray
from emsarray.cli import BaseCommand, CommandException
from emsarray.exceptions import NoSuchCoordinateError
from emsarray.operations import point_extraction
from emsarray.utils import to_netcdf_with_fixes

Expand Down Expand Up @@ -79,8 +80,8 @@ def handle(self, options: argparse.Namespace) -> None:
f"{rows.head()}\n"
f"(total rows: {len(rows)})")
try:
time_name = dataset.ems.get_time_name()
except KeyError:
time_name = dataset.ems.time_coordinate.name
except NoSuchCoordinateError:
time_name = None

to_netcdf_with_fixes(
Expand Down
Loading

0 comments on commit 628f441

Please sign in to comment.