-
Notifications
You must be signed in to change notification settings - Fork 3
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 interpolation routine to make Var.resampled_as
faster
#183
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #183 +/- ##
==========================================
+ Coverage 98.19% 98.31% +0.11%
==========================================
Files 12 13 +1
Lines 1220 1302 +82
==========================================
+ Hits 1198 1280 +82
Misses 22 22 ☔ View full report in Codecov by Sentry. |
5e3c3be
to
d4e432a
Compare
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.
Could you also move all the linear interpolation into its own module, so that it will be easier in the future to switch it to something else?
2037384
to
25c7808
Compare
This commit adds an interpolation routine for use in ClimaAnalysis, which seeks to replace Interpolations.jl in Var.jl. The interpolation routine supports N-dimensional linear interpolation on a grid with throw, flat, or periodic boundary conditions. Compared against Interpolations.jl, the interpolation routine does not make a struct and does not allocate anything on the heap when interpolating a point.
This commit removes Interpolations.jl from Var.jl. To do this, the function `_make_interpolant` was removed. Three new functions are added which are `_check_interpolant`, `interpolate_point`, and `interpolate_points`, where the latter two functions replace the functionality of `_make_interpolant`. Furthermore, the function `_find_extp_bound_cond` was refactored to `_find_extp_bound_conds` which find multiple extrapolation condtions using `_find_extp_bound_cond` which is refactored to find the extrapolation condition for a single point. All functions that use an interpolant are updated to use the new interpolation routine. The test for computing the bias in Atmos changes to check approximately close to 0.0, due to floating point errors. The tests that check for errors when interpolating out of bounds now check for ErrorException instead of BoundsError.
closes #182 - This commit adds an interpolation routine that makes
resampled_as
and any other functions that use interpolations faster.Checklist
OutputVar
s (see issue on ClimaCoupler)Benchmarks from
@time
The image below is from the current postprocessing pipeline using the latest commit on main.
The image below is from the current postprocessing pipeline using this PR.