-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add PathNotFoundError in _load_convert for open_converted #447
Add PathNotFoundError in _load_convert for open_converted #447
Conversation
I don't remember if it's |
Right now on initialization EchoData this is done: echopype/echopype/echodata/echodata.py Lines 113 to 115 in d9405a4
which pulls all keys in group_map created from _get_convention echopype/echopype/echodata/echodata.py Line 37 in d9405a4
I think the latter is you 😄 , but it doesn't matter. Unless there's anything missing in this sequence, I am pretty sure this is correct. |
Although, from the CI test failure, it seems that things may be handled differently on different platforms re what it means to have/no have a group, and whether there is anything in the path or group... I'll try adding GroupNotFoundError back in. If this fails, I'll have to properly set up the tests locally. 😛 |
Codecov Report
@@ Coverage Diff @@
## dev #447 +/- ##
==========================================
- Coverage 76.74% 76.64% -0.10%
==========================================
Files 38 5 -33
Lines 3324 334 -2990
==========================================
- Hits 2551 256 -2295
+ Misses 773 78 -695
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
* re-attach sonar_model to combined echodata object (#437) * Correct duplicate ping_times during EK60 conversion (fixes #235) (#433) * Add fix for duplicate ping_time * Remove dead code * Increment by 1ns instead of 1ms * Add duplicate ping time warning and store in provenance * Autoformatter * Add test for duplicate ping times file * Add qc method to remove duplicate pings * Drop entire pings with duplicate values * Store entire original ping_time and add attribute when there are duplicate ping_times * Remove duplicate ping_time qc method, it will be added back in future PR * Change EchoData combine ping_time reversal attribute to netCDF encodable value * Remove unused import * Update tests * Clarify duplicate ping_time removal and drop warnings * Add removal note to deprecation warnings (#443) * Add removal note to deprecation warnings * Say removal will be specifically in next release * AD2CP conversion bug fixes (#438) * Allow strings in AD2CP config string data record * Add ping_time dimension to ahrs variables * Default AHRS to empty list instead of None * Change AHRS dims when it does not exist * Add update_platform method to EchoData (#434) * Add update_platform method to EchoData * Add test for update_platform * Use drop_vars instead of drop * Use .data on variables * Generalize extra_platform_data time dimension name * Add AZFP support * Generalized update_platform handling of CF trajectory-encoded datasets * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Default water_level to zeros instead of ones * Add warning for overwritten variables * Index incoming data by time2 * Add long_name for time2 * Show dropped variable warning when nans do not exist * Reword dropped variable warning * Rename mapping_get_multiple to mapping_search_variable Co-authored-by: Emilio Mayorga <emiliomayorga@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Add summary statistics (#444) * initial add of echo metrics functions * update echo metrics to use range as data variable * small readability edit * added test functions to echopype.tests * Modified syntax for consistency * lint corrections on metrics * added docstrings * changed summary_statistics.py docstrings to numpy format * Clean up tabs in code * Clean up tabs in test code * add metrics to run-test.py * renamed test_metrics_summary_statistics * small debug edits * pre commit black edits * moved test_metrics_summary_statistics.py to /tests/metrics/ * docstring update, add typing, change inertia to dispersion * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: stuara <stuara@uw.edu> Co-authored-by: Landung "Don" Setiawan <landung.setiawan@gmail.com> Co-authored-by: stuara <83487347+stuara@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Prepare workflows for master -> main (#445) * Add PathNotFoundError in _load_convert for open_converted (#447) * add PathNotFoundError in _load_convert for open_converted Co-authored-by: imranmaj <49664304+imranmaj@users.noreply.github.com> Co-authored-by: Emilio Mayorga <emiliomayorga@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: stuara <stuara@uw.edu> Co-authored-by: Landung "Don" Setiawan <landung.setiawan@gmail.com> Co-authored-by: stuara <83487347+stuara@users.noreply.github.com> Co-authored-by: Landung "Don" Setiawan <landungs@uw.edu>
open_converted
failed on opening Zarr file without thebeam_power
group. The allowed exceptionGroupNotFoundError
appears to only work for netCDF files but not with Zarr files:Adding
PathNotFoundError
resolved the problem.I also tested the case to only use
PathNotFoundError
withoutGroupNotFoundError
and that works for both local netCDF and Zarr files.From the zarr code here
/~https://github.com/zarr-developers/zarr-python/blob/master/zarr/errors.py
GroupNotFoundError
is for when "group not found at path {0!r}"and
PathNotFoundError
is for when "nothing found at path {0!r}"@imranmaj @lsetiawan : If I understand correctly right now the
beam_power
group is always created regardless of the sonar_model, but may be empty. So, there will be no case with exceptionGroupNotFoundError
. Is this correct?The current PR replaces
GroupNotFoundError
withPathNotFoundError
.