Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 27, 2025
1 parent b01c590 commit 48e9528
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gpm/bucket/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_list_overpass_time(timesteps, interval=None):
# Check interval
if interval is None:
interval = np.array(60, dtype="m8[m]")

# Check timesteps
# - Ensure numpy.datetime64
timesteps = np.unique(timesteps)
Expand All @@ -48,16 +48,16 @@ def get_list_overpass_time(timesteps, interval=None):
# Deal with edge cases
if len(timesteps) == 0:
raise ValueError("No timesteps available.")

if len(timesteps) == 1:
return [(timesteps[0], timesteps[0])]

# Compute time difference
time_diff = np.diff(timesteps)

# Initialize
list_time_periods = []
current_start_time = timesteps[0]
current_start_time = timesteps[0]
for i, dt in enumerate(time_diff):
if i == 0:
continue
Expand All @@ -66,8 +66,8 @@ def get_list_overpass_time(timesteps, interval=None):
time_period = (current_start_time, end_time)
list_time_periods.append(time_period)
# Update
current_start_time = timesteps[i+1]
current_start_time = timesteps[i + 1]

# Add the final group

Check notice on line 71 in gpm/bucket/analysis.py

View check run for this annotation

codefactor.io / CodeFactor

gpm/bucket/analysis.py#L71

Unresolved comment '# TODO: drop column with missing time'. (C100)
list_time_periods.append((current_start_time, timesteps[-1]))
return list_time_periods
Expand Down

0 comments on commit 48e9528

Please sign in to comment.