Skip to content

Conversation

@rhaegar325
Copy link
Collaborator

@rhaegar325 rhaegar325 commented Jan 13, 2026

Add Generic Calculation Functions for Ocean Variable Processing

What

Added generic calculation helper functions to standardize variable transformations:

  • power(var, exponent) - Generic exponentiation (e.g., var**2)
  • multiply(var, factor) - Scalar multiplication (e.g., unit conversion)
  • sum_vertical(var, dim) - Vertical dimension integration

Also organized existing ocean calculation functions:

  • K_degC(ctx, var, inverse) - Temperature unit conversion

Files Modified

  • src/access_mopper/calc_util.py - New generic functions
  • src/access_mopper/calc_ocean.py - Organized ocean-specific functions

Notes

✅ No breaking changes - functions are additive
✅ Backward compatible with existing code
✅ Tested with sample ocean model data

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.34%. Comparing base (0eb8d0e) to head (234f15e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/access_moppy/derivations/calc_ocean.py 0.00% 12 Missing ⚠️
src/access_moppy/derivations/calc_utils.py 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #167      +/-   ##
==========================================
+ Coverage   52.02%   60.34%   +8.32%     
==========================================
  Files          18       19       +1     
  Lines        2722     2749      +27     
==========================================
+ Hits         1416     1659     +243     
+ Misses       1306     1090     -216     

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

@rhaegar325 rhaegar325 requested a review from rbeucher January 13, 2026 04:52
@rbeucher
Copy link
Member

I think we already have standard funtions for this

@rhaegar325
Copy link
Collaborator Author

oops, I missed that one.

@rbeucher rbeucher closed this Jan 13, 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