Skip to content
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

feat: Add numba harmonic mean implementation #194

Merged
merged 7 commits into from
Dec 4, 2023
Merged

feat: Add numba harmonic mean implementation #194

merged 7 commits into from
Dec 4, 2023

Conversation

lsetiawan
Copy link
Member

Added '_sv_harmon_mean' numba implementation for
calculating harmonic mean that uses calculations
used within the original fortran code to get same
harmonic values. Now there's a 'method' value for the main 'sv_harmonic_mean' function that allows user
to switch back and forth b/w the two methods.


Ref #193

Added '_sv_harmon_mean' numba implementation for
calculating harmonic mean that uses calculations
used within the original fortran code to get same
harmonic values. Now there's a 'method' value for the
main 'sv_harmonic_mean' function that allows user
to switch back and forth b/w the two methods.

---

Ref #193
@lsetiawan lsetiawan linked an issue Dec 1, 2023 that may be closed by this pull request
Separate out value testing for the two methods of computing
harmonic mean. The fortran values are obtained from
previous discussions at #66 (comment).
Add simple test for using the new '_sv_harmon_mean'
function on dummy arrays.
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Attention: 23 lines in your changes are missing coverage. Please review.

Comparison is base (32ab8b6) 50.98% compared to head (57432f3) 50.60%.
Report is 1 commits behind head on main.

Files Patch % Lines
src/gnatss/harmonic_mean.py 52.08% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
- Coverage   50.98%   50.60%   -0.38%     
==========================================
  Files          16       16              
  Lines         865      905      +40     
==========================================
+ Hits          441      458      +17     
- Misses        424      447      +23     

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

Added a raise NotImplementedError for any other
harmonic mean methods that is neither "scipy"
nor "numba".
@lsetiawan lsetiawan self-assigned this Dec 1, 2023
@lsetiawan lsetiawan requested a review from carlosgjs December 1, 2023 23:09
Copy link
Contributor

@carlosgjs carlosgjs left a comment

Choose a reason for hiding this comment

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

LGTM. Some inline questions, sugggestions.

src/gnatss/harmonic_mean.py Outdated Show resolved Hide resolved
src/gnatss/harmonic_mean.py Outdated Show resolved Hide resolved
src/gnatss/harmonic_mean.py Outdated Show resolved Hide resolved
src/gnatss/harmonic_mean.py Show resolved Hide resolved
src/gnatss/harmonic_mean.py Outdated Show resolved Hide resolved
@lsetiawan lsetiawan merged commit a5537f8 into seafloor-geodesy:main Dec 4, 2023
4 of 5 checks passed
@lsetiawan lsetiawan deleted the fix_193 branch December 4, 2023 19:56
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.

GNATSS Results off by a large difference of >2cm!
2 participants