Skip to content

enh: add dimension alignment support for swap_dims_channel_frequency#1500

Closed
praneethratna wants to merge 3 commits into
echostack-org:mainfrom
praneethratna:iss_1488_dimension
Closed

enh: add dimension alignment support for swap_dims_channel_frequency#1500
praneethratna wants to merge 3 commits into
echostack-org:mainfrom
praneethratna:iss_1488_dimension

Conversation

@praneethratna
Copy link
Copy Markdown
Contributor

Addresses #1488 and swap_dims_channel_frequency now supports dimension alignment.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 17, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.92%. Comparing base (9f56124) to head (cb17006).
⚠️ Report is 387 commits behind head on main.

Files with missing lines Patch % Lines
echopype/consolidate/api.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1500       +/-   ##
===========================================
+ Coverage   83.52%   94.92%   +11.39%     
===========================================
  Files          64        5       -59     
  Lines        5686      315     -5371     
===========================================
- Hits         4749      299     -4450     
+ Misses        937       16      -921     
Flag Coverage Δ
unittests 94.92% <50.00%> (+11.39%) ⬆️

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.

@praneethratna praneethratna requested a review from leewujung May 17, 2025 18:09
- Winter2017-D20170115-T150122.raw: Contains a change of recording length in the middle of the file
- 2015843-D20151023-T190636.raw: Not used in tests but contains ranges are not constant across ping times
- SH1701_consecutive_files_w_range_change: Not used in tests. [Folder](https://drive.google.com/drive/u/1/folders/1PaDtL-xnG5EK3N3P1kGlXa5ub16Yic0f) on shared drive that contains sequential files with ranges that are not constant across ping times.
- NBP_B050N-D20180118-T090228.raw: split-beam setup without angle data
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure why these keep on happening (I found these on my local machine too. I think it might be due to me not setting up the docker container again and just working with the files I already have, so the new ones did not get pulled in). Could you please put these lines back? Thanks!

Comment on lines 463 to +468
if "channel" not in source_Sv.variables:
raise ValueError("The input source_Sv Dataset must have a channel dimension!")

# Select ds_beam channels from source_Sv
# Swap the dimension to frequency_nominal if use_frequency_nominal is True
if use_frequency_nominal:
source_Sv = swap_dims_channel_frequency(source_Sv)
Copy link
Copy Markdown
Member

@leewujung leewujung May 22, 2025

Choose a reason for hiding this comment

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

What I was thinking was to make the add_splitbeam_angle function agnostic of whether in the input ds_Sv dataset has a dimension of channel or frequency_nominal. So the function will work with the original dimension (channel) straight from compute_Sv, and will also work if the dimension has already been changed to frequency_nominal before the add_splitbeam_angle function is called. So not running the swap_dims_channel_frequency under the hood within this function, but made this functions accepts ds_Sv with either dimensions.

Does the above make sense to you? So basically you can remove the added use_frequency_nominal argument and just have the function accepting both channel and frequency_nominal under the hood.

Copy link
Copy Markdown
Member

@leewujung leewujung left a comment

Choose a reason for hiding this comment

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

@praneethratna : I checked the changes and elaborated more on the intention of the issue. Let me know if this comment clarifies it! Thanks!

@dbashford-NOAA
Copy link
Copy Markdown
Collaborator

@leewujung I'm not sure what's left to address in this issue. It seems like my PR #1520 which resolves #1488 also applies to this issue. Let me know if I'm missing something in this issue though.

@leewujung
Copy link
Copy Markdown
Member

@dbashford-NOAA - oh that's true, I guess that didn't register because I haven't reviewed #1520. I'll try to get to that tomorrow. Thanks!

@leewujung
Copy link
Copy Markdown
Member

Closing this as it is superseded by #1520.

@leewujung leewujung closed this Sep 7, 2025
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.

4 participants