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

Drop support for multiple Streams per AsdfFile #1546

Open
braingram opened this issue May 15, 2023 · 0 comments
Open

Drop support for multiple Streams per AsdfFile #1546

braingram opened this issue May 15, 2023 · 0 comments

Comments

@braingram
Copy link
Contributor

It appears asdf support multiple Stream objects (that share the same streamed block) in one AsdfFile. The usefulness of this is questionable and complicates streamed block handling. Support for this undocumented feature should be removed:

def test_stream_twice():
"""
Test that if you write nothing, you get a zero-length array
"""
buff = io.BytesIO()
tree = {"stream": stream.Stream([6, 2], np.uint8), "stream2": stream.Stream([12, 2], np.uint8)}
ff = asdf.AsdfFile(tree)
ff.write_to(buff)
for i in range(100):
buff.write(np.array([i] * 12, np.uint8).tobytes())
buff.seek(0)
ff = asdf.open(buff)
assert len(ff._blocks) == 1
assert ff.tree["stream"].shape == (100, 6, 2)
assert ff.tree["stream2"].shape == (50, 12, 2)

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

No branches or pull requests

1 participant