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

add anchor, endian, structured and scalars reference files #439

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions reference_files/1.0.0/anchor.asdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ASDF 1.0.0
#ASDF_STANDARD 1.0.0
%YAML 1.1
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
a: &id001 {abc: 123}
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.3.0}
b: *id001
...
10 changes: 10 additions & 0 deletions reference_files/1.0.0/anchor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ASDF 1.0.0
#ASDF_STANDARD 1.0.0
%YAML 1.1
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
a: &id001 {abc: 123}
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.3.0}
b: *id001
...
Binary file modified reference_files/1.0.0/ascii.asdf
Binary file not shown.
2 changes: 1 addition & 1 deletion reference_files/1.0.0/ascii.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
data: !core/ndarray-1.0.0
data: ['', ascii]
datatype: [ascii, 5]
Expand Down
Binary file modified reference_files/1.0.0/basic.asdf
Binary file not shown.
2 changes: 1 addition & 1 deletion reference_files/1.0.0/basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
data: !core/ndarray-1.0.0
data: [0, 1, 2, 3, 4, 5, 6, 7]
datatype: int64
Expand Down
Binary file modified reference_files/1.0.0/complex.asdf
Binary file not shown.
2 changes: 1 addition & 1 deletion reference_files/1.0.0/complex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
datatype<c16: !core/ndarray-1.0.0
data: [!core/complex-1.0.0 0j, !core/complex-1.0.0 0j, !core/complex-1.0.0 (nan+nanj),
!core/complex-1.0.0 (nan+infj), !core/complex-1.0.0 (nan-infj), !core/complex-1.0.0 -1.7976931348623157e+308j,
Expand Down
Binary file modified reference_files/1.0.0/compressed.asdf
Binary file not shown.
2 changes: 1 addition & 1 deletion reference_files/1.0.0/compressed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
bzp2: !core/ndarray-1.0.0
data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
Expand Down
Binary file added reference_files/1.0.0/endian.asdf
Binary file not shown.
20 changes: 20 additions & 0 deletions reference_files/1.0.0/endian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ASDF 1.0.0
#ASDF_STANDARD 1.0.0
%YAML 1.1
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.3.0}
big: !core/ndarray-1.0.0
data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41]
datatype: int32
shape: [42]
little: !core/ndarray-1.0.0
data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41]
datatype: int32
shape: [42]
...
2 changes: 1 addition & 1 deletion reference_files/1.0.0/exploded.asdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
data: !core/ndarray-1.0.0
source: exploded0000.asdf
datatype: int64
Expand Down
2 changes: 1 addition & 1 deletion reference_files/1.0.0/exploded.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
data: !core/ndarray-1.0.0
data: [0, 1, 2, 3, 4, 5, 6, 7]
datatype: int64
Expand Down
Binary file modified reference_files/1.0.0/exploded0000.asdf
Binary file not shown.
Binary file modified reference_files/1.0.0/float.asdf
Binary file not shown.
2 changes: 1 addition & 1 deletion reference_files/1.0.0/float.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
datatype<f4: !core/ndarray-1.0.0
data: [0.0, -0.0, .nan, .inf, -.inf, -3.4028234663852886e+38, 3.4028234663852886e+38,
1.1920928955078125e-07, 5.960464477539063e-08, 1.1754943508222875e-38]
Expand Down
Binary file modified reference_files/1.0.0/int.asdf
Binary file not shown.
2 changes: 1 addition & 1 deletion reference_files/1.0.0/int.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
datatype<i1: !core/ndarray-1.0.0
data: [127, -128, 0]
datatype: int8
Expand Down
11 changes: 11 additions & 0 deletions reference_files/1.0.0/scalars.asdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ASDF 1.0.0
#ASDF_STANDARD 1.0.0
%YAML 1.1
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.3.0}
float: 3.14
int: 42
string: foo
...
11 changes: 11 additions & 0 deletions reference_files/1.0.0/scalars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ASDF 1.0.0
#ASDF_STANDARD 1.0.0
%YAML 1.1
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.3.0}
float: 3.14
int: 42
string: foo
...
Binary file modified reference_files/1.0.0/shared.asdf
Binary file not shown.
2 changes: 1 addition & 1 deletion reference_files/1.0.0/shared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
data: !core/ndarray-1.0.0
data: [0, 1, 2, 3, 4, 5, 6, 7]
datatype: int64
Expand Down
Binary file modified reference_files/1.0.0/stream.asdf
Binary file not shown.
2 changes: 1 addition & 1 deletion reference_files/1.0.0/stream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
my_stream: !core/ndarray-1.0.0
data:
- [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
Expand Down
Binary file added reference_files/1.0.0/structured.asdf
Binary file not shown.
18 changes: 18 additions & 0 deletions reference_files/1.0.0/structured.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ASDF 1.0.0
#ASDF_STANDARD 1.0.0
%YAML 1.1
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.3.0}
structured: !core/ndarray-1.0.0
data:
- [1, a, 3.299999952316284]
- [2, b, 6.599999904632568]
datatype:
- {datatype: uint8, name: a}
- datatype: [ascii, 3]
name: b
- {datatype: float32, name: c}
shape: [2]
...
Binary file modified reference_files/1.0.0/unicode_bmp.asdf
Binary file not shown.
2 changes: 1 addition & 1 deletion reference_files/1.0.0/unicode_bmp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
datatype<U: !core/ndarray-1.0.0
data: ['', Æʩ]
datatype: [ucs4, 2]
Expand Down
Binary file modified reference_files/1.0.0/unicode_spp.asdf
Binary file not shown.
2 changes: 1 addition & 1 deletion reference_files/1.0.0/unicode_spp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 3.0.1}
name: asdf, version: 3.3.0}
datatype<U: !core/ndarray-1.0.0
data: ['', "\U00010020"]
datatype: [ucs4, 1]
Expand Down
41 changes: 41 additions & 0 deletions reference_files/generate/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,47 @@
import numpy as np


def ref_scalars(fd):
tree = {
'int': 42,
'float': 3.14,
'string': 'foo',
}
asdf.AsdfFile(tree).write_to(fd)


def ref_anchor(fd):
nestee = {"abc": 123}
tree = {
"a": nestee,
"b": nestee,
}
asdf.AsdfFile(tree).write_to(fd)


def ref_endian(fd):
tree = {
'big': np.arange(42, dtype=">i4"),
'little': np.arange(42, dtype="<i4"),
}

asdf.AsdfFile(tree).write_to(fd)


def ref_structured(fd):
tree = {
'structured': np.array(
[
(1, 'a', 3.3),
(2, 'b', 6.6),
], dtype=[
('a', np.uint8),
('b', 'S3'),
('c', np.float32),
]),
}
asdf.AsdfFile(tree).write_to(fd)

def ref_basic(fd):
tree = {
'data': np.arange(8)
Expand Down
Loading