From 7dd1437cb161b061641123d46375345f2f7b6f4e Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Fri, 29 Mar 2019 19:20:22 -0500 Subject: [PATCH 1/2] Document compression_level range is 1 to 9 The GZIP library supports compression_level 0 for no compression but this is slower than using the encoding='raw' method. Thus, the documentation was removed for this case. Note that the user can still specify a compression_level of 0 at their own peril. --- nrrd/writer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nrrd/writer.py b/nrrd/writer.py index b628d47..5904c30 100644 --- a/nrrd/writer.py +++ b/nrrd/writer.py @@ -132,8 +132,8 @@ def write(filename, data, header=None, detached_header=False, relative_data_path string identifying datatype for the custom field. compression_level : :class:`int` Int specifying compression level, when using a compressed encoding (.gz, .bz2). - - For zlib (.gz): 1-9 set low to high compression; 0 disables; -1 uses zlib default. - - For bzip2 (.bz2): 1-9 set low to high compression. + - 1: Fastest and compresses data the least + - 9: Slowest and compresses data the most See Also -------- From 9d2c05367e1fe70a609c0283173b0a65d0fe1679 Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Fri, 29 Mar 2019 20:15:13 -0500 Subject: [PATCH 2/2] Rewrite compression_level documentation --- nrrd/writer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nrrd/writer.py b/nrrd/writer.py index 5904c30..33cd0ec 100644 --- a/nrrd/writer.py +++ b/nrrd/writer.py @@ -131,9 +131,9 @@ def write(filename, data, header=None, detached_header=False, relative_data_path Dictionary used for parsing custom field types where the key is the custom field name and the value is a string identifying datatype for the custom field. compression_level : :class:`int` - Int specifying compression level, when using a compressed encoding (.gz, .bz2). - - 1: Fastest and compresses data the least - - 9: Slowest and compresses data the most + Integer between 1 to 9 specifying the compression level when using a compressed encoding (gzip or bzip). A value + of :obj:`1` compresses the data the least amount and is the fastest, while a value of :obj:`9` compresses the + data the most and is the slowest. See Also --------