Skip to content

Changing rotation_angle to output in radians instead of degrees#5280

Merged
jlk9 merged 5 commits intomainfrom
jlk9/rotation-angle-radians
Feb 11, 2026
Merged

Changing rotation_angle to output in radians instead of degrees#5280
jlk9 merged 5 commits intomainfrom
jlk9/rotation-angle-radians

Conversation

@jlk9
Copy link
Copy Markdown
Collaborator

@jlk9 jlk9 commented Feb 11, 2026

This PR modifies the function rotation_angle to output the angle θ in radians instead of degrees. It also modifies method definitions of intrinsic_vector and extrinsic_vector for OrthogonalSphericalShellGrid, since these use rotation_angle as a helper, and modifies the unit test for rotation_angles to use angles in radians.

This PR is made as a response to this issue: CliMA/ClimaOcean.jl#749

In some contexts these functions can be called within GPU/Reactant kernels. Currently they rely on the functions sind, cosd, and atand which do not work in GPU kernels. By switching to radians we bypass that problem.

@glwagner
Copy link
Copy Markdown
Member

I'd also be ok if you omit the _radians suffix to reduce noise. It's not clear why a future dev would expect degrees (unless one in a conoisseur in Oceananigans history, and remembers this specific series of issues and PRs)

@siddharthabishnu
Copy link
Copy Markdown
Contributor

I'm hoping this also resolves the issue in PR #5183.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.51%. Comparing base (0b02506) to head (37fd9f6).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5280      +/-   ##
==========================================
+ Coverage   68.79%   73.51%   +4.72%     
==========================================
  Files         395      395              
  Lines       21463    22190     +727     
==========================================
+ Hits        14765    16313    +1548     
+ Misses       6698     5877     -821     
Flag Coverage Δ
buildkite 68.79% <100.00%> (ø)
julia 68.79% <100.00%> (ø)

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.

@jlk9 jlk9 merged commit 6c4cc58 into main Feb 11, 2026
80 checks passed
@jlk9 jlk9 deleted the jlk9/rotation-angle-radians branch February 11, 2026 23:25
@giordano giordano added the breaking change 💔 Concerning a change which breaks the API label Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change 💔 Concerning a change which breaks the API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants