-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Access table metadata without loading data #166
Comments
Yes and you correctly summarize this below:
This should enable you to read the metadata while lazy-loading the array data (assuming you aren't using some exotic file storage system).
Without a much deeper investigation, I am not sure if this will also lazy-load the table's arrays when you need them. Just looking at the code in @taldcroft do you know if this call asdf-astropy/asdf_astropy/converters/table/table.py Lines 39 to 45 in 23131e6
data passed in or not? If it does not actually access the data in the array itself, then the data in the array will remain on disk until one attempts to actually access values in it.
|
@LibrEars can you supply the yaml header of this file for us to inspect? (Or the whole file, but it may be too large to easily transport or have proprietary info you don't want to send). This can be done by using the command line utility |
Thank you for your responses! it is the same type of file as used for the example in #118 (you could use the code there to generate it. I can not upload to GitHub since .asdf is not supported for upload)
|
Thanks @LibrEars. Can you give an example of the metadata from the table itself? If there is information there that isn't appearing in the above, then I'd say the current implementation can't avoid loading the data. We would have to look at whether it is possible to reorganize the storage of the tables so that it is possible. |
By calling
will yield
|
I'm not sure I understand the requirements entirely. Is it essential that the metadata for the table actually be in the meta attribute of the QTable? Based on the other issue, the focus seemed to be to make the file easy to access for those not wanting to use Python. For those, they won't be using QTable. As a work around, one can create an ASDF node for the table that has both a meta and a qtable attribute where meta has been populated with the qtable.meta contents (I don't know if you need the metadata attached to the QTable or not; you may, depending on the code using the tables). In saving the table this way, you will have duplicated metadata information. I don't know if that is a problem. |
Another workaround is to open the ASDF file using the |
thank you @perrygreenfield for the response. I have written a python module that first imports all the meta-data of measurements into a table. Like this it allows to filter measurements for specific meta-data (like the measurement type, experimentalist or experiment settings like temperature etc. ) and group them in order to import data only as a subgroup and to plot it in a later step. The source will be published soon and I will link it as reference. With #118 I only want to make sure that an adaption of asdf would not exclude users who wish to use their own software that is not able to read the binary part |
Hello =)
Is it possible to access only the metadata of e.g. Qtables stored in the .asdf file-format without loading the data itself into memory? I tried to use
QTable.read()
with afind_table
key-word buttree["data"]["meta"]
will result in an error since the meta-data alone does not represent a table.In the asdf documentation they state that "Array data remains unloaded until it is explicitly accessed". Therefore I thought it might be possible.
Here is a try using the example-data (QTable) from #118 :
Or is a simple
already doing the job without reading the table data into memory? Otherwise, would it be useful to be implemented into astropy somehow?
The text was updated successfully, but these errors were encountered: