-
Notifications
You must be signed in to change notification settings - Fork 40
Added Pandas 3 Support #3382
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
base: dev
Are you sure you want to change the base?
Added Pandas 3 Support #3382
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -474,9 +474,8 @@ def process_swe(accumulated_data: xr.Dataset, in_flight_cal_files: list) -> list | |
| accumulated_data["met"] = met | ||
|
|
||
| # Drop any off-nominal SWE groups | ||
| nominal_data = accumulated_data.where( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is concerning to me that upgrading to pandas 3 breaks xarray DataArray.where functionality. This fix seems like a hack to avoid some underlying issue.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue isn't dataset.where(condition, drop=True)was replaced with: dataset.isel(epoch=condition.values)Using
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Very good point. |
||
| accumulated_data["swe_nom_flag"] != 0, | ||
| drop=True, | ||
| nominal_data = accumulated_data.isel( | ||
| epoch=(accumulated_data["swe_nom_flag"] != 0).values | ||
| ) | ||
|
|
||
| # Get total full cycle data available for processing. | ||
|
|
@@ -502,8 +501,8 @@ def process_swe(accumulated_data: xr.Dataset, in_flight_cal_files: list) -> list | |
| grouped = grouped_data.sel(epoch=group_mask) | ||
|
|
||
| # Split into Q1 & Q2 (swe_seq 0-29) and Q3 & Q4 (swe_seq 30-59) | ||
| first_half = grouped.where(grouped["swe_seq"] < 30, drop=True) | ||
| second_half = grouped.where(grouped["swe_seq"] >= 30, drop=True) | ||
| first_half = grouped.isel(epoch=(grouped["swe_seq"] < 30).values) | ||
| second_half = grouped.isel(epoch=(grouped["swe_seq"] >= 30).values) | ||
|
|
||
| # Prepare raw counts separately for both halves | ||
| raw_counts_first_half = prepare_raw_counts(first_half) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bryan-harter is the author of
cdflib. It feels to me like this should be a ticket for adding pandas 3 support tocdflib.