ASDF block API
#1847
Replies: 2 comments 8 replies
-
Tagging @lgarrison @perrygreenfield @nden and @zacharyburnett for thoughts. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Thanks for moving this forward! I think this kind of API would work fine with my use-case, which is very close to the example you gave. The only difference is that I usually access data by key in the tree, what's the best way to do that under this API? Would it be to get the block index from the tree/NDArrayType, then read the block? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently asdf doesn't provide any public API for interacting with ASDF blocks read from an ASDF file. There are some situations where this might be useful. One example is loading a block into a portion of a large array (without first loading the block into intermediate memory). Something like:
I propose that we restrict this to "read-only" access at the moment (so
AsdfFile.blocks
will only be defined after a call toasdf.open(fn)
and the block order and contents won't be modifiable). Minimally I propose that the API allow:len(af.blocks)
blk = af.blocks[0]
ASDFBlock
class (name tbd) that allows:blk.header
blk.header_offset
blk.data_offset
blk.load()
Some items to discuss are:
blk.load
seedcached_data
for the non-public block API?Beta Was this translation helpful? Give feedback.
All reactions