Skip to content
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

AsdfFile.info loads array data #1553

Closed
braingram opened this issue May 25, 2023 · 0 comments · Fixed by #1572
Closed

AsdfFile.info loads array data #1553

braingram opened this issue May 25, 2023 · 0 comments · Fixed by #1572

Comments

@braingram
Copy link
Contributor

It appears that this line is triggering array data to be loaded for every array displayed in the the info:

return hasattr(node, "__asdf_traverse__")

Here is a minimal script showing that info loads array data:

import asdf
import numpy as np

fn = 'test.asdf'
tree = dict([(k, np.arange(ord(k))) for k in 'abc'])
asdf.AsdfFile(tree).write_to(fn)

with asdf.open(fn) as af:
    assert 'unloaded' in str(af['b'])
    af.info()
    assert 'unloaded' not in str(af['b'])
braingram added a commit to braingram/asdf that referenced this issue Jun 27, 2023
NDArrayType does not implement this method and if not
intercepted (and an AttributeError raised) than AsdfFile.info
will load all array data

Fixes: asdf-format#1553
braingram added a commit to braingram/asdf that referenced this issue Jul 14, 2023
NDArrayType does not implement this method and if not
intercepted (and an AttributeError raised) than AsdfFile.info
will load all array data

Fixes: asdf-format#1553
braingram added a commit to braingram/asdf that referenced this issue Jul 19, 2023
NDArrayType does not implement this method and if not
intercepted (and an AttributeError raised) than AsdfFile.info
will load all array data

Fixes: asdf-format#1553
braingram added a commit to braingram/asdf that referenced this issue Jul 31, 2023
NDArrayType does not implement this method and if not
intercepted (and an AttributeError raised) than AsdfFile.info
will load all array data

Fixes: asdf-format#1553
braingram added a commit to braingram/asdf that referenced this issue Aug 7, 2023
NDArrayType does not implement this method and if not
intercepted (and an AttributeError raised) than AsdfFile.info
will load all array data

Fixes: asdf-format#1553
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant