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

Issue64 #65

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 2 additions & 1 deletion pyfive/dataobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ def compression_opts(self):
if GZIP_DEFLATE_FILTER in self._filter_ids:
gzip_entry = [d for d in self.filter_pipeline
if d['filter_id'] == GZIP_DEFLATE_FILTER][0]
return gzip_entry['client_data'][0]
key = {0:'client_data_values',1:'client_data'}['client_data' in gzip_entry]
return gzip_entry[key][0]
return None

@property
Expand Down
9 changes: 9 additions & 0 deletions tests/test_filter_pipeline_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ def test_filter_pipeline_descr_v2():
d = hfile['data']
assert d.shape == (10,10,10)
assert_almost_equal(d[0,0,0], 1.0)


def test_filter_pipeline_compression_opts_v2():

with pyfive.File(FILTER_PIPELINE_V2_FILE) as hfile:
assert 'data' in hfile
d = hfile['data']
# the point of this test is to ensure we can actually retrieve the compression opts
x = d.compression_opts
Loading