Skip to content

Commit

Permalink
Fix bug where all_array_compression overrides set_array_compression
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella committed May 25, 2018
1 parent ce0848b commit 608203f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

- Allow serialization of broadcasted ``numpy`` arrays. [#507]

- Fix bug that caused result of ``set_array_compression`` to be overwritten by
``all_array_compression`` argument to ``write_to``. [#510]

2.0.1 (2018-05-08)
------------------

Expand Down
5 changes: 4 additions & 1 deletion asdf/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,10 @@ def _handle_global_block_settings(self, ctx, block):
self.set_array_storage(block, all_array_storage)

all_array_compression = getattr(ctx, '_all_array_compression', 'input')
block.output_compression = all_array_compression
# Only override block compression algorithm if it wasn't explicitly set
# by AsdfFile.set_array_compression.
if all_array_compression != 'input':
block.output_compression = all_array_compression

auto_inline = getattr(ctx, '_auto_inline', None)
if auto_inline:
Expand Down

0 comments on commit 608203f

Please sign in to comment.