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

Add check for whether P(z) is bijective or not #188

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

ph-kev
Copy link
Member

@ph-kev ph-kev commented Jan 24, 2025

This PR adds a check for whether P(z) is bijective or not when resampling columns.

src/Atmos.jl Outdated
@@ -22,6 +22,8 @@ Linearly interpolate `var1d` from `origin_pressure` to `target_pressure`.
Note: Values outside of the range are linearly extrapolated
"""
function _resample_column!(dest, var1d, origin_pressure, target_pressure)
!issorted(origin_pressure, lt = !isless) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's many negative in this line and it is a little opaque. Do you need !isless to account for identical values?

@ph-kev ph-kev force-pushed the kp/fixing-leaderboard branch 4 times, most recently from 8cb625e to dab5acb Compare January 24, 2025 18:13
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.18%. Comparing base (9bc3038) to head (b5f127c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #188   +/-   ##
=======================================
  Coverage   98.17%   98.18%           
=======================================
  Files          12       12           
  Lines        1206     1209    +3     
=======================================
+ Hits         1184     1187    +3     
  Misses         22       22           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ph-kev ph-kev force-pushed the kp/fixing-leaderboard branch from dab5acb to c8e8210 Compare January 24, 2025 21:20
@ph-kev ph-kev force-pushed the kp/fixing-leaderboard branch from c8e8210 to b5f127c Compare January 24, 2025 21:32
@ph-kev ph-kev requested a review from Sbozzolo January 24, 2025 22:38
@ph-kev
Copy link
Member Author

ph-kev commented Jan 29, 2025

There is a new function allunique that was released in Julia 1.11, but I think it would fail the downgrade tests if I use it here.

@ph-kev ph-kev merged commit 28823aa into CliMA:main Jan 29, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants