Skip to content

Fix inbounds check for Albers projections.#338

Closed
jamesrhester wants to merge 1 commit intoJuliaEarth:mainfrom
jamesrhester:fix_albers_inbounds
Closed

Fix inbounds check for Albers projections.#338
jamesrhester wants to merge 1 commit intoJuliaEarth:mainfrom
jamesrhester:fix_albers_inbounds

Conversation

@jamesrhester
Copy link
Copy Markdown
Contributor

@jamesrhester jamesrhester commented Jan 2, 2026

The previous inbounds check for Albers projections flagged an error on receiving a negative return value for _ambersρ, that is, after taking the square root and dividing by a potentially valid negative number. The forward function also used the same check. The exit on negative value should have been before taking the square root in _ambersρ. This pull request replaces the original checks with a check for a DomainError arising from the _ambersρ call. No check is inserted in _ambersρ, so that in can execute more efficiently in the more likely case that the values it is provided are within the valid domain.

The previous inbounds check checked for a negative value after
taking the square root and dividing by a possibly negative
number, instead of before the square root.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.05%. Comparing base (e65f137) to head (389b219).

Files with missing lines Patch % Lines
src/crs/projected/albers.jl 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #338      +/-   ##
==========================================
- Coverage   92.15%   92.05%   -0.10%     
==========================================
  Files          40       40              
  Lines        1809     1812       +3     
==========================================
+ Hits         1667     1668       +1     
- Misses        142      144       +2     

☔ 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.

@juliohm
Copy link
Copy Markdown
Member

juliohm commented Jan 2, 2026

Closing in favor of #337

@juliohm juliohm closed this Jan 2, 2026
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.

3 participants