Skip to content

Commit

Permalink
Merge pull request #873 from uber/revert-872-871-fit-method-fail-for-…
Browse files Browse the repository at this point in the history
…timezone-aware-timeseries

Revert "Quick fix 871"
  • Loading branch information
edwinnglabs authored Jul 9, 2024
2 parents cde4167 + 7189100 commit 489ffd1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions orbit/utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ def update_dict(original_dict, append_dict):


def is_ordered_datetime(array):
"""Returns True if array is ordered and non-repetitive
Use pandas .diff() method to take care of both tz and non-tz series consistently
By default pandas .diff() would generate a NaT for the first period
instead of skipping like np.diff. So dropna() to remove.
"""
diff = array.to_series().diff().dropna().values
return np.all(diff.astype(float) > 0)
"""Returns True if array is ordered and non-repetitive"""
return np.all(np.diff(array).astype(float) > 0)


def is_even_gap_datetime(array):
Expand Down

0 comments on commit 489ffd1

Please sign in to comment.