echopype icon indicating copy to clipboard operation
echopype copied to clipboard

Added support for split-beam angle computation with mixed channel beam types in complex mode

Open beatfactor opened this issue 8 months ago • 8 comments

This PR adds support for computing split-beam angles in datasets where only a subset of channels have valid beam_type values (e.g., beam_type = 1, 17, 49, 65, 81). It applies specifically to CW complex data.

Previously, the presence of an unsupported beam_type would raise a ValueError.

Changes:

  • updated get_angle_complex_samples() to process each channel individually if beam_type is not uniform;
  • skips channels with unsupported beam_type values and logs a warning instead of failing.

beatfactor avatar Apr 20 '25 14:04 beatfactor

I couldn't figure out how to download the test data used in the existing tests, so the test file used in the unit test from this PR is a best guess.

beatfactor avatar Apr 21 '25 14:04 beatfactor

@beatfactor: the first command in this section will pull all the test files down, and you can stop the other services afterwards.

leewujung avatar Apr 24 '25 03:04 leewujung

@leewujung Thanks, I managed to download the data by avoiding running the compose script and I added a small script download_test_data.py which only runs the docker container and then copies the test data. Maybe it's useful, but if not I can remove it from this PR.

Lastly, I'm not sure about the check for dask arrays in the _compute_angle_from_complex function but without that the whole function fails when using dask. Also I tried to avoid doing compute to keep the processing lazy. Let me know if there's a better way to handle this or you have another preference.

beatfactor avatar Apr 24 '25 16:04 beatfactor

hey @leewujung, any updates here? could you re-trigger the build please?

beatfactor avatar May 12 '25 11:05 beatfactor

@beatfactor : Thanks for the reminder - I just re-triggered the tests and looks like everything runs fine.

I am pretty swamped for the past weeks and hopefully will be able to look at the code changes later next week.

leewujung avatar May 12 '25 21:05 leewujung

@beatfactor : somehow the pre-commit.ci pushes were skipped. Could you please add the suggested changes into the code?

leewujung avatar May 12 '25 21:05 leewujung

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Project coverage is 23.26%. Comparing base (9f56124) to head (59289da). Report is 206 commits behind head on main.

Files with missing lines Patch % Lines
echopype/consolidate/split_beam_angle.py 92.30% 2 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1492       +/-   ##
===========================================
- Coverage   83.52%   23.26%   -60.26%     
===========================================
  Files          64       72        +8     
  Lines        5686     6633      +947     
===========================================
- Hits         4749     1543     -3206     
- Misses        937     5090     +4153     
Flag Coverage Δ
unittests 23.26% <92.30%> (-60.26%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov-commenter avatar May 13 '25 00:05 codecov-commenter

@beatfactor : somehow the pre-commit.ci pushes were skipped. Could you please add the suggested changes into the code?

Ok, done. Yes, it seems that the build won't push the changes if the PR is sent from a Github organization, which it is in this case. Thanks!

beatfactor avatar May 13 '25 07:05 beatfactor