-
Notifications
You must be signed in to change notification settings - Fork 15
Asdf read speed #514
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
base: main
Are you sure you want to change the base?
Asdf read speed #514
Conversation
I just did a quick experiment locally and if we convert the Table to a numpy recarray before we save it ( Full codeimport dkist; from dkist.data.sample import VBI_AJQWW
tds = dkist.load_dataset(VBI_AJQWW)
whole_table = tds.combined_headers
import asdf
small1 = whole_table[0:10]
small2 = whole_table[10:20]
new_tree = {"whole": whole_table, "small1":small1, "small2": small2}
with asdf.AsdfFile(tree=new_tree) as af:
af.write_to("test.asdf")
<duplicates the data>
whole_array = whole_table.as_array()
array_tree = {"whole": whole_array, "small1":whole_array[0:10], "small2": whole_array[10:20]}
with asdf.AsdfFile(tree=array_tree) as af:
af.write_to("array.asdf")
<does not duplicate the data> For a small example: whole_table2 = whole_table[["INSTRUME", "DATE-AVG"]]
whole_array2 = whole_table2.as_array()
array_tree2 = {"whole": whole_array2, "small1":whole_array2[0:10], "small2": whole_array2[10:20]}
with asdf.AsdfFile(tree=array_tree2) as af:
af.write_to("array2.asdf") yields this asdf:
notice the I think this might be a good idea. My main worry is that it severely limits how rich we can make the metadata table, i.e. #265 becomes something custom we have to glue on the side rather than being able to use built-in features of astropy Table. However I think this approach has many advantages:
|
CodSpeed Performance ReportMerging #514 will improve performances by 13.82%Comparing Summary
Benchmarks breakdown
|
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.
Closer than we've ever been.
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
If I remember rightly, the current notebooks failure is a known sunpy issue and not a problem with this PR, which means this is actually finally ready to go, pending final review I guess. |
Fixes #500