Skip to content

refactor: interp2d now uses grid_sample where possible#375

Open
ConnorStoneAstro wants to merge 4 commits intodevfrom
fastinterp
Open

refactor: interp2d now uses grid_sample where possible#375
ConnorStoneAstro wants to merge 4 commits intodevfrom
fastinterp

Conversation

@ConnorStoneAstro
Copy link
Copy Markdown
Member

No description provided.

@codecov
Copy link
Copy Markdown

codecov bot commented May 24, 2025

Codecov Report

Attention: Patch coverage is 83.82353% with 11 lines in your changes missing coverage. Please review.

Project coverage is 92.28%. Comparing base (896f7b5) to head (5c4cba7).

Files with missing lines Patch % Lines
src/caustics/utils.py 75.00% 10 Missing ⚠️
src/caustics/lenses/pixelated_convergence.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #375      +/-   ##
==========================================
- Coverage   93.76%   92.28%   -1.48%     
==========================================
  Files          57       57              
  Lines        2599     2619      +20     
==========================================
- Hits         2437     2417      -20     
- Misses        162      202      +40     
Flag Coverage Δ
unittests 92.28% <83.82%> (-1.48%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ConnorStoneAstro ConnorStoneAstro requested a review from rouzib May 24, 2025 00:20
Copy link
Copy Markdown
Collaborator

@rouzib rouzib left a comment

Choose a reason for hiding this comment

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

I went throught my own tests comparing the output of the changed functions as well as their gradient. All my tests remain consistent between the current main branch and the new fast interp2d.

Should we expose the interpolation mode in the lenses to the user? If so, we could add the bicubic mode as an option.

Changes:

  1. Removed "extrapolate" and "clamp" as a padding_mode option since "extrapolate" is not supported by the old_interp2d and "clamp" is not supported by grid_sample.
  2. Updated interp2d documentation.

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