From 71f025024f8675148c2b2380c27c2c2c423e16e4 Mon Sep 17 00:00:00 2001 From: Praneeth Ratna <63547155+praneethratna@users.noreply.github.com> Date: Wed, 8 Nov 2023 23:36:38 +0530 Subject: [PATCH] Refactored `EchoData.update_platform` to improve readability (#1209) * refactored update_platform method * removed extra print statements --- echopype/echodata/echodata.py | 119 ++---------------------- echopype/echodata/utils_platform.py | 139 ++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+), 112 deletions(-) create mode 100644 echopype/echodata/utils_platform.py diff --git a/echopype/echodata/echodata.py b/echopype/echodata/echodata.py index c27dea205..6fd8fc079 100644 --- a/echopype/echodata/echodata.py +++ b/echopype/echodata/echodata.py @@ -14,6 +14,7 @@ if TYPE_CHECKING: from ..core import EngineHint, FileFormatHint, PathHint, SonarModelsHint +from ..echodata.utils_platform import _clip_by_time_dim, get_mappings_expanded from ..utils.coding import sanitize_dtypes, set_time_encodings from ..utils.io import check_file_existence, delete_zarr_store, sanitize_file_path from ..utils.log import _init_logger @@ -353,61 +354,6 @@ def update_platform( obs_dim = list(extra_platform_data[time_dim].dims)[0] extra_platform_data = extra_platform_data.swap_dims({obs_dim: time_dim}) - def _extvar_properties(ds, name): - """Test the external variable for presence and all-nan values, - and extract its time dimension name. - Returns , ,