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

Centralize/generalize declaration of convention attributes #493

Merged
merged 6 commits into from
Dec 3, 2021

Conversation

emiliom
Copy link
Collaborator

@emiliom emiliom commented Nov 14, 2021

This is a demonstration step for centralizing where coordinate and variable attributes are declared. Moving in this direction will make it easier and more robust to maintain adherence to the convention.

Not ready for merging. Though it completes all tests, this PR is intended as a demonstration for discussion.

Sorry for the clutter, but it also contains changes from PR #492, which is not merged yet; those are all in echopype/echodata/echodata.py alone.

Partially addresses #373 (adds range_bin attributes, but not a description in the docs).

@emiliom emiliom added enhancement This makes echopype better data format Anything about data format labels Nov 14, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2021

Codecov Report

Merging #493 (6449630) into dev (d996e28) will decrease coverage by 7.00%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #493      +/-   ##
==========================================
- Coverage   77.13%   70.12%   -7.01%     
==========================================
  Files          39       23      -16     
  Lines        3415     2638     -777     
==========================================
- Hits         2634     1850     -784     
- Misses        781      788       +7     
Flag Coverage Δ
unittests 70.12% <60.00%> (-7.01%) ⬇️

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

Impacted Files Coverage Δ
echopype/convert/set_groups_base.py 84.28% <ø> (-3.04%) ⬇️
echopype/echodata/convention/attrs.py 0.00% <0.00%> (ø)
echopype/echodata/echodata.py 61.23% <0.00%> (-27.32%) ⬇️
echopype/convert/set_groups_azfp.py 98.21% <100.00%> (+0.03%) ⬆️
echopype/convert/set_groups_ek60.py 91.26% <100.00%> (+0.08%) ⬆️
echopype/convert/set_groups_ek80.py 94.32% <100.00%> (-1.39%) ⬇️
echopype/__init__.py 0.00% <0.00%> (-100.00%) ⬇️
echopype/echodata/__init__.py 0.00% <0.00%> (-100.00%) ⬇️
echopype/echodata/convention/__init__.py 0.00% <0.00%> (-100.00%) ⬇️
echopype/echodata/api.py 16.66% <0.00%> (-66.67%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d996e28...6449630. Read the comment docs.

@emiliom emiliom marked this pull request as draft November 14, 2021 19:45
@emiliom
Copy link
Collaborator Author

emiliom commented Nov 19, 2021

TODO: Change from using the attribute definitions in attrs.py to reading it dynamically from a yaml file.

@emiliom emiliom marked this pull request as ready for review December 2, 2021 21:13
@emiliom emiliom added this to the 0.5.5 release milestone Dec 3, 2021
@emiliom
Copy link
Collaborator Author

emiliom commented Dec 3, 2021

I resolved the merge conflict we saw today. But: @leewujung & @lsetiawan : a test failed with this PR. When I first created the PR 19 days ago, all tests were successful. The error occurs with test_convert_ek80_cw_bb_in_single_file, and involves a failure to find a raw file:

E           FileNotFoundError: There is no file named Summer2018--D20180905-T033113.raw

I don't see how that could be caused by the changes in this PR, so my guess is that it has to do with something else altogether. Has there been a change in the availability of EK80 test files in the last ~24 hours (eg, related to #498)? I'm hoping this is a transient hiccup. Could either of you take a quick look to diagnose if it looks like it's an external problem that will be addressed elsewhere?

If the problem persists into tomorrow and it's hard to diagnose, let's skip this PR for 0.5.5.

@leewujung
Copy link
Member

Oops, that's my fault, as part of the work for #498. It's a tiny _ vs - that took me half an hour to debug out... and I forgot to rename the file in the CI_test_data folder. It should run now.

@leewujung
Copy link
Member

Also, @emiliom there seems to be some unused import thing found by the pre-commit.ci bot. Could you check on those?

Remove unused imports (flake8 fix)
Remove unused imports (flake8 fix)
@emiliom
Copy link
Collaborator Author

emiliom commented Dec 3, 2021

Oops, that's my fault, as part of the work for #498. It's a tiny _ vs - that took me half an hour to debug out... and I forgot to rename the file in the CI_test_data folder. It should run now.

Thanks! Good for me, bad for you

Also, @emiliom there seems to be some unused import thing found by the pre-commit.ci bot. Could you check on those?

Nice catch. I'll admit that I had ignored the pre-commit failures altogether. I've fixed it.

@leewujung leewujung closed this Dec 3, 2021
@leewujung leewujung reopened this Dec 3, 2021
@leewujung
Copy link
Member

Ok this is ready to merge now. Thanks @emiliom!

@leewujung leewujung merged commit 54053c3 into OSOceanAcoustics:dev Dec 3, 2021
@emiliom emiliom deleted the generalize_conv branch December 10, 2021 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data format Anything about data format enhancement This makes echopype better
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants