-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1572 from braingram/info_array_loading
raise AttributeError for __asdf_traverse__ on NDArrayType
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import numpy as np | ||
|
||
import asdf | ||
|
||
|
||
def test_asdf_info_should_not_load_arrays(tmp_path): | ||
""" | ||
AsdfFile.info should not load array data | ||
https://github.com/asdf-format/asdf/issues/1553 | ||
""" | ||
fn = tmp_path / "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" in str(af["b"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters