Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event Detection methods are raising FutureWarning #246

Closed
jarq6c opened this issue Feb 9, 2024 · 3 comments · Fixed by #247
Closed

Event Detection methods are raising FutureWarning #246

jarq6c opened this issue Feb 9, 2024 · 3 comments · Fixed by #247
Assignees
Labels
bug Something isn't working

Comments

@jarq6c
Copy link
Collaborator

jarq6c commented Feb 9, 2024

Running hydrotools.events.event_detection.decomposition.list_events results in several FutureWarning from pandas.

from hydrotools.events.event_detection.decomposition import list_events

events = list_events(
    df['value'],
    halflife='6H', 
    window='7D',
    minimum_event_duration='6H',
    start_radius='7H'
)
miniconda3/lib/python3.10/site-packages/hydrotools/events/event_detection/decomposition.py:117: FutureWarning: 'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.
  smooth = series.ewm(halflife=halflife, times=series.index,
miniconda3/lib/python3.10/site-packages/hydrotools/events/event_detection/decomposition.py:261: FutureWarning: 'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.
  minimum_event_duration = pd.Timedelta(minimum_event_duration)
miniconda3/lib/python3.10/site-packages/hydrotools/events/event_detection/decomposition.py:262: FutureWarning: 'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.
  start_radius = pd.Timedelta(start_radius)
miniconda3/lib/python3.10/site-packages/hydrotools/events/event_detection/decomposition.py:156: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  forward_shift = event_points.shift(1).fillna(False)
miniconda3/lib/python3.10/site-packages/hydrotools/events/event_detection/decomposition.py:161: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  backward_shift = event_points.shift(-1).fillna(False)
miniconda3/lib/python3.10/site-packages/hydrotools/events/event_detection/decomposition.py:156: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  forward_shift = event_points.shift(1).fillna(False)
miniconda3/lib/python3.10/site-packages/hydrotools/events/event_detection/decomposition.py:161: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  backward_shift = event_points.shift(-1).fillna(False)
@jarq6c jarq6c added the bug Something isn't working label Feb 9, 2024
@jarq6c jarq6c self-assigned this Feb 9, 2024
@jarq6c
Copy link
Collaborator Author

jarq6c commented Feb 9, 2024

@aaraney @hellkite500 @christophertubbs FYI: Ran into this warning while fixing this issue.

DeprecationWarning: 
  Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0)

@aaraney
Copy link
Member

aaraney commented Feb 9, 2024

Hmmm, thanks for bringing this to our attention. I don't know if this will effect us or not? This might be hard to track, but my suggestion would be that we test against pandas release candidates once they release >=3.x. Thoughts?

@jarq6c
Copy link
Collaborator Author

jarq6c commented Feb 9, 2024

Hmmm, thanks for bringing this to our attention. I don't know if this will effect us or not? This might be hard to track, but my suggestion would be that we test against pandas release candidates once they release >=3.x. Thoughts?

Maybe a good idea for reasons other than the PyArrow dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants