-
Notifications
You must be signed in to change notification settings - Fork 49
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
Data refactor updates #547
Data refactor updates #547
Conversation
I just pushed a commit to this branch to refactor things a tiny bit. Changes look good. Thanks for working on them. A comment:
To respond to your questions:
Would it be possible just change the I agree we should support writing separately to the same file, (re #545) at least eventually. If there is not a big need for it now, we could try to remove group_path all together and keep "w" mode. And the later work on features related to #545. Otherwise, maybe adding the mode (default
Yea, more generally the inheritance regarding
Regarding
Don't see a need to change it personally. The
I think we could implement a wrapper in Maybe writing our own wrappers for
My opinion is maybe that we should limit the scope of this data refactor to try to merge in the improvements and simplifications we have before trying to add more to it, otherwise it might never get merged in. So perhaps in that spirit, I could see working on the following things at a later time (even soon after merging the refactor PR), unless there's a strong need for them now:
Feel free to merge this into |
333405a
to
ee1ae28
Compare
c1149ee
to
0179d12
Compare
0179d12
to
26f7441
Compare
I pushed another update. With this and my fixes to the backend, most backend tests now pass (hopefully fixing the last fews that don't will only require backend fixes). I kept this PR open for you to have a look one last time though.
Ugh... I just now realized this and I have lost those changes. Earlier, I pulled your branch, which had conflicts with this branch because you also made some commits there yesterday. Locally, I rebased my branch against your branch, and force pushed it here. So I don't know what was in that commit but it's lost now, but you should still have it locally. See if there's something you still want to change.
I added to the docstring.
So you had added the commit referenced in #545 which allows for separate
Summary of my opinions and changes regarding this whole issue:
|
I wonder if it makes sense to do the FieldData.from_hdf5('sim_data.hdf5', group_path=['data', 'data_0']) instead of FieldData.from_hdf5('sim_data.hdf5', group_path='data/data_0']) would make things cleaner on the backend and possibly front end, no ambiguity or string parsing.. Just a thought.
This sounds fine to me. we can always change things later too to support more complex behavior. Regarding your opinions on the inheritance:
Agree. Until we need something more sophisticated, let's not mess with it.
This sounds good to me. Well, sounds like things are shaping up. Should we go ahead and merge your PR into Pending decisions / questions seem to be
|
a68e7d5
to
c592a11
Compare
Fixed:
xr.load_dataarray
instead ofxr.open_dataarray
so as not to block the file (also modified test to check for that)./
in the beginning ofgroup_path
for convenience.group_path
is a bit pointless to begin with...)Remaining issues I didn't have time for / would like to discuss:
SimulationData.to_hdf5
file a bit to call each of theMonitorData
-sto_hdf5
with the corresponding group name). But basically I see three options:to_hdf5
similar to xarrayto_netcdf
.group_path
kwarg since like I say above if we can't store more than one model in the same file thegroup_path
is not very useful.FieldDataArray.interp
, but this returns a regularxr.DataArray
. Similarly, I can callModeSolverData.sel_mode_index
, but this returns aFieldDataset
instead ofFieldData
. So:FieldDataArray.interp
that calls the xarray interp but returns aFieldDataArray
?sel_mode_index
inModeSolverData
, leave it as is (only inModeSolverDataset
), or remove altogether? On some level I feel like we should either have a full-fledgedsel
wrapper or nothing at all. But it is convenient sometimes.