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

Overhaul access pattern [all tests ci] #762

Merged
merged 13 commits into from
Aug 10, 2022

Conversation

lsetiawan
Copy link
Member

@lsetiawan lsetiawan commented Jul 8, 2022

This PR overhauls the old attribute based access pattern in favor of path key access pattern for EchoData.

Resolves #708

@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2022

Codecov Report

Merging #762 (182852a) into dev (0095f15) will decrease coverage by 0.15%.
The diff coverage is 94.36%.

@@            Coverage Diff             @@
##              dev     #762      +/-   ##
==========================================
- Coverage   82.33%   82.18%   -0.16%     
==========================================
  Files          46       48       +2     
  Lines        4240     4249       +9     
==========================================
+ Hits         3491     3492       +1     
- Misses        749      757       +8     
Flag Coverage Δ
unittests 82.18% <94.36%> (-0.16%) ⬇️

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

Impacted Files Coverage Δ
echopype/echodata/combine.py 90.32% <76.47%> (+0.40%) ⬆️
echopype/calibrate/api.py 81.63% <100.00%> (ø)
echopype/calibrate/calibrate_azfp.py 96.22% <100.00%> (ø)
echopype/calibrate/calibrate_ek.py 94.28% <100.00%> (ø)
echopype/calibrate/env_params.py 92.98% <100.00%> (ø)
echopype/convert/api.py 84.78% <100.00%> (ø)
echopype/echodata/echodata.py 80.87% <100.00%> (-2.90%) ⬇️
echopype/consolidate/api.py 90.90% <0.00%> (ø)
echopype/consolidate/__init__.py 100.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lsetiawan lsetiawan marked this pull request as ready for review July 8, 2022 23:01
@lsetiawan lsetiawan requested a review from leewujung July 8, 2022 23:02
@lsetiawan lsetiawan self-assigned this Jul 8, 2022
@lsetiawan lsetiawan added this to the 0.6.2 milestone Jul 8, 2022
Copy link
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.

Hey @lsetiawan : thanks for the PR! Sorry it took me forever to get to this.

The PR looks great, there's just this repeated block that handles whether beam is connected to echodata["Sonar/Beam_group1"] or echodata["Sonar/Beam_group2"] that I feel the if/else + try/except logic should be a little different. See what you think, it is possible that I misunderstood something.

@lsetiawan
Copy link
Member Author

@leewujung This is now ready for your final review hopefully 😄

@leewujung
Copy link
Member

Awesome, thanks! I think once it's merged there would be some conflicts popping up for #774. Since you have both on your mind, perhaps it won't be so bad!

Comment on lines +284 to +288
try:
ed['SomeRandomGroup'] = 'Testing value'
except Exception as e:
assert isinstance(e, GroupNotFoundError)

Copy link
Member

Choose a reason for hiding this comment

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

I like this!

Copy link
Member

Choose a reason for hiding this comment

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

@b-reyes : the test_setitem and test_getitem are the type of unit tests I was thinking for the changes you made in #774. Just making a note here as it came to my mind while reviewing this. We can circle back to that and your ideas in our tests-hackday!

Copy link
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.

@lsetiawan : I think this PR is ready to be merged! Just had a minor suggestion on a comment. It is nice to see how changing the getitem output to None makes the code so much cleaner to read.

Co-authored-by: Wu-Jung Lee <leewujung@gmail.com>
@leewujung leewujung merged commit de13aea into OSOceanAcoustics:dev Aug 10, 2022
@lsetiawan lsetiawan deleted the overhaul_access branch August 10, 2022 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants