-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Bug]: cosp_histogram_standardize()
conditional for adding bounds is incorrect and default bounds length might not align with coordinates
#761
Comments
Hi @chengzhuzhang, I believe I found a bug in the old version of I might need help understanding the logic for the function that dynamically generates bounds (e.g., use coordinates as midpoints?). |
Apologize for missing out this bug report! It is an interesting silence bug. And it almost suggests that the bounds are never used in the downstream calculation? I will have to look more. |
As far as I can tell, the old CDAT version of cosp_histogram_standardize() and cosp_histogram_driver.py don't reference prs or tau bounds for any calculations. |
Hi Tom. I agree with your assessment that the cosp_histogram_standardize() are never actually used in the cdat version of the code. The conditions such as |
Thanks for investigating @chengzhuzhang. We can simplify the codebase by removing this function since it doesn't seem necessary to keep. Bounds are not used for calculations and you confirmed that newer model data and reference data have bounds (your comment). |
What happened?
In PR #748, I found a silent bug in a conditional statement for handling bounds in
cosp_histogram_standardize()
.e3sm_diags/e3sm_diags/derivations/acme.py
Lines 552 to 565 in 633b52c
The conditional follows this flow:
- Issue: bounds are never added for the coordinates that don't actually have bounds
- Issue: the default bounds length (
cloud_prs_bounds
) might not align with the length of the coordinates, resulting in this error:ValueError: conflicting sizes for dimension 'misr_cth': length 7 on the data but length 16 on coordinate 'misr_cth'
What did you expect to happen? Are there are possible answers you came across?
In my version of the code, I get the "bounds" attr AND check if the bounds actually exist in the dataset.
If bounds don't exist in the dataset, bounds should be dynamically generated to align with the length of the coordinates instead of using a fixed bounds array (I think?).
Minimal Complete Verifiable Example (MVCE)
Relevant log output
No response
Anything else we need to know?
No response
Environment
Latest
main
version of e3sm_diags and all previous versions that use thecosp_histogram_standarize()
function.The text was updated successfully, but these errors were encountered: