-
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
Added support for consolidate
subpackage functions to accept both in-memory or stored datasets
#1216
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #1216 +/- ##
===========================================
- Coverage 83.29% 62.43% -20.87%
===========================================
Files 64 24 -40
Lines 5675 1621 -4054
===========================================
- Hits 4727 1012 -3715
+ Misses 948 609 -339
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @praneethratna : Thanks for the PR! I only have pretty small comments and a question here.
While going through the changes, I noticed that the use of source_Sv_path
does not make much sense () and that results in the mess in add_splitbeam_angle
that source_Sv
is separately validated outside of open_ds_da_ed_path
. We should probably deal with it in a separate PR, to keep this one tidy.
72d48f4
to
0e2e5f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@praneethratna : Thanks for the changes. I have two tiny last suggestions (not sure why these didn't come to mind last time):
- rename
open_ds_da_ed_path
toopen_source
- rename
validate_source_ds_da_ed
tovalidate_source
I think then we can merge this!
Hey @leewujung I have addressed the above comments and also included the changes for #1237 in this PR since they are based on these changes. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @praneethratna : The last changes you made removed the part to save the added theta
and phi
variables to an existing dataset. Are you thinking that these variables would just be live in source_Sv
?
Maybe we just remove the add_angle_to_ds
function and put the content (with necessary modifications) in add_splitbeam_angle
?
Hey @leewujung I think they should live, but anyway I have moved the content to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @leewujung I think they should live, but anyway I have moved the content to
add_splitbeam_angle
itself and also removed thereturn_dataset
parameter!
Ah I see what the confusion may be. What I meant is that the functionality of saving the new variables phi
and theta
was removed in your changes, but we actually need the functionality (to update the on-disk dataset with the added variables phi
and theta
, while still being able to access them as angle_alongship
and angle_athwartship
).
How about we do the following:
- remove
return_dataset
- add a new argument
to_disk
(default toTrue
), whereto_disk=True
means that the angle will be saved to disk viamode="a"
and thesource_Sv
dataset lazy-loaded back and returned, andto_disk=False
means that the angle will just be added tosource_Sv
and returned but not saved to disk.
6b4aa8e
to
5cabf65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@praneethratna : I put in a couple comments about changes needed in the logic of checking the combination to_disk
and souce_Sv
type. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@praneethratna : I found a bug in the latest change and commented on it. Should be pretty straightforward to fix.
For the testing case where to_disk=True
, please also add the below to make sure that it is actually loading data from the temp zarr file (in which case the .data
is a dask array, not a numpy array):
assert isinstance(source_Sv["angle_alongship"].data, dask.array.core.Array)
assert isinstance(source_Sv["angle_athwartship"].data, dask.array.core.Array)
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for the changes! I'll merge this now!
Addresses #1129, #1237 and now
consolidate
subpackage functions can accept both in-memory or stored datasets.CC @leewujung