Skip to content

Commit

Permalink
rename function to _nan_timestamp_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
leewujung committed Sep 2, 2023
1 parent 1a818f1 commit 3378e26
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions echopype/convert/set_groups_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def set_platform(self) -> xr.Dataset:
"""Set the Platform group."""
raise NotImplementedError

def _NaT_timestamp_handler(self, time_val) -> List:
def _nan_timestamp_handler(self, time_val) -> List:
"""
Replace NaT in time coordinate to avoid xarray warning.
"""
Expand All @@ -137,7 +137,7 @@ def set_nmea(self) -> xr.Dataset:
raw_nmea = [np.nan]

# Handle potential NaT timestamp for time
time = self._NaT_timestamp_handler(time)
time = self._nan_timestamp_handler(time)

ds = xr.Dataset(
{
Expand Down
2 changes: 1 addition & 1 deletion echopype/convert/set_groups_ek60.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def set_platform(self) -> xr.Dataset:
ch = list(self.sorted_channel.keys())[0]

# Handle potential NaT timestamp for time1 and time2
time1 = self._NaT_timestamp_handler(time1)
time1 = self._nan_timestamp_handler(time1)

ds = xr.Dataset(
{
Expand Down
4 changes: 2 additions & 2 deletions echopype/convert/set_groups_ek80.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ def set_platform(self) -> xr.Dataset:
time2 = np.array(time2) if time2 is not None else [np.nan]

# Handle potential NaT timestamp for time1 and time2
time1 = self._NaT_timestamp_handler(time1)
time2 = self._NaT_timestamp_handler(time2)
time1 = self._nan_timestamp_handler(time1)
time2 = self._nan_timestamp_handler(time2)

# Assemble variables into a dataset: variables filled with nan if do not exist
platform_dict = {"platform_name": "", "platform_type": "", "platform_code_ICES": ""}
Expand Down

0 comments on commit 3378e26

Please sign in to comment.